paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Semantically-Adaptive Upsampling for Layout-to-Image Translation
1 INTRODUCTION . The layout-to-image translation task aims to translate input layouts to realistic images ( see Fig . 1 ( a ) ) , which have many real-world applications and draw much attention from the community ( Park et al. , 2019 ; Liu et al. , 2019 ; Jiang et al. , 2020 ; Tang et al. , 2020 ) . For example , Park et al . ( 2019 ) propose GauGAN with a novel spatially-adaptive normalization to generate realistic images from semantic layouts . Liu et al . ( 2019 ) propose CC-FPSE , which predicts convolutional kernels conditioned on the semantic layout and then generate the images . Tang et al . ( 2020 ) propose LGGAN with several local generators for generating realistic small objects . Despite the interesting exploration of these methods , we can still observe artifacts and blurriness in their generated images because they always adopt the nearest-neighbor interpolation to upsample feature maps and then to generate final results . Feature upsampling is a key operation in the layout-to-image translation task . Traditional upsampling methods such as nearest-neighbor , bilinear , and bicubic only consider sub-pixel neighborhood ( indicated by white circles in Fig . 1 ( b ) ) , failing to capture the complete semantic information , e.g. , the head and body of the dog , and the front part of the car . Learnable upsampling methods such as Deconvolution ( Noh et al. , 2015 ) and Pixel Shuffle Shi et al . ( 2016 ) are able to obtain the global information with larger kernel size , but learns the same kernel ( indicated by the white arrows in Fig . 1 ( c ) ) across the image , regardless of the semantic information . Other feature enhancement methods such as Spatial Attention ( Fu et al. , 2019 ) can learn different kernels ( indicated by different color arrows in Fig . 1 ( d ) ) , but it still inevitable captures a lot of redundant information , i.e. , ‘ grasses ’ and ‘ soil ’ . Also , it is prohibitively expensive since it needs to consider all the pixels . To fix these limitations , we propose a novel Semantically-Adaptive UpSampling ( SA-UpSample ) for this challenging task in Fig . 1 ( e ) . Our SA-UpSample dynamically upsamples a small subset of relevant pixels based on the semantic information , i.e. , the green and the tangerine circles represent the pixels within the dog and the car , respectively . In this way , SA-UpSample is more efficient than both Deconvolution , Pixel Shuffle , and Spatial Attention , and can capture more complete semantic information than traditional upsampling methods such as the nearest-neighbor interpolation . We perform extensive experiments on six popular datasets with diverse scenarios and different image resolutions , i.e. , Cityscapes ( Cordts et al. , 2016 ) , ADE20K ( Zhou et al. , 2017 ) , COCO-Stuff ( Caesar et al. , 2018 ) , DeepFashion ( Liu et al. , 2016 ) , CelebAMask-HQ ( Lee et al. , 2020 ) , and Facades ( Tyleček & Šára , 2013 ) . We show that with the help of SA-UpSample , our framework can synthesize better results compared to several state-of-the-art methods . Moreover , an extensive ablation study shows the effectiveness of SA-UpSample against other feature upsampling and enhancement methods for the layout-to-image translation task . 2 RELATED WORK . Feature Upsampling . Traditional upsampling methods such as nearest-neighbor and bilinear interpolations use spatial distance and hand-crafted kernels to capture the correlations between pixels . Recently , several deep learning methods such as Deconvolution ( Noh et al. , 2015 ) and Pixel Shuffle Shi et al . ( 2016 ) are proposed to upsample feature maps using learnable kernels . However , these methods either exploit semantic information in a small neighborhood or use a fixed kernel . Some other works of super-resolution , inpainting , denoising ( Mildenhall et al. , 2018 ; Wang et al. , 2019 ; Jo et al. , 2018 ; Hu et al. , 2019 ) also explore using learnable kernels . However , the settings of these tasks are significantly different from ours , making their methods can not be used directly . Layout-to-Image Translation tries to convert semantic layouts into realistic images ( Park et al. , 2019 ; Liu et al. , 2019 ; Jiang et al. , 2020 ; Tang et al. , 2020 ; Zhu et al. , 2020a ; Ntavelis et al. , 2020 ; Zhu et al. , 2020b ) . Although existing methods have generated good images , we still see unsatisfactory aspects mainly in the generated content details and intra-object completions , which we believe is mainly due to they always adopt the nearest-neighbor interpolation to upsample feature maps and then generate final results . To fix this limitation , we propose a novel Semantically-Adaptive UpSampling ( SA-UpSample ) for this task . To the best of our knowledge , we are the first to investigate the influence of feature upsampling on this challenging task . 3 SEMANTICALLY-ADAPTIVE UPSAMPLING ( SA-UPSAMPLE ) . An illustration of the proposed Semantically-Adaptive UpSampling ( SA-UpSample ) is shown in Fig . 2 , which mainly consists of two branches , i.e. , the Semantically-Adaptive Kernel Generation ( SAKG ) branch predicting upsample kernels according to the semantic information , and the Semantically-Adaptive Feature Upsampling ( SAFU ) branch selectively performs the feature upsampling based on the kernels learned in SAKG . All components are trained in an end-to-end fashion so that the two branches can benefit from each other . Specifically , given a feature map f∈RC×H×W and an upsample scale s , SA-UpSample aims to produce a new feature map f ′∈RC×Hs×Ws . For any target location l′= ( i′ , j′ ) in the output f ′ , there is a corresponding source location l= ( i , j ) at the input f , where i=bi′/sc , j=bj′/sc . We denote N ( l , k ) as the k×k sub-region of f centered at the location l in , i.e. , the neighbor of the location l. See Fig . 1 and 2 for illustration . 3.1 SEMANTICALLY-ADAPTIVE KERNEL GENERATION ( SAKG ) BRANCH . This branch aims to generate a semantically-adaptive kernel at each location according to the semantic information , which consists of four modules , i.e. , Feature Channel Compression , Semantic Kernel Generation , Feature Shuffle , and Channel-wise Normalization . Feature Channel Compression . This module is used to reduce the network parameters and computational cost . Specifically , the input feature f is fed into a convolution layer with 1×1 kernel to compress the input channel from C to C ′ , making SA-UpSample with fewer network parameters . Semantic Kernel Generation . This module receives the feature fc∈RC ′×H×W as input ( where H and W denotes the height and width of the feature map ) and ties to generate different semanticallyadaptive kernels , which can be represented as fk∈Rk 2s2×H×W , where k is the semantically-adaptive upsampling kernel size and s is the expected upsample scale . Feature Shuffle . We then feed the feature fk through a feature shuffle layer for rearranging elements in fk , leading to a new feature map fs∈Rk 2×Hs×Ws , where k2=k×k represents the learned semantic kernel . Note that the learned semantic kernels are quit different at different locations l′ , as shown in Fig . 1 and 3 . Channel-wise Normalization . After that , we perform a channel-wise softmax operation on each semantic kernel fs to obtain the normalized kernel fn , i.e. , the sum of the weight values in k2 is equal to 1 . In this way , we can guarantee that information from the combination would not explode . Also , the semantically-adaptive kernels can encode where to emphasize or suppress according to the semantic information . 3.2 SEMANTICALLY-ADAPTIVE FEATURE UPSAMPLING ( SAFU ) BRANCH . This branch aims to upsample the input feature f based on the kernel fn learned in the SAKG branch in a semantically-adaptive way , which contains four modules , i.e. , Feature Spatial Expansion , Sliding Local Block Extraction , Feature Reshape , and Upsampling Feature Selection . Feature Spatial Expansion . The input feature f is fed into this module to expand the size of spatial from H×W to Hs×Ws . Specifically , we adopt the nearest interpolation to achieve this process . Sliding Local Block Extraction . Then the expanded feature fe∈RC×Hs×Ws is fed into this module to extract sliding local block of each location in fe , leading to the new feature fl∈RCk 2×Hs×Ws . Feature Reshape . Thus , we reshape fl by adding a dimension , resulting in a new feature fr∈RC×k 2×Hs×Ws . In this way , we can do multiplication between the reshaped local block fr and the learned kernel fn . Upsamling Feature Selection . Finally , the feature map fr and the kernel fn learned in the SAKG branch are fed into the Upsampling Feature Selection module to generate the final feature map f ′∈RC×Hs×Ws by an weighted sum manner . The computation process at the location l= ( i , j ) can be expressed as follow , f ′ = bk/2c∑ p=−bk/2c bk/2c∑ q=−bk/2c fr ( i+ p , j + q ) × fn ( p , q ) . ( 1 ) In this way , the pixels in the learned kernel fn contributes to the upsampled pixel l′ differently , based on the semantic information of features instead of the spatial distance of locations . The semantics of the upsampled feature map can be stronger than the original one , since the information from relevant points in a local region can be more attended , and the pixels with the same semantic label can achieve mutual gains , improving intra-object semantic consistency . 3.3 WHY DOES THE SA-UPSAMPLE WORK BETTER ? . A short answer is that it can better preserve semantic information against common upsampling methods . Specifically , while other upsampling methods such as nearest-neighbor interpolation and Deconvolution are essential parts in almost all the state-of-the-art image generation ( Radford et al. , 2016 ) and translation ( Park et al. , 2019 ) models , they tend to ‘ pollute ’ semantic information when performing feature upsampling since it would inevitably incorporate contaminating information from irrelevant regions ( see Fig . 1 ) . In contrast , the proposed SA-UpSample performs feature upsampling by using itself , i.e. , it uses the pixels belonging to the same semantic label to upsample the feature maps . Hence , the generator can better preserve semantic information . It enjoys the benefit of feature upsampling without losing the input semantic information . In Fig . 3 , we show some examples of the learned semantically-adaptive kernels . We can easily observe that the proposed SA-UpSample upsamples features by leveraging complementary features in the regions of the same semantic information than local regions of fixed shape to generate consistent objects/scenarios , further confirming our motivations . 3.4 OPTIMIZATION OBJECTIVE AND TRAINING DETAILS . We follow GauGAN ( Park et al. , 2019 ) and use three losses as our training objective , i.e. , L=λganLgan+λfLf+λpLp , where Lgan , Lf and Lp represent adversarial , discriminator feature matching , and perceptual loss , respectively . We set λgan=1 , λf=10 , and λp=10 in our experiments . We use the multi-scale discriminator ( Park et al. , 2019 ) as our discriminator . Moreover , we set C ′=64 , k=5 and s=2 in the proposed SA-UpSample . We replace the upsampling layers in GauGAN with our SA-UpSample layers . The proposed method is implemented by using PyTorch ( Paszke et al. , 2019 ) . We conduct the experiments on NVIDIA DGX1 with 8 32GB V100 GPUs .
This paper presents a module named semantically-adaptive upsampling (SA-UpSample) to achieve layout-to-image translation. The proposed method is able to aggregate semantic information in the layout input and adaptively conducts class-specific upsampling in the translation process. Experiments on six datasets demonstrate the effectiveness of the proposed mehtod. However, there are still several issues to be addressed.
SP:9cc61518a96c3aebe0869a87fc84ea2e13c752e5
Unconditional Synthesis of Complex Scenes Using a Semantic Bottleneck
1 INTRODUCTION . Significant strides have been made on generative models for image synthesis , with a variety of methods based on Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) achieving stateof-the-art performance . At lower resolutions or in specialized domains , GAN-based methods are able to synthesize samples which are near-indistinguishable from real samples ( Brock et al. , 2019 ) . However , generating complex , high-resolution scenes from scratch remains a challenging problem , as shown in Figure 1- ( a ) and ( b ) . As image resolution and complexity increase , the coherence of synthesized images decreases — samples lack consistent local or global structures . Stochastic decoder-based models , such as conditional GANs , were recently proposed to alleviate some of these issues . In particular , both Pix2PixHD ( Wang et al. , 2018 ) and SPADE ( Park et al. , 2019 ) are able to synthesize high-quality scenes using a strong conditioning mechanism based on semantic segmentation labels during the scene generation process . Global structure encoded in the segmentation layout of the scene is what allows these models to focus primarily on generating convincing local content consistent with that structure . A key practical drawback of such conditional models is that they require full segmentation layouts as input . Thus , unlike unconditional generative approaches which synthesize images from randomly sampled noise , these models are limited to generating images from a set of scenes that is prescribed in advance , typically either through segmentation labels from an existing dataset , or scenes that are hand-crafted by experts . Contributions To overcome these limitations , we propose a new model , the Semantic Bottleneck GAN ( SB-GAN ) , which couples high-fidelity generation capabilities of label-conditional models with the flexibility of unconditional image generation . This in turn enables our model to synthesize an unlimited number of novel complex scenes , while still maintaining high-fidelity output characteristic of image-conditional models . Our SB-GAN first unconditionally generates a pixel-wise semantic label map of a scene ( i.e . for each spatial location it outputs a class label ) , and then generates a realistic scene image by conditioning on that semantic map , Figure 1- ( d ) . By factorizing the task into these two steps , we are able to separately tackle the problems of producing convincing segmentation layouts ( i.e . a useful global structure ) and filling these layouts with convincing appearances ( i.e . local structure ) . When trained end-to-end , the model yields samples which have a coherent global structure as well as fine local details , e.g. , Figure 1- ( c ) . Empirical evaluation shows that our Semantic Bottleneck GAN achieves a new state-of-the-art on two complex datasets with relatively small number of training images , Cityscapes and ADE-Indoor , as measured both by the Fréchet Inception Distance ( FID ) and by perceptual evaluations . Additionally , we observe that the conditional segmentation-to-image synthesis component of our SB-GAN jointly trained with segmentation layout synthesis significantly improves the state-of-the-art semantic image synthesis network ( Park et al. , 2019 ) , resulting in higher-quality outputs when conditioning on ground truth segmentation layouts . Key Challenges While both unconditional generation and image-to-image translation are wellexplored learning problems , fully unconditional generation of the segmentation maps is a notoriously hard task : ( i ) Semantic categories do not respect any ordering relationships and the network is therefore required to capture the intricate relationship between segmentation classes , their shapes , and their spatial dependencies . ( ii ) As opposed to RGB values , semantic categories are discrete , hence non-differentiable which poses a challenge for end-to-end training ( Sec . 3.2 ) ( iii ) Naively combining state-of-the-art unconditional generation and image-to-image translation models leads to poor performance . However , by carefully designing an additional discriminator component and a corresponding training protocol , we not only manage to improve the performance of the end-to-end model , but also the performance of each component separately ( Sec . 3.3 ) . We emphasize that despite these challenges our approach scales to 256 × 256 resolution and 95 semantic categories , whereas existing state-of-the-art GAN models directly generating RGB images at that resolution already suffer from considerable instability ( Sec . 4 ) . 2 RELATED WORK . Generative Adversarial Networks ( GANs ) GANs ( Goodfellow et al. , 2014 ) are a powerful class of generative models successfully applied to various image synthesis tasks such as image style transfer ( Isola et al. , 2017 ; Zhu et al. , 2017 ) , unsupervised representation learning ( Chen et al. , 2016 ; Pathak et al. , 2016 ; Radford et al. , 2016 ) , image super-resolution ( Ledig et al. , 2017 ; Dong et al. , 2016 ) , and text-to-image synthesis ( Zhang et al. , 2017 ; Xu et al. , 2018 ; Qiao et al. , 2019b ) . Training GANs is notoriously hard and recent efforts focused on improving neural architectures ( Wang & Gupta , 2016 ; Karras et al. , 2017 ; Zhang et al. , 2019 ; Chen et al. , 2019a ) , loss functions ( Arjovsky et al. , 2017 ) , regularization ( Gulrajani et al. , 2017 ; Miyato et al. , 2018 ) , large-scale training ( Brock et al. , 2019 ) , self-supervision ( Chen et al. , 2019b ) , and sampling ( Brock et al. , 2019 ; Azadi et al. , 2019a ) . Improving the performance of GANs by disentangling structure and style has been studied by Wang & Gupta ( 2016 ) where structure is represented by a surface normal map and style is the texture mapped onto the structure . Another compelling approach which enables generation of high-resolution images is based on progressive training : a model is trained to first synthesize lowerresolution images ( e.g . 8× 8 ) , then the resolution is gradually increased until the desired resolution is achieved ( Karras et al. , 2017 ) . Recently , Brock et al . ( 2019 ) showed that GANs significantly benefit from large-scale training , both in terms of model size and batch size . We note that these models are able to synthesize high-quality images in settings where objects are very prominent and centrally placed or follow some well-defined structure , as the corresponding distribution is easier to capture . In contrast , when the scenes are more complex and the amount of data is limited , the task becomes extremely challenging for these state-of-the-art models . We aim to improve the performance in the context of complex scenes and a small number of training examples by disentangling the image generation problem into learning the structure represented by semantic layouts and filling in the RGB details using a semantic image synthesis model . A similar idea was proposed by a concurrent work ( Volokitin et al. , 2020 ) with substantial differences in the model and results . GANs on discrete domains GANs for discrete domains have been investigated in several works ( Yu et al. , 2017b ; Lin et al. , 2017 ; Bojchevski et al. , 2018 ; Lu et al. , 2018 ) . Training in this domain is even more challenging as the samples from discrete distributions are not differentiable with respect to the network parameters . This problem can be somewhat alleviated by using the Gumbel-softmax distribution , which is a continuous approximation to a multinomial distribution parameterized in terms of the softmax function ( Kusner & Hernández-Lobato , 2016 ) . We will show how to apply a similar principle to learn the distribution of discrete segmentation masks . Conditional image synthesis In conditional image synthesis one aims to generate images by conditioning on an input which can be provided in the form of an image ( Isola et al. , 2017 ; Zhu et al. , 2017 ; Azadi et al. , 2018 ; 2019b ; Liu et al. , 2017 ) , a text phrase ( Reed et al. , 2016 ; Zhang et al. , 2017 ; Qiao et al. , 2019a ; Ashual & Wolf , 2019 ; Hong et al. , 2018 ) , a scene graph ( Johnson et al. , 2018 ; Ashual & Wolf , 2019 ) , a class label , or a semantic layout ( Odena et al. , 2017 ; Chen & Koltun , 2017 ; Wang et al. , 2018 ; Park et al. , 2019 ) . These conditional GAN methods learn a mapping that translates samples from the source distribution into samples from the target domain . The text-to-image synthesis models proposed in ( Hong et al. , 2018 ; Li et al. , 2019 ) decompose the synthesis task into multiple steps . As illustrated in the Appendix , given the text description , a semantic layout is constructed by generating object bounding boxes and refining each box by estimating object shapes . Then , an image is synthesized conditionally on the generated semantic layout from the first step . Our work shares the same high-level idea of decomposing the image generation problem into the semantic layout synthesis and the conditional semantic-layout-to-image synthesis . However , we note that the above approaches , as opposed to ours , are conditional and require supervision in the form of textual descriptions . Secondly , they are sequential in nature and synthesize masks of a few different objects ( e.g . person , elephant ) , but not a fully fine-grained semantic map ( e.g . missing sky , grass , etc. ) . In stark contrast , our approach unconditionally synthesizes the full semantic layout of the entire scene from a noise input in an end-to-end network design . Due to the above distinctions , their segmentation synthesis models differ significantly from ours in terms of architecture and design as shown in Figure 6 in the Appendix . 3 SEMANTIC BOTTLENECK GAN ( SB-GAN ) . We propose an unconditional Semantic Bottleneck GAN architecture to learn the distribution of complex scenes . To tackle the problems of learning both the global layout and the local structure , we divide this synthesis problem into two parts : an unconditional segmentation map synthesis network and a conditional segmentation-to-image synthesis model . Our first network is designed to coarsely learn the scene distribution by synthesizing semantic layouts . It generates per-pixel semantic categories following the progressive GAN model architecture ( ProGAN ) ( Karras et al. , 2017 ) . This fully unconditional generation of the segmentation maps is novel , very challenging , and a careful design is crucial , as described in Section 3.1 . The second network populates the synthesized semantic layouts with texture by predicting RGB pixel values using Spatially-Adaptive Normalization ( SPADE ) , following the architecture of the state-of-the-art semantic synthesis network in ( Park et al. , 2019 ) . We assume the ground truth segmentation masks are available for all or part of the target scene dataset . In the following sections , we will first discuss our semantic bottleneck synthesis pipeline and summarize the SPADE network for image synthesis . We will then couple these two networks in an end-to-end design which we refer to as Semantic Bottleneck GAN ( SB-GAN ) . 3.1 SEMANTIC BOTTLENECK SYNTHESIS . Our goal is to learn a ( coarse ) estimate of the scene distribution from samples corresponding to real segmentation maps with K semantic categories . Starting from random noise , we generate a tensor Y ∈ J1 , KKN×1×H×W which represents a per-pixel segmentation class , with H and W indicating the height and width , respectively , of the generated map and N the batch size . In practice , we progressively train from a low to a high resolution using the ProGAN architecture ( Karras et al. , 2017 ) coupled with the Improved WGAN loss function ( Gulrajani et al. , 2017 ) on the ground truth discrete-valued segmentation maps , illustrated in Figure 1- ( d ) . Similar to ProGAN , to increase the spatial resolution of the generated segmentation maps during training , we incrementally add layers to the generator and the discriminator . In contrast to ProGAN , in which the generator outputs continuous RGB values , we predict per-pixel discrete semantic class labels . This task is extremely challenging as it requires the network to capture the intricate relationship between segmentation classes and their spatial dependencies . To this end , we apply the Gumbel-softmax trick ( Jang et al. , 2017 ; Maddison et al. , 2016 ) coupled with a straight-through estimator ( Jang et al. , 2017 ) , described in detail below . We synthesize segmentation layouts by first generating per-pixel probability scores of belonging to each of the K semantic classes and then sampling a semantic class per pixel . The per-pixel probability scores are computed by applying a softmax function to the last layer of the generator ( i.e . logits ) which results in probability maps P ij ∈ [ 0 , 1 ] K , with ∑K k=1 P ij k = 1 for each spatial location ( i , j ) ∈ J1 , HK×J1 , W K. To sample a semantic class from this multinomial distribution , we would ideally apply the following well-known procedure at each spatial location : ( 1 ) sample k i.i.d . samples , Gk , from the standard Gumbel distribution , ( 2 ) add these samples to each logit , and ( 3 ) take the index of the maximal value . This reparametrization indeed allows for an efficient forward-pass , but is not differentiable . Nevertheless , the max can be replaced with the softmax function and the quality of the approximation can be controlled by varying the temperature hyperparameter τ — the smaller the τ , the closer the approximation is to the categorical distribution ( Jang et al. , 2017 ) : Sijk = exp { ( logP ijk +Gk ) /τ } ∑K i=1 exp { ( logP ij i +Gi ) /τ } . ( 1 ) Similar to the real samples , the synthesized samples fed to the GAN discriminator should still contain discrete category labels . As a result , for the forward pass , we compute arg maxk Sk , while for the backward pass , we use the soft predicted scores Sk directly , a strategy known as straight-through estimation ( Jang et al. , 2017 ) .
1. Summary. This paper considers a two-stage procedure of generation complex scenes (cityscapes or living rooms, i.e. without a central object): Firstly, a noise vector is mapped to a discrete semantic map (Gumbel softmax and straight-through estimator are applied). Secondly, the obtained segmentation map is translated to an RGB image using the SPADE architecture. Both networks are pretrained separately and then finetuned in an end-to-end manner.
SP:27acf2abf315fd87b9e382ee3fe28ec903074b9d
Unconditional Synthesis of Complex Scenes Using a Semantic Bottleneck
1 INTRODUCTION . Significant strides have been made on generative models for image synthesis , with a variety of methods based on Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) achieving stateof-the-art performance . At lower resolutions or in specialized domains , GAN-based methods are able to synthesize samples which are near-indistinguishable from real samples ( Brock et al. , 2019 ) . However , generating complex , high-resolution scenes from scratch remains a challenging problem , as shown in Figure 1- ( a ) and ( b ) . As image resolution and complexity increase , the coherence of synthesized images decreases — samples lack consistent local or global structures . Stochastic decoder-based models , such as conditional GANs , were recently proposed to alleviate some of these issues . In particular , both Pix2PixHD ( Wang et al. , 2018 ) and SPADE ( Park et al. , 2019 ) are able to synthesize high-quality scenes using a strong conditioning mechanism based on semantic segmentation labels during the scene generation process . Global structure encoded in the segmentation layout of the scene is what allows these models to focus primarily on generating convincing local content consistent with that structure . A key practical drawback of such conditional models is that they require full segmentation layouts as input . Thus , unlike unconditional generative approaches which synthesize images from randomly sampled noise , these models are limited to generating images from a set of scenes that is prescribed in advance , typically either through segmentation labels from an existing dataset , or scenes that are hand-crafted by experts . Contributions To overcome these limitations , we propose a new model , the Semantic Bottleneck GAN ( SB-GAN ) , which couples high-fidelity generation capabilities of label-conditional models with the flexibility of unconditional image generation . This in turn enables our model to synthesize an unlimited number of novel complex scenes , while still maintaining high-fidelity output characteristic of image-conditional models . Our SB-GAN first unconditionally generates a pixel-wise semantic label map of a scene ( i.e . for each spatial location it outputs a class label ) , and then generates a realistic scene image by conditioning on that semantic map , Figure 1- ( d ) . By factorizing the task into these two steps , we are able to separately tackle the problems of producing convincing segmentation layouts ( i.e . a useful global structure ) and filling these layouts with convincing appearances ( i.e . local structure ) . When trained end-to-end , the model yields samples which have a coherent global structure as well as fine local details , e.g. , Figure 1- ( c ) . Empirical evaluation shows that our Semantic Bottleneck GAN achieves a new state-of-the-art on two complex datasets with relatively small number of training images , Cityscapes and ADE-Indoor , as measured both by the Fréchet Inception Distance ( FID ) and by perceptual evaluations . Additionally , we observe that the conditional segmentation-to-image synthesis component of our SB-GAN jointly trained with segmentation layout synthesis significantly improves the state-of-the-art semantic image synthesis network ( Park et al. , 2019 ) , resulting in higher-quality outputs when conditioning on ground truth segmentation layouts . Key Challenges While both unconditional generation and image-to-image translation are wellexplored learning problems , fully unconditional generation of the segmentation maps is a notoriously hard task : ( i ) Semantic categories do not respect any ordering relationships and the network is therefore required to capture the intricate relationship between segmentation classes , their shapes , and their spatial dependencies . ( ii ) As opposed to RGB values , semantic categories are discrete , hence non-differentiable which poses a challenge for end-to-end training ( Sec . 3.2 ) ( iii ) Naively combining state-of-the-art unconditional generation and image-to-image translation models leads to poor performance . However , by carefully designing an additional discriminator component and a corresponding training protocol , we not only manage to improve the performance of the end-to-end model , but also the performance of each component separately ( Sec . 3.3 ) . We emphasize that despite these challenges our approach scales to 256 × 256 resolution and 95 semantic categories , whereas existing state-of-the-art GAN models directly generating RGB images at that resolution already suffer from considerable instability ( Sec . 4 ) . 2 RELATED WORK . Generative Adversarial Networks ( GANs ) GANs ( Goodfellow et al. , 2014 ) are a powerful class of generative models successfully applied to various image synthesis tasks such as image style transfer ( Isola et al. , 2017 ; Zhu et al. , 2017 ) , unsupervised representation learning ( Chen et al. , 2016 ; Pathak et al. , 2016 ; Radford et al. , 2016 ) , image super-resolution ( Ledig et al. , 2017 ; Dong et al. , 2016 ) , and text-to-image synthesis ( Zhang et al. , 2017 ; Xu et al. , 2018 ; Qiao et al. , 2019b ) . Training GANs is notoriously hard and recent efforts focused on improving neural architectures ( Wang & Gupta , 2016 ; Karras et al. , 2017 ; Zhang et al. , 2019 ; Chen et al. , 2019a ) , loss functions ( Arjovsky et al. , 2017 ) , regularization ( Gulrajani et al. , 2017 ; Miyato et al. , 2018 ) , large-scale training ( Brock et al. , 2019 ) , self-supervision ( Chen et al. , 2019b ) , and sampling ( Brock et al. , 2019 ; Azadi et al. , 2019a ) . Improving the performance of GANs by disentangling structure and style has been studied by Wang & Gupta ( 2016 ) where structure is represented by a surface normal map and style is the texture mapped onto the structure . Another compelling approach which enables generation of high-resolution images is based on progressive training : a model is trained to first synthesize lowerresolution images ( e.g . 8× 8 ) , then the resolution is gradually increased until the desired resolution is achieved ( Karras et al. , 2017 ) . Recently , Brock et al . ( 2019 ) showed that GANs significantly benefit from large-scale training , both in terms of model size and batch size . We note that these models are able to synthesize high-quality images in settings where objects are very prominent and centrally placed or follow some well-defined structure , as the corresponding distribution is easier to capture . In contrast , when the scenes are more complex and the amount of data is limited , the task becomes extremely challenging for these state-of-the-art models . We aim to improve the performance in the context of complex scenes and a small number of training examples by disentangling the image generation problem into learning the structure represented by semantic layouts and filling in the RGB details using a semantic image synthesis model . A similar idea was proposed by a concurrent work ( Volokitin et al. , 2020 ) with substantial differences in the model and results . GANs on discrete domains GANs for discrete domains have been investigated in several works ( Yu et al. , 2017b ; Lin et al. , 2017 ; Bojchevski et al. , 2018 ; Lu et al. , 2018 ) . Training in this domain is even more challenging as the samples from discrete distributions are not differentiable with respect to the network parameters . This problem can be somewhat alleviated by using the Gumbel-softmax distribution , which is a continuous approximation to a multinomial distribution parameterized in terms of the softmax function ( Kusner & Hernández-Lobato , 2016 ) . We will show how to apply a similar principle to learn the distribution of discrete segmentation masks . Conditional image synthesis In conditional image synthesis one aims to generate images by conditioning on an input which can be provided in the form of an image ( Isola et al. , 2017 ; Zhu et al. , 2017 ; Azadi et al. , 2018 ; 2019b ; Liu et al. , 2017 ) , a text phrase ( Reed et al. , 2016 ; Zhang et al. , 2017 ; Qiao et al. , 2019a ; Ashual & Wolf , 2019 ; Hong et al. , 2018 ) , a scene graph ( Johnson et al. , 2018 ; Ashual & Wolf , 2019 ) , a class label , or a semantic layout ( Odena et al. , 2017 ; Chen & Koltun , 2017 ; Wang et al. , 2018 ; Park et al. , 2019 ) . These conditional GAN methods learn a mapping that translates samples from the source distribution into samples from the target domain . The text-to-image synthesis models proposed in ( Hong et al. , 2018 ; Li et al. , 2019 ) decompose the synthesis task into multiple steps . As illustrated in the Appendix , given the text description , a semantic layout is constructed by generating object bounding boxes and refining each box by estimating object shapes . Then , an image is synthesized conditionally on the generated semantic layout from the first step . Our work shares the same high-level idea of decomposing the image generation problem into the semantic layout synthesis and the conditional semantic-layout-to-image synthesis . However , we note that the above approaches , as opposed to ours , are conditional and require supervision in the form of textual descriptions . Secondly , they are sequential in nature and synthesize masks of a few different objects ( e.g . person , elephant ) , but not a fully fine-grained semantic map ( e.g . missing sky , grass , etc. ) . In stark contrast , our approach unconditionally synthesizes the full semantic layout of the entire scene from a noise input in an end-to-end network design . Due to the above distinctions , their segmentation synthesis models differ significantly from ours in terms of architecture and design as shown in Figure 6 in the Appendix . 3 SEMANTIC BOTTLENECK GAN ( SB-GAN ) . We propose an unconditional Semantic Bottleneck GAN architecture to learn the distribution of complex scenes . To tackle the problems of learning both the global layout and the local structure , we divide this synthesis problem into two parts : an unconditional segmentation map synthesis network and a conditional segmentation-to-image synthesis model . Our first network is designed to coarsely learn the scene distribution by synthesizing semantic layouts . It generates per-pixel semantic categories following the progressive GAN model architecture ( ProGAN ) ( Karras et al. , 2017 ) . This fully unconditional generation of the segmentation maps is novel , very challenging , and a careful design is crucial , as described in Section 3.1 . The second network populates the synthesized semantic layouts with texture by predicting RGB pixel values using Spatially-Adaptive Normalization ( SPADE ) , following the architecture of the state-of-the-art semantic synthesis network in ( Park et al. , 2019 ) . We assume the ground truth segmentation masks are available for all or part of the target scene dataset . In the following sections , we will first discuss our semantic bottleneck synthesis pipeline and summarize the SPADE network for image synthesis . We will then couple these two networks in an end-to-end design which we refer to as Semantic Bottleneck GAN ( SB-GAN ) . 3.1 SEMANTIC BOTTLENECK SYNTHESIS . Our goal is to learn a ( coarse ) estimate of the scene distribution from samples corresponding to real segmentation maps with K semantic categories . Starting from random noise , we generate a tensor Y ∈ J1 , KKN×1×H×W which represents a per-pixel segmentation class , with H and W indicating the height and width , respectively , of the generated map and N the batch size . In practice , we progressively train from a low to a high resolution using the ProGAN architecture ( Karras et al. , 2017 ) coupled with the Improved WGAN loss function ( Gulrajani et al. , 2017 ) on the ground truth discrete-valued segmentation maps , illustrated in Figure 1- ( d ) . Similar to ProGAN , to increase the spatial resolution of the generated segmentation maps during training , we incrementally add layers to the generator and the discriminator . In contrast to ProGAN , in which the generator outputs continuous RGB values , we predict per-pixel discrete semantic class labels . This task is extremely challenging as it requires the network to capture the intricate relationship between segmentation classes and their spatial dependencies . To this end , we apply the Gumbel-softmax trick ( Jang et al. , 2017 ; Maddison et al. , 2016 ) coupled with a straight-through estimator ( Jang et al. , 2017 ) , described in detail below . We synthesize segmentation layouts by first generating per-pixel probability scores of belonging to each of the K semantic classes and then sampling a semantic class per pixel . The per-pixel probability scores are computed by applying a softmax function to the last layer of the generator ( i.e . logits ) which results in probability maps P ij ∈ [ 0 , 1 ] K , with ∑K k=1 P ij k = 1 for each spatial location ( i , j ) ∈ J1 , HK×J1 , W K. To sample a semantic class from this multinomial distribution , we would ideally apply the following well-known procedure at each spatial location : ( 1 ) sample k i.i.d . samples , Gk , from the standard Gumbel distribution , ( 2 ) add these samples to each logit , and ( 3 ) take the index of the maximal value . This reparametrization indeed allows for an efficient forward-pass , but is not differentiable . Nevertheless , the max can be replaced with the softmax function and the quality of the approximation can be controlled by varying the temperature hyperparameter τ — the smaller the τ , the closer the approximation is to the categorical distribution ( Jang et al. , 2017 ) : Sijk = exp { ( logP ijk +Gk ) /τ } ∑K i=1 exp { ( logP ij i +Gi ) /τ } . ( 1 ) Similar to the real samples , the synthesized samples fed to the GAN discriminator should still contain discrete category labels . As a result , for the forward pass , we compute arg maxk Sk , while for the backward pass , we use the soft predicted scores Sk directly , a strategy known as straight-through estimation ( Jang et al. , 2017 ) .
This work proposes a novel approach for unconditioned image synthesis of complex scenes by intelligently coupling two major tasks; unconditional label generation and label-conditioned image synthesis. To overcome the limitation of failing to generate high-fidelity complex scenes using current GAN-based approaches, this method proposes to divide this into two parts: unconditional segmentation map synthesis network and conditional segmentation-to-image synthesis network. The former is based on the ProGAN with some modifications in losses to deal with discrete semantic labels, and the latter leverages the existing method (Park et al. 2019) based on SPADE residual blocks. Experimental results demonstrate superior performance on the complex scene synthesis. Additionally, the latter part for segmentation-to-image synthesis task also outperforms the existing method (Park et al. 2019) thanks to joint end-to-end training with the former using ProGAN.
SP:27acf2abf315fd87b9e382ee3fe28ec903074b9d
Unconditional Synthesis of Complex Scenes Using a Semantic Bottleneck
1 INTRODUCTION . Significant strides have been made on generative models for image synthesis , with a variety of methods based on Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) achieving stateof-the-art performance . At lower resolutions or in specialized domains , GAN-based methods are able to synthesize samples which are near-indistinguishable from real samples ( Brock et al. , 2019 ) . However , generating complex , high-resolution scenes from scratch remains a challenging problem , as shown in Figure 1- ( a ) and ( b ) . As image resolution and complexity increase , the coherence of synthesized images decreases — samples lack consistent local or global structures . Stochastic decoder-based models , such as conditional GANs , were recently proposed to alleviate some of these issues . In particular , both Pix2PixHD ( Wang et al. , 2018 ) and SPADE ( Park et al. , 2019 ) are able to synthesize high-quality scenes using a strong conditioning mechanism based on semantic segmentation labels during the scene generation process . Global structure encoded in the segmentation layout of the scene is what allows these models to focus primarily on generating convincing local content consistent with that structure . A key practical drawback of such conditional models is that they require full segmentation layouts as input . Thus , unlike unconditional generative approaches which synthesize images from randomly sampled noise , these models are limited to generating images from a set of scenes that is prescribed in advance , typically either through segmentation labels from an existing dataset , or scenes that are hand-crafted by experts . Contributions To overcome these limitations , we propose a new model , the Semantic Bottleneck GAN ( SB-GAN ) , which couples high-fidelity generation capabilities of label-conditional models with the flexibility of unconditional image generation . This in turn enables our model to synthesize an unlimited number of novel complex scenes , while still maintaining high-fidelity output characteristic of image-conditional models . Our SB-GAN first unconditionally generates a pixel-wise semantic label map of a scene ( i.e . for each spatial location it outputs a class label ) , and then generates a realistic scene image by conditioning on that semantic map , Figure 1- ( d ) . By factorizing the task into these two steps , we are able to separately tackle the problems of producing convincing segmentation layouts ( i.e . a useful global structure ) and filling these layouts with convincing appearances ( i.e . local structure ) . When trained end-to-end , the model yields samples which have a coherent global structure as well as fine local details , e.g. , Figure 1- ( c ) . Empirical evaluation shows that our Semantic Bottleneck GAN achieves a new state-of-the-art on two complex datasets with relatively small number of training images , Cityscapes and ADE-Indoor , as measured both by the Fréchet Inception Distance ( FID ) and by perceptual evaluations . Additionally , we observe that the conditional segmentation-to-image synthesis component of our SB-GAN jointly trained with segmentation layout synthesis significantly improves the state-of-the-art semantic image synthesis network ( Park et al. , 2019 ) , resulting in higher-quality outputs when conditioning on ground truth segmentation layouts . Key Challenges While both unconditional generation and image-to-image translation are wellexplored learning problems , fully unconditional generation of the segmentation maps is a notoriously hard task : ( i ) Semantic categories do not respect any ordering relationships and the network is therefore required to capture the intricate relationship between segmentation classes , their shapes , and their spatial dependencies . ( ii ) As opposed to RGB values , semantic categories are discrete , hence non-differentiable which poses a challenge for end-to-end training ( Sec . 3.2 ) ( iii ) Naively combining state-of-the-art unconditional generation and image-to-image translation models leads to poor performance . However , by carefully designing an additional discriminator component and a corresponding training protocol , we not only manage to improve the performance of the end-to-end model , but also the performance of each component separately ( Sec . 3.3 ) . We emphasize that despite these challenges our approach scales to 256 × 256 resolution and 95 semantic categories , whereas existing state-of-the-art GAN models directly generating RGB images at that resolution already suffer from considerable instability ( Sec . 4 ) . 2 RELATED WORK . Generative Adversarial Networks ( GANs ) GANs ( Goodfellow et al. , 2014 ) are a powerful class of generative models successfully applied to various image synthesis tasks such as image style transfer ( Isola et al. , 2017 ; Zhu et al. , 2017 ) , unsupervised representation learning ( Chen et al. , 2016 ; Pathak et al. , 2016 ; Radford et al. , 2016 ) , image super-resolution ( Ledig et al. , 2017 ; Dong et al. , 2016 ) , and text-to-image synthesis ( Zhang et al. , 2017 ; Xu et al. , 2018 ; Qiao et al. , 2019b ) . Training GANs is notoriously hard and recent efforts focused on improving neural architectures ( Wang & Gupta , 2016 ; Karras et al. , 2017 ; Zhang et al. , 2019 ; Chen et al. , 2019a ) , loss functions ( Arjovsky et al. , 2017 ) , regularization ( Gulrajani et al. , 2017 ; Miyato et al. , 2018 ) , large-scale training ( Brock et al. , 2019 ) , self-supervision ( Chen et al. , 2019b ) , and sampling ( Brock et al. , 2019 ; Azadi et al. , 2019a ) . Improving the performance of GANs by disentangling structure and style has been studied by Wang & Gupta ( 2016 ) where structure is represented by a surface normal map and style is the texture mapped onto the structure . Another compelling approach which enables generation of high-resolution images is based on progressive training : a model is trained to first synthesize lowerresolution images ( e.g . 8× 8 ) , then the resolution is gradually increased until the desired resolution is achieved ( Karras et al. , 2017 ) . Recently , Brock et al . ( 2019 ) showed that GANs significantly benefit from large-scale training , both in terms of model size and batch size . We note that these models are able to synthesize high-quality images in settings where objects are very prominent and centrally placed or follow some well-defined structure , as the corresponding distribution is easier to capture . In contrast , when the scenes are more complex and the amount of data is limited , the task becomes extremely challenging for these state-of-the-art models . We aim to improve the performance in the context of complex scenes and a small number of training examples by disentangling the image generation problem into learning the structure represented by semantic layouts and filling in the RGB details using a semantic image synthesis model . A similar idea was proposed by a concurrent work ( Volokitin et al. , 2020 ) with substantial differences in the model and results . GANs on discrete domains GANs for discrete domains have been investigated in several works ( Yu et al. , 2017b ; Lin et al. , 2017 ; Bojchevski et al. , 2018 ; Lu et al. , 2018 ) . Training in this domain is even more challenging as the samples from discrete distributions are not differentiable with respect to the network parameters . This problem can be somewhat alleviated by using the Gumbel-softmax distribution , which is a continuous approximation to a multinomial distribution parameterized in terms of the softmax function ( Kusner & Hernández-Lobato , 2016 ) . We will show how to apply a similar principle to learn the distribution of discrete segmentation masks . Conditional image synthesis In conditional image synthesis one aims to generate images by conditioning on an input which can be provided in the form of an image ( Isola et al. , 2017 ; Zhu et al. , 2017 ; Azadi et al. , 2018 ; 2019b ; Liu et al. , 2017 ) , a text phrase ( Reed et al. , 2016 ; Zhang et al. , 2017 ; Qiao et al. , 2019a ; Ashual & Wolf , 2019 ; Hong et al. , 2018 ) , a scene graph ( Johnson et al. , 2018 ; Ashual & Wolf , 2019 ) , a class label , or a semantic layout ( Odena et al. , 2017 ; Chen & Koltun , 2017 ; Wang et al. , 2018 ; Park et al. , 2019 ) . These conditional GAN methods learn a mapping that translates samples from the source distribution into samples from the target domain . The text-to-image synthesis models proposed in ( Hong et al. , 2018 ; Li et al. , 2019 ) decompose the synthesis task into multiple steps . As illustrated in the Appendix , given the text description , a semantic layout is constructed by generating object bounding boxes and refining each box by estimating object shapes . Then , an image is synthesized conditionally on the generated semantic layout from the first step . Our work shares the same high-level idea of decomposing the image generation problem into the semantic layout synthesis and the conditional semantic-layout-to-image synthesis . However , we note that the above approaches , as opposed to ours , are conditional and require supervision in the form of textual descriptions . Secondly , they are sequential in nature and synthesize masks of a few different objects ( e.g . person , elephant ) , but not a fully fine-grained semantic map ( e.g . missing sky , grass , etc. ) . In stark contrast , our approach unconditionally synthesizes the full semantic layout of the entire scene from a noise input in an end-to-end network design . Due to the above distinctions , their segmentation synthesis models differ significantly from ours in terms of architecture and design as shown in Figure 6 in the Appendix . 3 SEMANTIC BOTTLENECK GAN ( SB-GAN ) . We propose an unconditional Semantic Bottleneck GAN architecture to learn the distribution of complex scenes . To tackle the problems of learning both the global layout and the local structure , we divide this synthesis problem into two parts : an unconditional segmentation map synthesis network and a conditional segmentation-to-image synthesis model . Our first network is designed to coarsely learn the scene distribution by synthesizing semantic layouts . It generates per-pixel semantic categories following the progressive GAN model architecture ( ProGAN ) ( Karras et al. , 2017 ) . This fully unconditional generation of the segmentation maps is novel , very challenging , and a careful design is crucial , as described in Section 3.1 . The second network populates the synthesized semantic layouts with texture by predicting RGB pixel values using Spatially-Adaptive Normalization ( SPADE ) , following the architecture of the state-of-the-art semantic synthesis network in ( Park et al. , 2019 ) . We assume the ground truth segmentation masks are available for all or part of the target scene dataset . In the following sections , we will first discuss our semantic bottleneck synthesis pipeline and summarize the SPADE network for image synthesis . We will then couple these two networks in an end-to-end design which we refer to as Semantic Bottleneck GAN ( SB-GAN ) . 3.1 SEMANTIC BOTTLENECK SYNTHESIS . Our goal is to learn a ( coarse ) estimate of the scene distribution from samples corresponding to real segmentation maps with K semantic categories . Starting from random noise , we generate a tensor Y ∈ J1 , KKN×1×H×W which represents a per-pixel segmentation class , with H and W indicating the height and width , respectively , of the generated map and N the batch size . In practice , we progressively train from a low to a high resolution using the ProGAN architecture ( Karras et al. , 2017 ) coupled with the Improved WGAN loss function ( Gulrajani et al. , 2017 ) on the ground truth discrete-valued segmentation maps , illustrated in Figure 1- ( d ) . Similar to ProGAN , to increase the spatial resolution of the generated segmentation maps during training , we incrementally add layers to the generator and the discriminator . In contrast to ProGAN , in which the generator outputs continuous RGB values , we predict per-pixel discrete semantic class labels . This task is extremely challenging as it requires the network to capture the intricate relationship between segmentation classes and their spatial dependencies . To this end , we apply the Gumbel-softmax trick ( Jang et al. , 2017 ; Maddison et al. , 2016 ) coupled with a straight-through estimator ( Jang et al. , 2017 ) , described in detail below . We synthesize segmentation layouts by first generating per-pixel probability scores of belonging to each of the K semantic classes and then sampling a semantic class per pixel . The per-pixel probability scores are computed by applying a softmax function to the last layer of the generator ( i.e . logits ) which results in probability maps P ij ∈ [ 0 , 1 ] K , with ∑K k=1 P ij k = 1 for each spatial location ( i , j ) ∈ J1 , HK×J1 , W K. To sample a semantic class from this multinomial distribution , we would ideally apply the following well-known procedure at each spatial location : ( 1 ) sample k i.i.d . samples , Gk , from the standard Gumbel distribution , ( 2 ) add these samples to each logit , and ( 3 ) take the index of the maximal value . This reparametrization indeed allows for an efficient forward-pass , but is not differentiable . Nevertheless , the max can be replaced with the softmax function and the quality of the approximation can be controlled by varying the temperature hyperparameter τ — the smaller the τ , the closer the approximation is to the categorical distribution ( Jang et al. , 2017 ) : Sijk = exp { ( logP ijk +Gk ) /τ } ∑K i=1 exp { ( logP ij i +Gi ) /τ } . ( 1 ) Similar to the real samples , the synthesized samples fed to the GAN discriminator should still contain discrete category labels . As a result , for the forward pass , we compute arg maxk Sk , while for the backward pass , we use the soft predicted scores Sk directly , a strategy known as straight-through estimation ( Jang et al. , 2017 ) .
In this paper, the authors propose a new paradigm for unconditional image synthesis with semantic layouts as the bottleneck. The presented approach is straightforward: we can first sample a semantic layout from a latent variable, and then perform image synthesis from this semantic layout. The proposed method is able to synthesize images that look more realistic than unsupervised image synthesis methods such as BigGAN.
SP:27acf2abf315fd87b9e382ee3fe28ec903074b9d
Trust, but verify: model-based exploration in sparse reward environments
1 INTRODUCTION . Model-based approach to Reinforcement Learning ( RL ) brings a promise of data efficiency , and with it much greater generality . However , it is still largely an open question of how to make robust model-based RL algorithms . In most cases , the current solutions excel in low sample regime but underperform asymptotically , see Wang et al . ( 2019 ) ; Nagabandi et al . ( 2018a ) ; Kaiser et al . ( 2020 ) . The principal issues are the imperfections of the learned model and fragile planners not able to robustly deal with these imperfections , see ( Sutton & Barto , 2018 , Section 8.3 ) , ( François-Lavet et al. , 2018 , Section 6.2 ) , ( Wang et al. , 2019 , Section 4.5 ) . Model errors are unavoidable in any realistic RL scenario and thus need to be taken into account , particularly when planning is involved . They can be classified into two categories : optimistic and pessimistic , see ( Sutton & Barto , 2018 , Section 8.3 ) . The former is rather benign or in some cases even beneficial , as it can boost exploration by sending the agent into falsely attractive areas . It has a self-correcting mechanism , since the newly collected data will improve the model . In contrast , when the model has a pessimistic view on a state , the agent might never have the incentive to visit it , and consequently , to make the appropriate adjustments . In this work , we propose trust-but-verify ( TBV ) mechanism , a new method to augment planners with capacity to prioritise visits in states for which the model is suspected to be pessimistic . The method is based on uncertainty estimates , is agnostic to the planner choice , and is rooted in the statistical hypothesis testing framework . Taking advantage of the graph structure of the underlying problem might be beneficial during planning but also makes it more vulnerable to model errors . We argue that graph search planners might benefit most from utilising TBV . While TBV can correct for any type of pessimist errors , we explicitly identify certain type of model errors which frequently occur in discrete environments , which we dub false loops . In a nutshell , these are situations when the model falsely equates two states . Such errors are much similar to ( Sutton & Barto , 2018 , Example 8.3 ) , in which the model erroneously imagine ’ bouncing off ’ of a non-existing wall and thus failing to exploit a shortcut . From a more general point of view , the problem is another incarnation of the exploration-exploitation dilemma . We highlight this by evaluating our method in sparse reward environments . In a planning context , exploration aims to collect data for improving the model , while exploitation aims to act optimally with respect to the current one . The problem might be solved by encouraging to revisit state-action pairs with an incentive of ’ bonus rewards ’ based on the state-action visitation frequency . Such a solution , ( Sutton & Barto , 2018 , Dyna-Q+ ) , is restricted to tabular cases . TBV can be though as its scalable version . Our contributions are : • TBV - a general risk-aware mechanism of dealing with pessimistic model errors , rooted in the statistical hypothesis learning framework . • Conceptual sources and types of model errors accompanied with empirical evidence . • Practical implementation of TBV with : classical Best First Search - a classical graph search algorithm family and Monte Carlo Tree Search - the state-of-the-art class of planners in many challenging domains . • Empirical verification of TBV behaviour in two sparse rewards domains : ToyMontezumaRevenge Roderick et al . ( 2018 ) and the Tower of Hanoi puzzle . The code of our work is available at : https : //github.com/ComradeMisha/ TrustButVerify . 2 RELATED WORK . There is a huge body of work concerning exploration . Fundamental results in this area come from the multi-arm bandits theory , including the celebrated UCB algorithm ( Auer et al . ( 2002 ) ) or Thompson sampling ( Thompson ( 1933 ) ) , see also Lattimore & Szepesvári ( 2020 ) for a thorough treatment of the subject . There are multiple variants of UCB , some of which are relevant to this work , including UCB-V Audibert et al . ( 2007 ) and tree planning adaptations , such as UCT ( Kocsis et al . ( 2006 ) ) or PUCT ( Silver et al . ( 2017 ; 2018 ) ) . Classical approach to exploration in the reinforcement learning setting , including the principle of optimism in the face of uncertainty and ε-greedy exploration , can be found in Sutton & Barto ( 2018 ) . Exploration in the form of entropy-based regularization can be found in A3C ( Mnih et al . ( 2016 ) ) and SAC ( Haarnoja et al . ( 2018 ) ) . Plappert et al . ( 2017 ) and Fortunato et al . ( 2017 ) introduce noise in the parameter space of policies , which leads to state-dependent exploration . There are multiple approaches relying on reward exploration bonuses , which take into account : prediction error ( Stadie et al . ( 2015 ) , Schmidhuber ( 2010 ) Pathak et al . ( 2019 ) , Burda et al . ( 2018 ) ) , visit count ( Bellemare et al . ( 2016 ) , Ostrovski et al . ( 2017 ) ) , temporal distance ( Machado et al . ( 2020 ) ) , classification ( Fu et al . ( 2017 ) ) , or information gain ( Sun et al . ( 2011 ) , Houthooft et al . ( 2016 ) ) . An ensemble-based reinforcement learning counterpart of Thompson sampling can be found in Osband et al . ( 2016 ) and Osband et al . ( 2019 ) . An exploration driven by experience-driven goal generation can be found in Andrychowicz et al . ( 2017 ) . A set of exploration methods has been developed in an attempt to solve notoriously hard Montezuma ’ s Revenge , see for example Ecoffet et al . ( 2019 ) ; Guo et al . ( 2019 ) . In the context of model-based planning Lowrey et al . ( 2019 ) and Milos et al . ( 2019 ) use value function ensembles and uncertainty aware exploration bonuses ( log-sum-exp and majority vote , respectively ) . More recently , Pathak et al . ( 2017 ) , Shyam et al . ( 2019 ) , Henaff ( 2019 ) and Sekar et al . ( 2020 ) dealt with exploration and model learning . These works are similar in spirit to ours . They train exploration policies intending to reduce the model error ( e.g . by maximizing the disagreement measure ) . Our work differs from the above in the following ways . First , we aim to use powerful graph search techniques as planners simultaneously to learning of the model . Our method addresses the fundamental issue , which is balancing intrinsic planner errors and the ones stemming from model imperfection . Second , we use the prediction error of the model ensemble to measure model uncertainty and apply a statistical hypothesis testing framework to switch between actions suggested by the model and actions leading to model improvement . Third , we use a discrete model and a discrete online planning regime . When a learned model is unrolled during planning , errors typically accumulate dramatically . Numer of works adress this problem . Racanière et al . ( 2017 ) and Guez et al . ( 2018 ) are two approaches to learn the planning mechanism and make it robust to model errors . In a somewhat similar spirit , Eysenbach et al . ( 2019 ) treats the replay buffer as a non-parametric model forming a graph and uses ensembles of learned distances as a risk-aware mechanism to avoid certain types of model errors . Nagabandi et al . ( 2018b ) successfully blends the strengths of model-based and model-free approaches . PlaNet ( Hafner et al . ( 2019 ) ) and Dreamer Hafner et al . ( 2020 ) train latent models , which are used for planning . Conceptually , a similar route was explored in MuZero ( Schrittwieser et al . ( 2019 ) ) and Universal Planning Networks ( Srinivas et al . ( 2018 ) ) . Farquhar et al . ( 2017 ) and Oh et al . ( 2017 ) investigate the possibility of creating neural network architectures inspired by the planning algorithms . Many model-based reinforcement learning algorithms , including ours , follow the general framework laid out in Dyna , see Sutton ( 1991 ) . Kaiser et al . ( 2020 ) uses a model to collect fictitious playouts and obtains impressive results for low data regime on Atari . In the continuous domains , a similar approach is adopted by Kurutach et al . ( 2018 ) . Simultaneous training of a single policy on model ensemble is proposed to tackle model errors . Interestingly , this approach is reported to perform better than back-propagation through time . Clavera et al . ( 2018 ) indicates that polices trained on model ensembles might be over-conservative and proposed to use policy meta-learning . Another approach to dealing with model errors works by choosing the unroll horizon for a model . Janner et al . ( 2019 ) , proposed short model-generated branched rollouts starting from data collected on “ real environment ” . Perhaps surprisingly , they find that one-step rollouts provide competitive results . Similarly , short rollouts are used in Feinberg et al . ( 2018 ) and Buckman et al . ( 2018 ) to improve value estimates . Janner et al . ( 2019 ) ; Buckman et al . ( 2018 ) uses ensembles to reduce model bias . The former generates diverse data similarly to Chua et al . ( 2018 ) , and the latter automatically adapt the planning horizon based on uncertainty estimates . Xiao et al . ( 2019 ) proposed another adaptive horizon mechanism based on measurement of model errors using principled Temporal Difference methods . There is a huge body of work about planning ; for classical results , the interested reader is referred to Cormen et al . ( 2009 ) , Russell & Norvig ( 2003 ) and the references therein . Traditional heuristic algorithms such as A∗ ( Hart et al . ( 1968 ) ) or GBFS ( Doran & Michie ( 1966 ) ) are widely used in practice . In Agostinelli et al . ( 2019 ) the authors utilise the value-function to improve upon the A∗ algorithm and solve Rubik ’ s cube . Similarly , Orseau et al . ( 2018 ) bases on the classical BFS to build a heuristic search mechanism with theoretical guarantees . The Monte Carlo Tree Search ( MCTS ) algorithm , which combines heuristic search with learning , led to breakthroughs in the field , see Browne et al . ( 2012 ) for an extensive survey . Famously , Silver et al . ( 2018 ) develop MCTS-based technique to master the ancient game of go . The POLO algorithm presented in Lowrey et al . ( 2019 ) proposes to enrich MPC planning with ensemble-based risk measures to augment exploration . This work is extended by NEEDLE ( Milos et al . ( 2019 ) ) to tree-based MCTS planners and by Lu et al . ( 2019 ) to successfully tackle life-long learning scenarios of environmental change . Hamrick et al . ( 2020 ) explores how to use better statistics collected while searching to calculate signal for value function training .
This paper presents a new method which can be combined with graph search algorithms to boost exploration when the uncertainty is high. This new mechanism, called TBV, can override actions given by the model to explore and verify model predictions. It is also shown in the experiments that TBV improves the model performance when combined with MCTS or BestFS. TBV utilizes graph structure of the problem and finds the solution much quicker for both MCTS and BestFS.
SP:046f850f529bcb0c2376c8597a24108d67c4323a
Trust, but verify: model-based exploration in sparse reward environments
1 INTRODUCTION . Model-based approach to Reinforcement Learning ( RL ) brings a promise of data efficiency , and with it much greater generality . However , it is still largely an open question of how to make robust model-based RL algorithms . In most cases , the current solutions excel in low sample regime but underperform asymptotically , see Wang et al . ( 2019 ) ; Nagabandi et al . ( 2018a ) ; Kaiser et al . ( 2020 ) . The principal issues are the imperfections of the learned model and fragile planners not able to robustly deal with these imperfections , see ( Sutton & Barto , 2018 , Section 8.3 ) , ( François-Lavet et al. , 2018 , Section 6.2 ) , ( Wang et al. , 2019 , Section 4.5 ) . Model errors are unavoidable in any realistic RL scenario and thus need to be taken into account , particularly when planning is involved . They can be classified into two categories : optimistic and pessimistic , see ( Sutton & Barto , 2018 , Section 8.3 ) . The former is rather benign or in some cases even beneficial , as it can boost exploration by sending the agent into falsely attractive areas . It has a self-correcting mechanism , since the newly collected data will improve the model . In contrast , when the model has a pessimistic view on a state , the agent might never have the incentive to visit it , and consequently , to make the appropriate adjustments . In this work , we propose trust-but-verify ( TBV ) mechanism , a new method to augment planners with capacity to prioritise visits in states for which the model is suspected to be pessimistic . The method is based on uncertainty estimates , is agnostic to the planner choice , and is rooted in the statistical hypothesis testing framework . Taking advantage of the graph structure of the underlying problem might be beneficial during planning but also makes it more vulnerable to model errors . We argue that graph search planners might benefit most from utilising TBV . While TBV can correct for any type of pessimist errors , we explicitly identify certain type of model errors which frequently occur in discrete environments , which we dub false loops . In a nutshell , these are situations when the model falsely equates two states . Such errors are much similar to ( Sutton & Barto , 2018 , Example 8.3 ) , in which the model erroneously imagine ’ bouncing off ’ of a non-existing wall and thus failing to exploit a shortcut . From a more general point of view , the problem is another incarnation of the exploration-exploitation dilemma . We highlight this by evaluating our method in sparse reward environments . In a planning context , exploration aims to collect data for improving the model , while exploitation aims to act optimally with respect to the current one . The problem might be solved by encouraging to revisit state-action pairs with an incentive of ’ bonus rewards ’ based on the state-action visitation frequency . Such a solution , ( Sutton & Barto , 2018 , Dyna-Q+ ) , is restricted to tabular cases . TBV can be though as its scalable version . Our contributions are : • TBV - a general risk-aware mechanism of dealing with pessimistic model errors , rooted in the statistical hypothesis learning framework . • Conceptual sources and types of model errors accompanied with empirical evidence . • Practical implementation of TBV with : classical Best First Search - a classical graph search algorithm family and Monte Carlo Tree Search - the state-of-the-art class of planners in many challenging domains . • Empirical verification of TBV behaviour in two sparse rewards domains : ToyMontezumaRevenge Roderick et al . ( 2018 ) and the Tower of Hanoi puzzle . The code of our work is available at : https : //github.com/ComradeMisha/ TrustButVerify . 2 RELATED WORK . There is a huge body of work concerning exploration . Fundamental results in this area come from the multi-arm bandits theory , including the celebrated UCB algorithm ( Auer et al . ( 2002 ) ) or Thompson sampling ( Thompson ( 1933 ) ) , see also Lattimore & Szepesvári ( 2020 ) for a thorough treatment of the subject . There are multiple variants of UCB , some of which are relevant to this work , including UCB-V Audibert et al . ( 2007 ) and tree planning adaptations , such as UCT ( Kocsis et al . ( 2006 ) ) or PUCT ( Silver et al . ( 2017 ; 2018 ) ) . Classical approach to exploration in the reinforcement learning setting , including the principle of optimism in the face of uncertainty and ε-greedy exploration , can be found in Sutton & Barto ( 2018 ) . Exploration in the form of entropy-based regularization can be found in A3C ( Mnih et al . ( 2016 ) ) and SAC ( Haarnoja et al . ( 2018 ) ) . Plappert et al . ( 2017 ) and Fortunato et al . ( 2017 ) introduce noise in the parameter space of policies , which leads to state-dependent exploration . There are multiple approaches relying on reward exploration bonuses , which take into account : prediction error ( Stadie et al . ( 2015 ) , Schmidhuber ( 2010 ) Pathak et al . ( 2019 ) , Burda et al . ( 2018 ) ) , visit count ( Bellemare et al . ( 2016 ) , Ostrovski et al . ( 2017 ) ) , temporal distance ( Machado et al . ( 2020 ) ) , classification ( Fu et al . ( 2017 ) ) , or information gain ( Sun et al . ( 2011 ) , Houthooft et al . ( 2016 ) ) . An ensemble-based reinforcement learning counterpart of Thompson sampling can be found in Osband et al . ( 2016 ) and Osband et al . ( 2019 ) . An exploration driven by experience-driven goal generation can be found in Andrychowicz et al . ( 2017 ) . A set of exploration methods has been developed in an attempt to solve notoriously hard Montezuma ’ s Revenge , see for example Ecoffet et al . ( 2019 ) ; Guo et al . ( 2019 ) . In the context of model-based planning Lowrey et al . ( 2019 ) and Milos et al . ( 2019 ) use value function ensembles and uncertainty aware exploration bonuses ( log-sum-exp and majority vote , respectively ) . More recently , Pathak et al . ( 2017 ) , Shyam et al . ( 2019 ) , Henaff ( 2019 ) and Sekar et al . ( 2020 ) dealt with exploration and model learning . These works are similar in spirit to ours . They train exploration policies intending to reduce the model error ( e.g . by maximizing the disagreement measure ) . Our work differs from the above in the following ways . First , we aim to use powerful graph search techniques as planners simultaneously to learning of the model . Our method addresses the fundamental issue , which is balancing intrinsic planner errors and the ones stemming from model imperfection . Second , we use the prediction error of the model ensemble to measure model uncertainty and apply a statistical hypothesis testing framework to switch between actions suggested by the model and actions leading to model improvement . Third , we use a discrete model and a discrete online planning regime . When a learned model is unrolled during planning , errors typically accumulate dramatically . Numer of works adress this problem . Racanière et al . ( 2017 ) and Guez et al . ( 2018 ) are two approaches to learn the planning mechanism and make it robust to model errors . In a somewhat similar spirit , Eysenbach et al . ( 2019 ) treats the replay buffer as a non-parametric model forming a graph and uses ensembles of learned distances as a risk-aware mechanism to avoid certain types of model errors . Nagabandi et al . ( 2018b ) successfully blends the strengths of model-based and model-free approaches . PlaNet ( Hafner et al . ( 2019 ) ) and Dreamer Hafner et al . ( 2020 ) train latent models , which are used for planning . Conceptually , a similar route was explored in MuZero ( Schrittwieser et al . ( 2019 ) ) and Universal Planning Networks ( Srinivas et al . ( 2018 ) ) . Farquhar et al . ( 2017 ) and Oh et al . ( 2017 ) investigate the possibility of creating neural network architectures inspired by the planning algorithms . Many model-based reinforcement learning algorithms , including ours , follow the general framework laid out in Dyna , see Sutton ( 1991 ) . Kaiser et al . ( 2020 ) uses a model to collect fictitious playouts and obtains impressive results for low data regime on Atari . In the continuous domains , a similar approach is adopted by Kurutach et al . ( 2018 ) . Simultaneous training of a single policy on model ensemble is proposed to tackle model errors . Interestingly , this approach is reported to perform better than back-propagation through time . Clavera et al . ( 2018 ) indicates that polices trained on model ensembles might be over-conservative and proposed to use policy meta-learning . Another approach to dealing with model errors works by choosing the unroll horizon for a model . Janner et al . ( 2019 ) , proposed short model-generated branched rollouts starting from data collected on “ real environment ” . Perhaps surprisingly , they find that one-step rollouts provide competitive results . Similarly , short rollouts are used in Feinberg et al . ( 2018 ) and Buckman et al . ( 2018 ) to improve value estimates . Janner et al . ( 2019 ) ; Buckman et al . ( 2018 ) uses ensembles to reduce model bias . The former generates diverse data similarly to Chua et al . ( 2018 ) , and the latter automatically adapt the planning horizon based on uncertainty estimates . Xiao et al . ( 2019 ) proposed another adaptive horizon mechanism based on measurement of model errors using principled Temporal Difference methods . There is a huge body of work about planning ; for classical results , the interested reader is referred to Cormen et al . ( 2009 ) , Russell & Norvig ( 2003 ) and the references therein . Traditional heuristic algorithms such as A∗ ( Hart et al . ( 1968 ) ) or GBFS ( Doran & Michie ( 1966 ) ) are widely used in practice . In Agostinelli et al . ( 2019 ) the authors utilise the value-function to improve upon the A∗ algorithm and solve Rubik ’ s cube . Similarly , Orseau et al . ( 2018 ) bases on the classical BFS to build a heuristic search mechanism with theoretical guarantees . The Monte Carlo Tree Search ( MCTS ) algorithm , which combines heuristic search with learning , led to breakthroughs in the field , see Browne et al . ( 2012 ) for an extensive survey . Famously , Silver et al . ( 2018 ) develop MCTS-based technique to master the ancient game of go . The POLO algorithm presented in Lowrey et al . ( 2019 ) proposes to enrich MPC planning with ensemble-based risk measures to augment exploration . This work is extended by NEEDLE ( Milos et al . ( 2019 ) ) to tree-based MCTS planners and by Lu et al . ( 2019 ) to successfully tackle life-long learning scenarios of environmental change . Hamrick et al . ( 2020 ) explores how to use better statistics collected while searching to calculate signal for value function training .
This paper proposes an approach for encouraging exploration when planning over learned models of discrete reinforcement learning environment. The proposed method involves using an uncertainty-aware model (e.g., an ensemble of neural networks) to predict state-action transitions, together with a graph-based planner operating on this model. The key idea is to replace (with some probability) the planner's action with the action leading to the highest uncertainty in model prediction. The paper evaluates the proposed technique using two standard search planners (MCTS and BFS).
SP:046f850f529bcb0c2376c8597a24108d67c4323a
Trust, but verify: model-based exploration in sparse reward environments
1 INTRODUCTION . Model-based approach to Reinforcement Learning ( RL ) brings a promise of data efficiency , and with it much greater generality . However , it is still largely an open question of how to make robust model-based RL algorithms . In most cases , the current solutions excel in low sample regime but underperform asymptotically , see Wang et al . ( 2019 ) ; Nagabandi et al . ( 2018a ) ; Kaiser et al . ( 2020 ) . The principal issues are the imperfections of the learned model and fragile planners not able to robustly deal with these imperfections , see ( Sutton & Barto , 2018 , Section 8.3 ) , ( François-Lavet et al. , 2018 , Section 6.2 ) , ( Wang et al. , 2019 , Section 4.5 ) . Model errors are unavoidable in any realistic RL scenario and thus need to be taken into account , particularly when planning is involved . They can be classified into two categories : optimistic and pessimistic , see ( Sutton & Barto , 2018 , Section 8.3 ) . The former is rather benign or in some cases even beneficial , as it can boost exploration by sending the agent into falsely attractive areas . It has a self-correcting mechanism , since the newly collected data will improve the model . In contrast , when the model has a pessimistic view on a state , the agent might never have the incentive to visit it , and consequently , to make the appropriate adjustments . In this work , we propose trust-but-verify ( TBV ) mechanism , a new method to augment planners with capacity to prioritise visits in states for which the model is suspected to be pessimistic . The method is based on uncertainty estimates , is agnostic to the planner choice , and is rooted in the statistical hypothesis testing framework . Taking advantage of the graph structure of the underlying problem might be beneficial during planning but also makes it more vulnerable to model errors . We argue that graph search planners might benefit most from utilising TBV . While TBV can correct for any type of pessimist errors , we explicitly identify certain type of model errors which frequently occur in discrete environments , which we dub false loops . In a nutshell , these are situations when the model falsely equates two states . Such errors are much similar to ( Sutton & Barto , 2018 , Example 8.3 ) , in which the model erroneously imagine ’ bouncing off ’ of a non-existing wall and thus failing to exploit a shortcut . From a more general point of view , the problem is another incarnation of the exploration-exploitation dilemma . We highlight this by evaluating our method in sparse reward environments . In a planning context , exploration aims to collect data for improving the model , while exploitation aims to act optimally with respect to the current one . The problem might be solved by encouraging to revisit state-action pairs with an incentive of ’ bonus rewards ’ based on the state-action visitation frequency . Such a solution , ( Sutton & Barto , 2018 , Dyna-Q+ ) , is restricted to tabular cases . TBV can be though as its scalable version . Our contributions are : • TBV - a general risk-aware mechanism of dealing with pessimistic model errors , rooted in the statistical hypothesis learning framework . • Conceptual sources and types of model errors accompanied with empirical evidence . • Practical implementation of TBV with : classical Best First Search - a classical graph search algorithm family and Monte Carlo Tree Search - the state-of-the-art class of planners in many challenging domains . • Empirical verification of TBV behaviour in two sparse rewards domains : ToyMontezumaRevenge Roderick et al . ( 2018 ) and the Tower of Hanoi puzzle . The code of our work is available at : https : //github.com/ComradeMisha/ TrustButVerify . 2 RELATED WORK . There is a huge body of work concerning exploration . Fundamental results in this area come from the multi-arm bandits theory , including the celebrated UCB algorithm ( Auer et al . ( 2002 ) ) or Thompson sampling ( Thompson ( 1933 ) ) , see also Lattimore & Szepesvári ( 2020 ) for a thorough treatment of the subject . There are multiple variants of UCB , some of which are relevant to this work , including UCB-V Audibert et al . ( 2007 ) and tree planning adaptations , such as UCT ( Kocsis et al . ( 2006 ) ) or PUCT ( Silver et al . ( 2017 ; 2018 ) ) . Classical approach to exploration in the reinforcement learning setting , including the principle of optimism in the face of uncertainty and ε-greedy exploration , can be found in Sutton & Barto ( 2018 ) . Exploration in the form of entropy-based regularization can be found in A3C ( Mnih et al . ( 2016 ) ) and SAC ( Haarnoja et al . ( 2018 ) ) . Plappert et al . ( 2017 ) and Fortunato et al . ( 2017 ) introduce noise in the parameter space of policies , which leads to state-dependent exploration . There are multiple approaches relying on reward exploration bonuses , which take into account : prediction error ( Stadie et al . ( 2015 ) , Schmidhuber ( 2010 ) Pathak et al . ( 2019 ) , Burda et al . ( 2018 ) ) , visit count ( Bellemare et al . ( 2016 ) , Ostrovski et al . ( 2017 ) ) , temporal distance ( Machado et al . ( 2020 ) ) , classification ( Fu et al . ( 2017 ) ) , or information gain ( Sun et al . ( 2011 ) , Houthooft et al . ( 2016 ) ) . An ensemble-based reinforcement learning counterpart of Thompson sampling can be found in Osband et al . ( 2016 ) and Osband et al . ( 2019 ) . An exploration driven by experience-driven goal generation can be found in Andrychowicz et al . ( 2017 ) . A set of exploration methods has been developed in an attempt to solve notoriously hard Montezuma ’ s Revenge , see for example Ecoffet et al . ( 2019 ) ; Guo et al . ( 2019 ) . In the context of model-based planning Lowrey et al . ( 2019 ) and Milos et al . ( 2019 ) use value function ensembles and uncertainty aware exploration bonuses ( log-sum-exp and majority vote , respectively ) . More recently , Pathak et al . ( 2017 ) , Shyam et al . ( 2019 ) , Henaff ( 2019 ) and Sekar et al . ( 2020 ) dealt with exploration and model learning . These works are similar in spirit to ours . They train exploration policies intending to reduce the model error ( e.g . by maximizing the disagreement measure ) . Our work differs from the above in the following ways . First , we aim to use powerful graph search techniques as planners simultaneously to learning of the model . Our method addresses the fundamental issue , which is balancing intrinsic planner errors and the ones stemming from model imperfection . Second , we use the prediction error of the model ensemble to measure model uncertainty and apply a statistical hypothesis testing framework to switch between actions suggested by the model and actions leading to model improvement . Third , we use a discrete model and a discrete online planning regime . When a learned model is unrolled during planning , errors typically accumulate dramatically . Numer of works adress this problem . Racanière et al . ( 2017 ) and Guez et al . ( 2018 ) are two approaches to learn the planning mechanism and make it robust to model errors . In a somewhat similar spirit , Eysenbach et al . ( 2019 ) treats the replay buffer as a non-parametric model forming a graph and uses ensembles of learned distances as a risk-aware mechanism to avoid certain types of model errors . Nagabandi et al . ( 2018b ) successfully blends the strengths of model-based and model-free approaches . PlaNet ( Hafner et al . ( 2019 ) ) and Dreamer Hafner et al . ( 2020 ) train latent models , which are used for planning . Conceptually , a similar route was explored in MuZero ( Schrittwieser et al . ( 2019 ) ) and Universal Planning Networks ( Srinivas et al . ( 2018 ) ) . Farquhar et al . ( 2017 ) and Oh et al . ( 2017 ) investigate the possibility of creating neural network architectures inspired by the planning algorithms . Many model-based reinforcement learning algorithms , including ours , follow the general framework laid out in Dyna , see Sutton ( 1991 ) . Kaiser et al . ( 2020 ) uses a model to collect fictitious playouts and obtains impressive results for low data regime on Atari . In the continuous domains , a similar approach is adopted by Kurutach et al . ( 2018 ) . Simultaneous training of a single policy on model ensemble is proposed to tackle model errors . Interestingly , this approach is reported to perform better than back-propagation through time . Clavera et al . ( 2018 ) indicates that polices trained on model ensembles might be over-conservative and proposed to use policy meta-learning . Another approach to dealing with model errors works by choosing the unroll horizon for a model . Janner et al . ( 2019 ) , proposed short model-generated branched rollouts starting from data collected on “ real environment ” . Perhaps surprisingly , they find that one-step rollouts provide competitive results . Similarly , short rollouts are used in Feinberg et al . ( 2018 ) and Buckman et al . ( 2018 ) to improve value estimates . Janner et al . ( 2019 ) ; Buckman et al . ( 2018 ) uses ensembles to reduce model bias . The former generates diverse data similarly to Chua et al . ( 2018 ) , and the latter automatically adapt the planning horizon based on uncertainty estimates . Xiao et al . ( 2019 ) proposed another adaptive horizon mechanism based on measurement of model errors using principled Temporal Difference methods . There is a huge body of work about planning ; for classical results , the interested reader is referred to Cormen et al . ( 2009 ) , Russell & Norvig ( 2003 ) and the references therein . Traditional heuristic algorithms such as A∗ ( Hart et al . ( 1968 ) ) or GBFS ( Doran & Michie ( 1966 ) ) are widely used in practice . In Agostinelli et al . ( 2019 ) the authors utilise the value-function to improve upon the A∗ algorithm and solve Rubik ’ s cube . Similarly , Orseau et al . ( 2018 ) bases on the classical BFS to build a heuristic search mechanism with theoretical guarantees . The Monte Carlo Tree Search ( MCTS ) algorithm , which combines heuristic search with learning , led to breakthroughs in the field , see Browne et al . ( 2012 ) for an extensive survey . Famously , Silver et al . ( 2018 ) develop MCTS-based technique to master the ancient game of go . The POLO algorithm presented in Lowrey et al . ( 2019 ) proposes to enrich MPC planning with ensemble-based risk measures to augment exploration . This work is extended by NEEDLE ( Milos et al . ( 2019 ) ) to tree-based MCTS planners and by Lu et al . ( 2019 ) to successfully tackle life-long learning scenarios of environmental change . Hamrick et al . ( 2020 ) explores how to use better statistics collected while searching to calculate signal for value function training .
The authors present a method to guide exploration that prefers to go to areas of the state space for which it is more uncertain. This uncertainty is obtained by measuring the standard deviation of the next state prediction from an ensemble of models. The authors call this the disagreement measure At each step, a search is performed and the disagreement measure is obtained for each state visited. The disagreement measure for each action is compared to the distribution for all the states visited during the search. It it is above some threshold, then the action that maximizes the disagreement measure is taken. Otherwise, it takes the action determined by the search.
SP:046f850f529bcb0c2376c8597a24108d67c4323a
Out-of-distribution Prediction with Invariant Risk Minimization: The Limitation and An Effective Fix
1 INTRODUCTION E Xc YXs Figure 1 : The causal graph in OOD prediction : P ( Y |Xc ) is invariant across domains . The spurious correlation P ( Y |Xs ) may vary . A directed ( bidirected ) edge is a causal relationship ( correlation ) . Strong empirical results have demonstrated the efficacy of deep neural networks ( DNNs ) in a variety of areas including computer vision , natural language processing and speech recognition . However , such positive results overwhelmingly rely on the assumption that the training , validation and test data consist of independent identical samples of the same underlying distribution . In contrast , in the setting of outof-distribution ( OOD ) prediction where ( 1 ) the training data is from multiple domains and ( 2 ) the test set has different distribution from the training , the performance of DNNs can be dramatically degraded . This is because DNNs are prone to pick up spurious correlations which do not hold beyond the training data distribution ( Beery et al. , 2018 ; Arjovsky et al. , 2019 ) . For example , when most camel pictures in a training set have a desert in the background , DNNs will pick up the spurious correlation between a desert and the class label , leading to failures when camel pictures come with different backgrounds in a test set . Therefore , OOD prediction remains an extremely challenging problem for DNNs . The invariant causal relationships across different domains turns out to be the key to address the challenge of OOD prediction . The causal graph in Fig . 1 describes the relationships of the variables in the OOD prediction problem . Although spurious correlations learned in one do- main are unreliable in another , invariant causal relationships enable DNNs that capture causal relationships to generalize to unseen domains . In practice , it is extremely difficult to know whether an input feature is causal or spurious . Thus , a recipe for training DNNs that capture causal relationships is learning causal feature representations that hold invariant causal relationships with the class label . Thus , the main challenge of OOD prediction becomes learning causal feature representations given training data from multiple domains . Invariant Risk Minimization ( IRM ) ( Arjovsky et al. , 2019 ) is proposed to learn causal feature representations for OOD prediction . IRM formulates the invariance of causal relationships as a constraint . It requires that causal feature representations must result in the same optimal classifier across all domains . IRM is written as the conditional independence , Y ⊥⊥ E|F ( X ) in ( Chang et al. , 2020 ; Zeng et al. , 2019 ) which can be derived from the causal graph in Fig . 1 when F ( X ) is a mapping of causal features ( Xc in Fig . 1 ) with no information loss . A detailed discussion on IRM and Y ⊥⊥ E|F ( X ) is in Appendix A . Despite IRM ’ s success in the colored MNIST dataset ( Arjovsky et al. , 2019 ) , in this work , we find an important issue of IRM that has not been discussed . Specifically , we consider the situation where strong spurious correlations among the spurious features , the class label and the domain label only hold for training data . We name this strong Λ spuriousness using the shape of the structure among Xs , E and Y in Fig . 1 . Under strong Λ spuriousness , IRM regularized empirical risk can have low values with spurious feature representations that accurately predict the domain label . This is because , in this setting , picking up spurious features can achieve high accuracy in predicting both domain and class in the training set , but not in the test . However , the colored MNIST dataset can not expose this issue because the strong similarity between the two training domains makes it difficult to pick up the weak spurious correlation between the domain label and the spurious features . To illustrate this problem , we design a new dataset – the colored MNIST plus . As shown in Fig . 2 , in this dataset , under strong Λ spuriousness , the performance of IRM models is significantly degraded . Moreover , to resolve this issue of IRM , we propose an effective solution , which combines IRM with conditional distribution matching ( CDM ) . The CDM constraint means that the representation distribution of instances from the same class should be invariant across domains . Theoretically , we show that ( 1 ) causal feature representations can satisfy CDM and IRM at the same time and ( 2 ) CDM can prevent DNNs from learning spurious feature representations that accurately predict the domain label . Empirically , on our newly introduced dataset , the proposed method achieves significant performance improvement over IRM under strong Λ spuriousness . 2 PRELIMINARIES AND IRM . Notations . We use lowercase ( e.g. , x ) , uppercase ( e.g. , X ) and calligraphic uppercase ( e.g. , X ) letters for values , random variables and spaces . We let X ∈ X , Y ∈ Y and E ∈ E denote raw input , the class label and the domain label where X , Y and E are the spaces of input , class labels and domains . A DNN model consists of a feature learning function F and a classifier G. A feature learning function F : X → Rd maps raw input X to its d-dimensional representations F ( X ) . A classifier G : Rd → Y maps a feature representation to a class label . We denote their parameters by θF and θG , respectively . Let θ = Concat ( θF , θG ) denote the concatenation of them . A domain e of ne instances is denoted by De = { xei , yei } ne i=1 . Let Etr and Ets denote the set of training and test domains , in OOD prediction , we have ( 1 ) |Etr| > 1 and ( 2 ) Etr ∩ Ets = ∅ . Problem Statement . Given data from multiple training domains { De } e∈Etr . We aim to predict the label ye ′ i of each instance with features x e′ i from a test domain { xe ′ i , y e′ i } ne′ i=1 , e ′ ∈ Ets . Invariant Risk Minimization . IRM ( Arjovsky et al. , 2019 ) is a recently proposed method to impose the causal inductive bias : the causal relationships between causal features and the label should be invariant across different domains . It not only aims to address the challenging OOD prediction problem , but also is a pioneer work that guides causal machine learning research towards the development of inductive bias imposing causal constraints . The effectiveness of IRM and its variants have been demonstrated across various areas including computer vision ( Ahuja et al. , 2020 ) , natural language processing ( Chang et al. , 2020 ) , CTR prediction ( Zeng et al. , 2019 ) , reinforcement learning ( Zhang et al. , 2020a ) and financial forecasting ( Krueger et al. , 2020 ) . Arjovsky et al . ( 2019 ) propose the original formulation of IRM as a two-stage optimization problem : arg min θF , θG ∑ e∈Etr E ( x , y ) ∼De [ R e ( G ( F ( x ) ) , y ) ] s.t . θG ∈ arg min θ′G Re ( G ( F ( x ) ; θ′G ) , y ) , ( 1 ) where Re denotes the loss function of domain e. Then , they show that the IRM constraint can be imposed by adding a regularizer into the loss function . It turns out the IRM constraint can be written as the conditional independence Y ⊥⊥ E|F ( X ) ( Chang et al. , 2020 ; Zeng et al. , 2019 ) . This can be derived from the causal graph in Fig . 1 . For brevity , we refer to Y ⊥⊥ E|F ( X ) as the IRM constraint . 3 THE LIMITATION OF IRM . In this section , we find that IRM fails under strong Λ spuriousness – when the spurious correlations among spurious features , the domain label and the class label are strong . To show it , we design a new dataset – the colored MNIST plus ( CMNIST+ ) to expose this limitation of IRM . Then , we try to answer two crucial research questions : ( 1 ) why does IRM fail in CMNIST+ ? ( 2 ) Why does IRM work for the original colored MNIST ( CMNIST ) dataset ? 3.1 WHY DOES IRM FAIL ? . Despite its previous success , results in Fig . 2 show that IRM fails in our newly designed colored MNIST plus dataset , under strong Λ spuriousness ( ρ ≥ 0.8 ) . Here , we show that , under strong Λ spuriousness , at least two types of feature representations , F ( X ) = Y and F ( X ) = E , satisfy the IRM constraint . When F ( X ) = E , the feature representations pick up spurious relationships . Satisfying IRM by Perfectly Predicting the Label . First , we consider a case where there exists a feature representation that perfectly predicts the class label , i.e. , F ( X ) = Y . In this case , we know that the feature representation satisfies the IRM constraint because Y ⊥⊥ E|F ( X ) = Y always holds . This is reasonable because the causal relationship between Y and itself must be invariant across different domains . Satisfying IRM by Perfectly Predicting the Domain Does Not Lead to OOD Generalizable Feature Representations . However , there is another way to satisfy the IRM constraint . If there exists a feature representation F ( X ) = E , then the IRM constraint can be satisfied by F ( X ) . This is due to the fact Y ⊥⊥ E|F ( X ) = E. However , this is not desired behavior of IRM as F ( X ) = E is a type of spurious feature representation . This is because P ( Y |E ) can vary across domains . Using the camel picture example , if domains are the individuals who take the picture , we may find more camel pictures taken by person e than from person e′ ( P ( Y = camel|E = e ) > P ( Y = camel|E = e′ ) ) . Why is F ( X ) = E a good solution for the original IRM optimization problem ( Eq . 1 ) ? This is because F ( X ) = E also leads to low values of the loss function Re since the direct causal influence of the domain label E on the class label Y is also strong when Λ spuriousness is strong . So , with a proper classifier G , we can achieve low values of Re with F ( X ) = E. Then , we describe the CMNIST+ dataset and show experimental and theoretical results to support our claim . The Colored MNIST Plus ( CMNIST+ ) Dataset . We follow CMNIST ( Arjovsky et al. , 2019 ) to create CMNIST+ by resampling and adding colors to instances of MNIST . The digits 0− 4 ( 5− 9 ) are class Y = 1 ( Y = 0 ) . We randomly flip 25 % of class labels so that spuriousness can be stronger than the causal relationship between the shape S ( causal features ) and the class label Y . Table 1 describes the dataset . The variable C ∈ { G , B , R } denotes the color , which represents the spurious feature Xs . We explain why we use three colors for CMNIST+ in Appendix C.2 . The parameter ρ ∈ ( 0.5 , 1 ) controls the strength of the spurious correlations between the color ( spurious features ) C and the class label Y through their common cause , the domain label E. The larger the value of ρ , the stronger the spurious correlations . Intuitively , in the two training domains of CMNIST+ , in addition to the strong spurious correlation between the class label Y and color C , we set the spurious correlation between the domain label E and color C to be strong , too . Thus , the CMNIST+ dataset can expose the problem of IRM : it would not penalize the models that fit the domain variable as the feature representation ( F ( X ) = E ) . To verify this claim , we show analysis results to support the experimental results in Fig . 2 . The data generating process of CMNIST+ can be found in Append C.2 . Analysis Results . Here , we show the analysis results on the CMNIST+ to answer two questions : what features will be learned by ERM and IRM under under different Λ spuriousness ? What is the expected test accuracy of these models ? For simplicity , we assume that the classifier is deterministic , which always predicts the majority class given the feature . If the number of instances from each class is the same , then it would predict a random label . We analyze three types of spurious feature representations : ( 1 ) those that fit color , ( 2 ) those that fit the domain label and ( 3 ) those that use a combination of them for prediction . The first case mimics the behavior of ERM that picks up the spurious correlation between color and the class label . The second one represents a model satisfying IRM by F ( X ) = E. The third one stands for a model satisfying IRM by F ( X ) = Concat ( E , C ) . One may argue that IRM can be fixed if we simply balance the two classes in each domain . Theoretical analysis shows that this is an invalid solution . We summarize results in Table 2 where Ê is the domain label predicted by a deterministic classifier using color as the feature . This is because in an unseen test domain , we can not directly use the domain label for prediction . The highlighted numbers show which type of features would be learned by ERM and IRM . As ρ increases , ERM and IRM are more likely to fit spurious features . This explains results in Fig . 2 . As a DNN may still pick up some causal features ( shape in CMNIST+ ) even when ρ = 0.9 , the test accuracy of IRM in practice would be greater than 0.35 without label balancing and 0.2 with label balancing . Similarly , the test accuracy of ERM would be greater than 0.2 . From Fig . 2 , we can see the test accuracy of IRM , IRM with label balancing and ERM are slightly better than the aforementioned lower bounds . The derivations can be found in Appendix B . Experimental Setup . We use a LeNet-5 ( LeCun et al. , 1998 ) instead of a three-layer MLP . To take input with three colors , we modify the first CNN layer to have three channels . LeNet-5 has more predictive power such that it can pick up the three types of spurious correlations ( color – domain , color – class , and domain – class ) or the causal relationship ( shape – class ) . We randomly split the instances from the training domains into 80 % training and 20 % validation . The model selection is done by picking the one with the lowest validation loss in each run . We report the average test accuracy of the selected models in 10 runs . It is crucial to ensure only data from training domains are used in model selection , since the test domain should be unseen during training and validation . During training , we begin applying the IRM penalty at iteration KIRM , set to 200 , 400 , or 600 . By varying KIRM , we aim to examine the following hypothesis : IRM works by pushing the spurious features out of the representations learned by the standard ERM training before the IRM penalty is applied ( Krueger et al. , 2020 ) . More details on the setup can be found in Appendix C.1 . Experimental Results . Fig . 2 shows the performance of IRM and IRM with balanced classes in each domain . We make the following observations : first , the test accuracy of IRM drops dramatically under strong Λ spuriousness . Second , we show that a naı̈ve fix for IRM , balancing the two classes in each domain by oversampling the minority class , does not lead to improvement in performance .
In this work, the authors focus on the out-of-distribution generalization problem. The input is dataset from multiple environments and the goal is to learn a model that generalizes well to an unseen test environment. The work is based on recent line of works on invariant risk minimization (IRM) (Arjovsky et al.). The authors show that under a certain type of structure for the generative model, where the domain/environment label itself has a strong correlation with the spurious factors and the target label, IRM fails. The authors propose an extension of the colored MNIST dataset to highlight this problem. Finally, the authors build a method that works better than IRM on the extension of colored MNIST dataset.
SP:82c52fe144129e913a29248317952ac0fb520ffe
Out-of-distribution Prediction with Invariant Risk Minimization: The Limitation and An Effective Fix
1 INTRODUCTION E Xc YXs Figure 1 : The causal graph in OOD prediction : P ( Y |Xc ) is invariant across domains . The spurious correlation P ( Y |Xs ) may vary . A directed ( bidirected ) edge is a causal relationship ( correlation ) . Strong empirical results have demonstrated the efficacy of deep neural networks ( DNNs ) in a variety of areas including computer vision , natural language processing and speech recognition . However , such positive results overwhelmingly rely on the assumption that the training , validation and test data consist of independent identical samples of the same underlying distribution . In contrast , in the setting of outof-distribution ( OOD ) prediction where ( 1 ) the training data is from multiple domains and ( 2 ) the test set has different distribution from the training , the performance of DNNs can be dramatically degraded . This is because DNNs are prone to pick up spurious correlations which do not hold beyond the training data distribution ( Beery et al. , 2018 ; Arjovsky et al. , 2019 ) . For example , when most camel pictures in a training set have a desert in the background , DNNs will pick up the spurious correlation between a desert and the class label , leading to failures when camel pictures come with different backgrounds in a test set . Therefore , OOD prediction remains an extremely challenging problem for DNNs . The invariant causal relationships across different domains turns out to be the key to address the challenge of OOD prediction . The causal graph in Fig . 1 describes the relationships of the variables in the OOD prediction problem . Although spurious correlations learned in one do- main are unreliable in another , invariant causal relationships enable DNNs that capture causal relationships to generalize to unseen domains . In practice , it is extremely difficult to know whether an input feature is causal or spurious . Thus , a recipe for training DNNs that capture causal relationships is learning causal feature representations that hold invariant causal relationships with the class label . Thus , the main challenge of OOD prediction becomes learning causal feature representations given training data from multiple domains . Invariant Risk Minimization ( IRM ) ( Arjovsky et al. , 2019 ) is proposed to learn causal feature representations for OOD prediction . IRM formulates the invariance of causal relationships as a constraint . It requires that causal feature representations must result in the same optimal classifier across all domains . IRM is written as the conditional independence , Y ⊥⊥ E|F ( X ) in ( Chang et al. , 2020 ; Zeng et al. , 2019 ) which can be derived from the causal graph in Fig . 1 when F ( X ) is a mapping of causal features ( Xc in Fig . 1 ) with no information loss . A detailed discussion on IRM and Y ⊥⊥ E|F ( X ) is in Appendix A . Despite IRM ’ s success in the colored MNIST dataset ( Arjovsky et al. , 2019 ) , in this work , we find an important issue of IRM that has not been discussed . Specifically , we consider the situation where strong spurious correlations among the spurious features , the class label and the domain label only hold for training data . We name this strong Λ spuriousness using the shape of the structure among Xs , E and Y in Fig . 1 . Under strong Λ spuriousness , IRM regularized empirical risk can have low values with spurious feature representations that accurately predict the domain label . This is because , in this setting , picking up spurious features can achieve high accuracy in predicting both domain and class in the training set , but not in the test . However , the colored MNIST dataset can not expose this issue because the strong similarity between the two training domains makes it difficult to pick up the weak spurious correlation between the domain label and the spurious features . To illustrate this problem , we design a new dataset – the colored MNIST plus . As shown in Fig . 2 , in this dataset , under strong Λ spuriousness , the performance of IRM models is significantly degraded . Moreover , to resolve this issue of IRM , we propose an effective solution , which combines IRM with conditional distribution matching ( CDM ) . The CDM constraint means that the representation distribution of instances from the same class should be invariant across domains . Theoretically , we show that ( 1 ) causal feature representations can satisfy CDM and IRM at the same time and ( 2 ) CDM can prevent DNNs from learning spurious feature representations that accurately predict the domain label . Empirically , on our newly introduced dataset , the proposed method achieves significant performance improvement over IRM under strong Λ spuriousness . 2 PRELIMINARIES AND IRM . Notations . We use lowercase ( e.g. , x ) , uppercase ( e.g. , X ) and calligraphic uppercase ( e.g. , X ) letters for values , random variables and spaces . We let X ∈ X , Y ∈ Y and E ∈ E denote raw input , the class label and the domain label where X , Y and E are the spaces of input , class labels and domains . A DNN model consists of a feature learning function F and a classifier G. A feature learning function F : X → Rd maps raw input X to its d-dimensional representations F ( X ) . A classifier G : Rd → Y maps a feature representation to a class label . We denote their parameters by θF and θG , respectively . Let θ = Concat ( θF , θG ) denote the concatenation of them . A domain e of ne instances is denoted by De = { xei , yei } ne i=1 . Let Etr and Ets denote the set of training and test domains , in OOD prediction , we have ( 1 ) |Etr| > 1 and ( 2 ) Etr ∩ Ets = ∅ . Problem Statement . Given data from multiple training domains { De } e∈Etr . We aim to predict the label ye ′ i of each instance with features x e′ i from a test domain { xe ′ i , y e′ i } ne′ i=1 , e ′ ∈ Ets . Invariant Risk Minimization . IRM ( Arjovsky et al. , 2019 ) is a recently proposed method to impose the causal inductive bias : the causal relationships between causal features and the label should be invariant across different domains . It not only aims to address the challenging OOD prediction problem , but also is a pioneer work that guides causal machine learning research towards the development of inductive bias imposing causal constraints . The effectiveness of IRM and its variants have been demonstrated across various areas including computer vision ( Ahuja et al. , 2020 ) , natural language processing ( Chang et al. , 2020 ) , CTR prediction ( Zeng et al. , 2019 ) , reinforcement learning ( Zhang et al. , 2020a ) and financial forecasting ( Krueger et al. , 2020 ) . Arjovsky et al . ( 2019 ) propose the original formulation of IRM as a two-stage optimization problem : arg min θF , θG ∑ e∈Etr E ( x , y ) ∼De [ R e ( G ( F ( x ) ) , y ) ] s.t . θG ∈ arg min θ′G Re ( G ( F ( x ) ; θ′G ) , y ) , ( 1 ) where Re denotes the loss function of domain e. Then , they show that the IRM constraint can be imposed by adding a regularizer into the loss function . It turns out the IRM constraint can be written as the conditional independence Y ⊥⊥ E|F ( X ) ( Chang et al. , 2020 ; Zeng et al. , 2019 ) . This can be derived from the causal graph in Fig . 1 . For brevity , we refer to Y ⊥⊥ E|F ( X ) as the IRM constraint . 3 THE LIMITATION OF IRM . In this section , we find that IRM fails under strong Λ spuriousness – when the spurious correlations among spurious features , the domain label and the class label are strong . To show it , we design a new dataset – the colored MNIST plus ( CMNIST+ ) to expose this limitation of IRM . Then , we try to answer two crucial research questions : ( 1 ) why does IRM fail in CMNIST+ ? ( 2 ) Why does IRM work for the original colored MNIST ( CMNIST ) dataset ? 3.1 WHY DOES IRM FAIL ? . Despite its previous success , results in Fig . 2 show that IRM fails in our newly designed colored MNIST plus dataset , under strong Λ spuriousness ( ρ ≥ 0.8 ) . Here , we show that , under strong Λ spuriousness , at least two types of feature representations , F ( X ) = Y and F ( X ) = E , satisfy the IRM constraint . When F ( X ) = E , the feature representations pick up spurious relationships . Satisfying IRM by Perfectly Predicting the Label . First , we consider a case where there exists a feature representation that perfectly predicts the class label , i.e. , F ( X ) = Y . In this case , we know that the feature representation satisfies the IRM constraint because Y ⊥⊥ E|F ( X ) = Y always holds . This is reasonable because the causal relationship between Y and itself must be invariant across different domains . Satisfying IRM by Perfectly Predicting the Domain Does Not Lead to OOD Generalizable Feature Representations . However , there is another way to satisfy the IRM constraint . If there exists a feature representation F ( X ) = E , then the IRM constraint can be satisfied by F ( X ) . This is due to the fact Y ⊥⊥ E|F ( X ) = E. However , this is not desired behavior of IRM as F ( X ) = E is a type of spurious feature representation . This is because P ( Y |E ) can vary across domains . Using the camel picture example , if domains are the individuals who take the picture , we may find more camel pictures taken by person e than from person e′ ( P ( Y = camel|E = e ) > P ( Y = camel|E = e′ ) ) . Why is F ( X ) = E a good solution for the original IRM optimization problem ( Eq . 1 ) ? This is because F ( X ) = E also leads to low values of the loss function Re since the direct causal influence of the domain label E on the class label Y is also strong when Λ spuriousness is strong . So , with a proper classifier G , we can achieve low values of Re with F ( X ) = E. Then , we describe the CMNIST+ dataset and show experimental and theoretical results to support our claim . The Colored MNIST Plus ( CMNIST+ ) Dataset . We follow CMNIST ( Arjovsky et al. , 2019 ) to create CMNIST+ by resampling and adding colors to instances of MNIST . The digits 0− 4 ( 5− 9 ) are class Y = 1 ( Y = 0 ) . We randomly flip 25 % of class labels so that spuriousness can be stronger than the causal relationship between the shape S ( causal features ) and the class label Y . Table 1 describes the dataset . The variable C ∈ { G , B , R } denotes the color , which represents the spurious feature Xs . We explain why we use three colors for CMNIST+ in Appendix C.2 . The parameter ρ ∈ ( 0.5 , 1 ) controls the strength of the spurious correlations between the color ( spurious features ) C and the class label Y through their common cause , the domain label E. The larger the value of ρ , the stronger the spurious correlations . Intuitively , in the two training domains of CMNIST+ , in addition to the strong spurious correlation between the class label Y and color C , we set the spurious correlation between the domain label E and color C to be strong , too . Thus , the CMNIST+ dataset can expose the problem of IRM : it would not penalize the models that fit the domain variable as the feature representation ( F ( X ) = E ) . To verify this claim , we show analysis results to support the experimental results in Fig . 2 . The data generating process of CMNIST+ can be found in Append C.2 . Analysis Results . Here , we show the analysis results on the CMNIST+ to answer two questions : what features will be learned by ERM and IRM under under different Λ spuriousness ? What is the expected test accuracy of these models ? For simplicity , we assume that the classifier is deterministic , which always predicts the majority class given the feature . If the number of instances from each class is the same , then it would predict a random label . We analyze three types of spurious feature representations : ( 1 ) those that fit color , ( 2 ) those that fit the domain label and ( 3 ) those that use a combination of them for prediction . The first case mimics the behavior of ERM that picks up the spurious correlation between color and the class label . The second one represents a model satisfying IRM by F ( X ) = E. The third one stands for a model satisfying IRM by F ( X ) = Concat ( E , C ) . One may argue that IRM can be fixed if we simply balance the two classes in each domain . Theoretical analysis shows that this is an invalid solution . We summarize results in Table 2 where Ê is the domain label predicted by a deterministic classifier using color as the feature . This is because in an unseen test domain , we can not directly use the domain label for prediction . The highlighted numbers show which type of features would be learned by ERM and IRM . As ρ increases , ERM and IRM are more likely to fit spurious features . This explains results in Fig . 2 . As a DNN may still pick up some causal features ( shape in CMNIST+ ) even when ρ = 0.9 , the test accuracy of IRM in practice would be greater than 0.35 without label balancing and 0.2 with label balancing . Similarly , the test accuracy of ERM would be greater than 0.2 . From Fig . 2 , we can see the test accuracy of IRM , IRM with label balancing and ERM are slightly better than the aforementioned lower bounds . The derivations can be found in Appendix B . Experimental Setup . We use a LeNet-5 ( LeCun et al. , 1998 ) instead of a three-layer MLP . To take input with three colors , we modify the first CNN layer to have three channels . LeNet-5 has more predictive power such that it can pick up the three types of spurious correlations ( color – domain , color – class , and domain – class ) or the causal relationship ( shape – class ) . We randomly split the instances from the training domains into 80 % training and 20 % validation . The model selection is done by picking the one with the lowest validation loss in each run . We report the average test accuracy of the selected models in 10 runs . It is crucial to ensure only data from training domains are used in model selection , since the test domain should be unseen during training and validation . During training , we begin applying the IRM penalty at iteration KIRM , set to 200 , 400 , or 600 . By varying KIRM , we aim to examine the following hypothesis : IRM works by pushing the spurious features out of the representations learned by the standard ERM training before the IRM penalty is applied ( Krueger et al. , 2020 ) . More details on the setup can be found in Appendix C.1 . Experimental Results . Fig . 2 shows the performance of IRM and IRM with balanced classes in each domain . We make the following observations : first , the test accuracy of IRM drops dramatically under strong Λ spuriousness . Second , we show that a naı̈ve fix for IRM , balancing the two classes in each domain by oversampling the minority class , does not lead to improvement in performance .
This paper attacks the problem of OOD learning from the angle of invariant causal feature learning. The key idea is to capture domain invariant causal features and use the extracted causality relation to convey domain-adaptive classification. In this work, domain invariant causal features are learned by IRM, which imposes the consistency constraint between causal features and class labels across different domains. The core idea is to address the existence of spuriousness correlation by introducing the MMD and KL divergence based conditional distribution matching constraint to the IRM learning process. The experimental study based on a crafted MNIST data set demonstrates the superior performances of the regularised IRM learning method in the domain invariant learning task.
SP:82c52fe144129e913a29248317952ac0fb520ffe
Out-of-distribution Prediction with Invariant Risk Minimization: The Limitation and An Effective Fix
1 INTRODUCTION E Xc YXs Figure 1 : The causal graph in OOD prediction : P ( Y |Xc ) is invariant across domains . The spurious correlation P ( Y |Xs ) may vary . A directed ( bidirected ) edge is a causal relationship ( correlation ) . Strong empirical results have demonstrated the efficacy of deep neural networks ( DNNs ) in a variety of areas including computer vision , natural language processing and speech recognition . However , such positive results overwhelmingly rely on the assumption that the training , validation and test data consist of independent identical samples of the same underlying distribution . In contrast , in the setting of outof-distribution ( OOD ) prediction where ( 1 ) the training data is from multiple domains and ( 2 ) the test set has different distribution from the training , the performance of DNNs can be dramatically degraded . This is because DNNs are prone to pick up spurious correlations which do not hold beyond the training data distribution ( Beery et al. , 2018 ; Arjovsky et al. , 2019 ) . For example , when most camel pictures in a training set have a desert in the background , DNNs will pick up the spurious correlation between a desert and the class label , leading to failures when camel pictures come with different backgrounds in a test set . Therefore , OOD prediction remains an extremely challenging problem for DNNs . The invariant causal relationships across different domains turns out to be the key to address the challenge of OOD prediction . The causal graph in Fig . 1 describes the relationships of the variables in the OOD prediction problem . Although spurious correlations learned in one do- main are unreliable in another , invariant causal relationships enable DNNs that capture causal relationships to generalize to unseen domains . In practice , it is extremely difficult to know whether an input feature is causal or spurious . Thus , a recipe for training DNNs that capture causal relationships is learning causal feature representations that hold invariant causal relationships with the class label . Thus , the main challenge of OOD prediction becomes learning causal feature representations given training data from multiple domains . Invariant Risk Minimization ( IRM ) ( Arjovsky et al. , 2019 ) is proposed to learn causal feature representations for OOD prediction . IRM formulates the invariance of causal relationships as a constraint . It requires that causal feature representations must result in the same optimal classifier across all domains . IRM is written as the conditional independence , Y ⊥⊥ E|F ( X ) in ( Chang et al. , 2020 ; Zeng et al. , 2019 ) which can be derived from the causal graph in Fig . 1 when F ( X ) is a mapping of causal features ( Xc in Fig . 1 ) with no information loss . A detailed discussion on IRM and Y ⊥⊥ E|F ( X ) is in Appendix A . Despite IRM ’ s success in the colored MNIST dataset ( Arjovsky et al. , 2019 ) , in this work , we find an important issue of IRM that has not been discussed . Specifically , we consider the situation where strong spurious correlations among the spurious features , the class label and the domain label only hold for training data . We name this strong Λ spuriousness using the shape of the structure among Xs , E and Y in Fig . 1 . Under strong Λ spuriousness , IRM regularized empirical risk can have low values with spurious feature representations that accurately predict the domain label . This is because , in this setting , picking up spurious features can achieve high accuracy in predicting both domain and class in the training set , but not in the test . However , the colored MNIST dataset can not expose this issue because the strong similarity between the two training domains makes it difficult to pick up the weak spurious correlation between the domain label and the spurious features . To illustrate this problem , we design a new dataset – the colored MNIST plus . As shown in Fig . 2 , in this dataset , under strong Λ spuriousness , the performance of IRM models is significantly degraded . Moreover , to resolve this issue of IRM , we propose an effective solution , which combines IRM with conditional distribution matching ( CDM ) . The CDM constraint means that the representation distribution of instances from the same class should be invariant across domains . Theoretically , we show that ( 1 ) causal feature representations can satisfy CDM and IRM at the same time and ( 2 ) CDM can prevent DNNs from learning spurious feature representations that accurately predict the domain label . Empirically , on our newly introduced dataset , the proposed method achieves significant performance improvement over IRM under strong Λ spuriousness . 2 PRELIMINARIES AND IRM . Notations . We use lowercase ( e.g. , x ) , uppercase ( e.g. , X ) and calligraphic uppercase ( e.g. , X ) letters for values , random variables and spaces . We let X ∈ X , Y ∈ Y and E ∈ E denote raw input , the class label and the domain label where X , Y and E are the spaces of input , class labels and domains . A DNN model consists of a feature learning function F and a classifier G. A feature learning function F : X → Rd maps raw input X to its d-dimensional representations F ( X ) . A classifier G : Rd → Y maps a feature representation to a class label . We denote their parameters by θF and θG , respectively . Let θ = Concat ( θF , θG ) denote the concatenation of them . A domain e of ne instances is denoted by De = { xei , yei } ne i=1 . Let Etr and Ets denote the set of training and test domains , in OOD prediction , we have ( 1 ) |Etr| > 1 and ( 2 ) Etr ∩ Ets = ∅ . Problem Statement . Given data from multiple training domains { De } e∈Etr . We aim to predict the label ye ′ i of each instance with features x e′ i from a test domain { xe ′ i , y e′ i } ne′ i=1 , e ′ ∈ Ets . Invariant Risk Minimization . IRM ( Arjovsky et al. , 2019 ) is a recently proposed method to impose the causal inductive bias : the causal relationships between causal features and the label should be invariant across different domains . It not only aims to address the challenging OOD prediction problem , but also is a pioneer work that guides causal machine learning research towards the development of inductive bias imposing causal constraints . The effectiveness of IRM and its variants have been demonstrated across various areas including computer vision ( Ahuja et al. , 2020 ) , natural language processing ( Chang et al. , 2020 ) , CTR prediction ( Zeng et al. , 2019 ) , reinforcement learning ( Zhang et al. , 2020a ) and financial forecasting ( Krueger et al. , 2020 ) . Arjovsky et al . ( 2019 ) propose the original formulation of IRM as a two-stage optimization problem : arg min θF , θG ∑ e∈Etr E ( x , y ) ∼De [ R e ( G ( F ( x ) ) , y ) ] s.t . θG ∈ arg min θ′G Re ( G ( F ( x ) ; θ′G ) , y ) , ( 1 ) where Re denotes the loss function of domain e. Then , they show that the IRM constraint can be imposed by adding a regularizer into the loss function . It turns out the IRM constraint can be written as the conditional independence Y ⊥⊥ E|F ( X ) ( Chang et al. , 2020 ; Zeng et al. , 2019 ) . This can be derived from the causal graph in Fig . 1 . For brevity , we refer to Y ⊥⊥ E|F ( X ) as the IRM constraint . 3 THE LIMITATION OF IRM . In this section , we find that IRM fails under strong Λ spuriousness – when the spurious correlations among spurious features , the domain label and the class label are strong . To show it , we design a new dataset – the colored MNIST plus ( CMNIST+ ) to expose this limitation of IRM . Then , we try to answer two crucial research questions : ( 1 ) why does IRM fail in CMNIST+ ? ( 2 ) Why does IRM work for the original colored MNIST ( CMNIST ) dataset ? 3.1 WHY DOES IRM FAIL ? . Despite its previous success , results in Fig . 2 show that IRM fails in our newly designed colored MNIST plus dataset , under strong Λ spuriousness ( ρ ≥ 0.8 ) . Here , we show that , under strong Λ spuriousness , at least two types of feature representations , F ( X ) = Y and F ( X ) = E , satisfy the IRM constraint . When F ( X ) = E , the feature representations pick up spurious relationships . Satisfying IRM by Perfectly Predicting the Label . First , we consider a case where there exists a feature representation that perfectly predicts the class label , i.e. , F ( X ) = Y . In this case , we know that the feature representation satisfies the IRM constraint because Y ⊥⊥ E|F ( X ) = Y always holds . This is reasonable because the causal relationship between Y and itself must be invariant across different domains . Satisfying IRM by Perfectly Predicting the Domain Does Not Lead to OOD Generalizable Feature Representations . However , there is another way to satisfy the IRM constraint . If there exists a feature representation F ( X ) = E , then the IRM constraint can be satisfied by F ( X ) . This is due to the fact Y ⊥⊥ E|F ( X ) = E. However , this is not desired behavior of IRM as F ( X ) = E is a type of spurious feature representation . This is because P ( Y |E ) can vary across domains . Using the camel picture example , if domains are the individuals who take the picture , we may find more camel pictures taken by person e than from person e′ ( P ( Y = camel|E = e ) > P ( Y = camel|E = e′ ) ) . Why is F ( X ) = E a good solution for the original IRM optimization problem ( Eq . 1 ) ? This is because F ( X ) = E also leads to low values of the loss function Re since the direct causal influence of the domain label E on the class label Y is also strong when Λ spuriousness is strong . So , with a proper classifier G , we can achieve low values of Re with F ( X ) = E. Then , we describe the CMNIST+ dataset and show experimental and theoretical results to support our claim . The Colored MNIST Plus ( CMNIST+ ) Dataset . We follow CMNIST ( Arjovsky et al. , 2019 ) to create CMNIST+ by resampling and adding colors to instances of MNIST . The digits 0− 4 ( 5− 9 ) are class Y = 1 ( Y = 0 ) . We randomly flip 25 % of class labels so that spuriousness can be stronger than the causal relationship between the shape S ( causal features ) and the class label Y . Table 1 describes the dataset . The variable C ∈ { G , B , R } denotes the color , which represents the spurious feature Xs . We explain why we use three colors for CMNIST+ in Appendix C.2 . The parameter ρ ∈ ( 0.5 , 1 ) controls the strength of the spurious correlations between the color ( spurious features ) C and the class label Y through their common cause , the domain label E. The larger the value of ρ , the stronger the spurious correlations . Intuitively , in the two training domains of CMNIST+ , in addition to the strong spurious correlation between the class label Y and color C , we set the spurious correlation between the domain label E and color C to be strong , too . Thus , the CMNIST+ dataset can expose the problem of IRM : it would not penalize the models that fit the domain variable as the feature representation ( F ( X ) = E ) . To verify this claim , we show analysis results to support the experimental results in Fig . 2 . The data generating process of CMNIST+ can be found in Append C.2 . Analysis Results . Here , we show the analysis results on the CMNIST+ to answer two questions : what features will be learned by ERM and IRM under under different Λ spuriousness ? What is the expected test accuracy of these models ? For simplicity , we assume that the classifier is deterministic , which always predicts the majority class given the feature . If the number of instances from each class is the same , then it would predict a random label . We analyze three types of spurious feature representations : ( 1 ) those that fit color , ( 2 ) those that fit the domain label and ( 3 ) those that use a combination of them for prediction . The first case mimics the behavior of ERM that picks up the spurious correlation between color and the class label . The second one represents a model satisfying IRM by F ( X ) = E. The third one stands for a model satisfying IRM by F ( X ) = Concat ( E , C ) . One may argue that IRM can be fixed if we simply balance the two classes in each domain . Theoretical analysis shows that this is an invalid solution . We summarize results in Table 2 where Ê is the domain label predicted by a deterministic classifier using color as the feature . This is because in an unseen test domain , we can not directly use the domain label for prediction . The highlighted numbers show which type of features would be learned by ERM and IRM . As ρ increases , ERM and IRM are more likely to fit spurious features . This explains results in Fig . 2 . As a DNN may still pick up some causal features ( shape in CMNIST+ ) even when ρ = 0.9 , the test accuracy of IRM in practice would be greater than 0.35 without label balancing and 0.2 with label balancing . Similarly , the test accuracy of ERM would be greater than 0.2 . From Fig . 2 , we can see the test accuracy of IRM , IRM with label balancing and ERM are slightly better than the aforementioned lower bounds . The derivations can be found in Appendix B . Experimental Setup . We use a LeNet-5 ( LeCun et al. , 1998 ) instead of a three-layer MLP . To take input with three colors , we modify the first CNN layer to have three channels . LeNet-5 has more predictive power such that it can pick up the three types of spurious correlations ( color – domain , color – class , and domain – class ) or the causal relationship ( shape – class ) . We randomly split the instances from the training domains into 80 % training and 20 % validation . The model selection is done by picking the one with the lowest validation loss in each run . We report the average test accuracy of the selected models in 10 runs . It is crucial to ensure only data from training domains are used in model selection , since the test domain should be unseen during training and validation . During training , we begin applying the IRM penalty at iteration KIRM , set to 200 , 400 , or 600 . By varying KIRM , we aim to examine the following hypothesis : IRM works by pushing the spurious features out of the representations learned by the standard ERM training before the IRM penalty is applied ( Krueger et al. , 2020 ) . More details on the setup can be found in Appendix C.1 . Experimental Results . Fig . 2 shows the performance of IRM and IRM with balanced classes in each domain . We make the following observations : first , the test accuracy of IRM drops dramatically under strong Λ spuriousness . Second , we show that a naı̈ve fix for IRM , balancing the two classes in each domain by oversampling the minority class , does not lead to improvement in performance .
.** This paper advances generalizable machine learning via addressing a major limitation of invariant risk minimization (IRM). In particular, the author(s) identified and discussed the issue of strong $\Lambda$ spurious, where spurious features and class labels are strongly correlated due to common cause, causing unprotected IRM to fail while trying to exclude such non-causal predictors. To avoid this. pitfall, the author(s) proposed to leverage conditional distribution matching (CDM) to regularize the representation, which effectively helps to alleviate this issue. Two empirical solutions, respectively non-adversarial MMD and adversarial KL matching, have been presented and validated.
SP:82c52fe144129e913a29248317952ac0fb520ffe
Continual learning using hash-routed convolutional neural networks
Continual learning could shift the machine learning paradigm from data centric to model centric . A continual learning model needs to scale efficiently to handle semantically different datasets , while avoiding unnecessary growth . We introduce hash-routed convolutional neural networks : a group of convolutional units where data flows dynamically . Feature maps are compared using feature hashing and similar data is routed to the same units . A hash-routed network provides excellent plasticity thanks to its routed nature , while generating stable features through the use of orthogonal feature hashing . Each unit evolves separately and new units can be added ( to be used only when necessary ) . Hash-routed networks achieve excellent performance across a variety of typical continual learning benchmarks without storing raw data and train using only gradient descent . Besides providing a continual learning framework for supervised tasks with encouraging results , our model can be used for unsupervised or reinforcement learning . 1 INTRODUCTION . When faced with a new modeling challenge , a data scientist will typically train a model from a class of models based on her/his expert knowledge and retain the best performing one . The trained model is often useless when faced with different data . Retraining it on new data will result in poor performance when trying to reuse the model on the original data . This is what is known as catastrophic forgetting ( McCloskey & Cohen , 1989 ) . Although transfer learning avoids retraining networks from scratch , keeping the acquired knowledge in a trained model and using it to learn new tasks is not straightforward . The real knowledge remains with the human expert . Model training is usually a data centric task . Continual learning ( Thrun , 1995 ) makes model training a model centric task by maintaining acquired knowledge in previous learning tasks . Recent work in continual ( or lifelong ) learning has focused on supervised classification tasks and most of the developed algorithms do not generate stable features that could be used for unsupervised learning tasks , as would a more generic algorithm such as the one we present . Models should also be able to adapt and scale reasonably to accommodate different learning tasks without using an exponential amount of resources , and preferably with little data scientist intervention . To tackle this challenge , we introduce hash-routed networks ( HRN ) . A HRN is composed of multiple independent processing units . Unlike typical convolutional neural networks ( CNN ) , the data flow between these units is determined dynamically by measuring similarity between hashed feature maps . The generated feature maps are stable . Scalability is insured through unit evolution and by increasing the number of available units , while avoiding exponential memory use . This new type of network maintains stable performance across a variety of tasks ( including semantically different tasks ) . We describe expansion , update and regularization algorithms for continual learning . We validate our approach using multiple publicly available datasets , by comparing supervised classification performance . Benchmarks include Pairwise-MNIST , MNIST/Fashion-MNIST ( Xiao et al. , 2017 ) and SVHN/incremental-Cifar100 ( Netzer et al. , 2011 ; Krizhevsky et al. , 2009 ) . Relevant background is introduced in section 2 . Section 3 details the hash-routing algorithm and discusses its key attributes . Section 4 compares our work with other continual learning and dynamic network studies . A large set of experiments is carried out in section 5 . 2 FEATURE HASHING BACKGROUND . Feature hashing , also known as the hashing trick ( Weinberger et al. , 2009 ) is a dimension reduction transformation with key properties for our work : inner product conservation and quasi-orthogonality . A feature hashing function φ : RN → Rs , can be built using two uniform hash functions h : N→ { 1 , 2 ... , s } and ξ : N→ { −1 , 1 } , as such : φi ( x ) = ∑ j∈ [ [ 1 , N ] ] j : h ( j ) =i ξ ( j ) xj where φi denotes the ith component of φ . Inner product is preserved as E [ φ ( a ) Tφ ( b ) ] = aTb . φ provides an unbiased estimator of the inner product . It can also be shown that if ||a||2 = ||b||2 = 1 , then σa , b = O ( 1s ) . Two different hash functions φ and φ′ ( e.g . h 6= h′ or ξ 6= ξ′ ) are orthogonal . In other words , ∀ ( v , w ) ∈ Im ( φ ) × Im ( φ′ ) , E [ vTw ] ≈ 0 . Furthermore , Weinberger et al . ( 2009 ) details the inner product bounds , given v ∈ Im ( φ ) and x ∈ RN : Pr ( |vTφ′ ( x ) | > ) ≤ 2 exp ( − 2/2 s−1 ‖v‖22 ‖x‖ 2 2 + ‖v‖∞ ‖x‖∞ /3 ) ( 1 ) Eq.1 shows that approximate orthogonality is better when φ′ handles bounded vectors . Data independent bounds can be obtained by setting ‖x‖∞ = 1 and replacing v by v ‖v‖2 , which leads to ‖x‖22 ≤ N and ‖v‖∞ ≤ 1 , hence : Pr ( |vTφ′ ( x ) | > ) ≤ 2 exp ( − 2/2 s−1 ‖x‖22 + ‖v‖∞ /3 ) ≤ 2 exp ( − 2/2 N/s+ /3 ) ( 2 ) Better approximate orthogonality significantly reduces correlation when summing feature vectors generated by different hashing functions , as is done in hash-routed networks . 3 HASH-ROUTED NETWORKS . 3.1 STRUCTURE . A hash-routed network maps input data to a feature vector of size s that is stable across successive learning tasks . An HRN exploits inner product preservation to insure that similarity between generated feature vectors reflect the similarity between input samples . Quasi-orthogonality of different feature hashing functions is used to reduce correlation between the output ’ s components , as it is the sum of individual hashed feature vectors . An HRN H is composed of M units { U1 , ... , UM } . Each unit Uk is composed of : • A series of convolution operations fk . It is characterized by a number of input channels and a number of output channels , resulting in a vector of trainable parameters wk . Note that fk can also include pooling operations . • An orthonormal projection basis Bk . It contains a maximum of m non-zeros orthogonal vectors of size s. Each basis is filled with zero vectors at first . These will be replaced by non-zero vectors during training . • A feature hashing function φk that maps a feature vector of any size to a vector of size s. The network also has an independent feature hashing function φ0 . All the feature hashing functions are different but generate feature vectors of size s . 3.2 OPERATION . 3.2.1 HASH-ROUTING ALGORITHM . H maps an input sample x to a feature vectorH ( x ) of size s. In a vanilla CNN , x would go through a series of deterministic convolutional layers to generate feature maps of growing size . In a HRN , the convolutional layers that will be involved will vary depending on intermediate results . Feature hashing is used to route operations . Since feature hashing preserves the inner product in the hashed features space , similar samples will be processed similarly . Intermediate features are hashed and projected upon the units ’ projection bases . The unit where the projection ’ s magnitude is the highest is selected for the next operation . Operations continue until a maximum depth d is reached ( i.e . there is a limit of d − 1 chained operations ) , or when the projection residue is below a given threshold τd . H ( x ) is the sum of all residues . Let { Ui1 , Ui2 , ... , Uid−1 } be the ordered set of units involved in processing x ( assuming the final projection residue ’ s magnitude is greater than τd ) . Operation 0 simply involves hashing the ( flattened ) input sample using φ0 . Let xik = fik ◦ fik−1 ◦ ... ◦ fi1 ( x ) be the intermediate features obtained at operation k. The normalized hashed features vector after operation k is computed as such : hik = φik ( xik ‖xik‖∞ ) ∥∥∥∥φik ( xik‖xik‖∞ ) ∥∥∥∥ 2 ( 3 ) For operation 0 , hi0 is computed using x and φ0 . pik = Bik+1hik and rik = hik − pik are the projection vector and residue vector over basis Bik+1 resp . As explained earlier , this means that : ik+1 = argmax j∈I\ { i1 , ... , ik } ‖Bjhik‖2 ( 4 ) where I is the subset of initialized units ( i.e . units with bases containing at least one non-zero vector ) . Finally , H ( x ) = ∑ j∈ { i0 , ... , id−1 } rj ( 5 ) The full inference algorithm is summarized in Algorithm 1 and an example is given in Figure 1 . 3.2.2 ANALYSIS . The output of a typical CNN is a feature map with a dimension that depends on the number of output channels used in each convolutional layer . In a HRN , this would lead to a variable dimension output as the final feature map depends on the routing . In a continual learning setup , dealing with variable dimension feature maps would be impractical . Feature hashing circumvents these problems by generating feature vectors of fixed dimension . Similar feature maps get to be processed by the same units , as a consequence of using feature hashing Algorithm 1 : Hash-routed inference Input : x Output : H = H ( x ) h0 = φ0 ( x ) ; J = ∅ H ← 0 ; h← h0 ; y ← x for j = 1 , ... , d− 1 do ij = argmaxk∈I\J ‖Bkh‖2 ; // select the best unit r← h−Bijh ; // compute new residue H ← H + r ; // accumulate residue for output J ← J ∪ { ij } ; // update set of used units if ‖r‖2 < τd then break ; // stop processing when residue is too low else y ← fij ( y ) ; // compute feature map h← φij ( y ‖y‖∞ ) ∥∥∥φij ( y‖y‖∞ ) ∥∥∥2 ; // new hash vector using flattened feature map end end for routing . In this context , similarity is measured by the inner product of flattened feature maps , projected onto different orthogonal subspaces ( each unit basis span ) . Another consequence is that unit weights become specialized in processing a certain type of features , rather than having to adapt to task specific features . This provides the kind of stability needed for continual learning . For a given unit Uk , rank ( Bk ) ≤ m < < s. Hence , it is reasonable to consider that the orthogonal subspace ’ s contribution to total variance is much more important than that of Bk . This is whyH ( x ) only contains projection residues . Note that in Eq.3 , hik ∈ Im ( φik ) and ‖hik‖2 = 1 . The operand under φik has an infinite norm of 1 , which under Eq.2 leads to inner product bounds independent of input data when considering orthogonality . Moreover , due to the approximate orthogonality of different feature hashing functions , summing the residues will not lead to much information loss as each residue vector rik is in Im ( φik−1 ) but this also explains why each unit can only be selected once . The residues ’ ` 1-norms are added to the loss function to induce sparsity . Denoting LT the specific loss for task T ( e.g . KL-divergence for supervised classification ) , the final loss L is : L = LT + λ ∑ j∈ { i0 , ... , id−1 } ‖rj‖1 ( 6 )
This paper studies the problem of continual learning and proposes a new learning framework named hash-routed convolutional neural networks (HRN). HRN has a set of convolutional units and hashes similar data to the same unit. With this design, the paper claims three key contributions. (1) HRN provides excellent plasticity and more stable features. (2) HRN achieves excellent performance on a variety of benchmarks. (3) HRN can be used for unsupervised or reinforcement learning.
SP:5363b2718ed0168fe5a24e0e6a63c62b20c47c6f
Continual learning using hash-routed convolutional neural networks
Continual learning could shift the machine learning paradigm from data centric to model centric . A continual learning model needs to scale efficiently to handle semantically different datasets , while avoiding unnecessary growth . We introduce hash-routed convolutional neural networks : a group of convolutional units where data flows dynamically . Feature maps are compared using feature hashing and similar data is routed to the same units . A hash-routed network provides excellent plasticity thanks to its routed nature , while generating stable features through the use of orthogonal feature hashing . Each unit evolves separately and new units can be added ( to be used only when necessary ) . Hash-routed networks achieve excellent performance across a variety of typical continual learning benchmarks without storing raw data and train using only gradient descent . Besides providing a continual learning framework for supervised tasks with encouraging results , our model can be used for unsupervised or reinforcement learning . 1 INTRODUCTION . When faced with a new modeling challenge , a data scientist will typically train a model from a class of models based on her/his expert knowledge and retain the best performing one . The trained model is often useless when faced with different data . Retraining it on new data will result in poor performance when trying to reuse the model on the original data . This is what is known as catastrophic forgetting ( McCloskey & Cohen , 1989 ) . Although transfer learning avoids retraining networks from scratch , keeping the acquired knowledge in a trained model and using it to learn new tasks is not straightforward . The real knowledge remains with the human expert . Model training is usually a data centric task . Continual learning ( Thrun , 1995 ) makes model training a model centric task by maintaining acquired knowledge in previous learning tasks . Recent work in continual ( or lifelong ) learning has focused on supervised classification tasks and most of the developed algorithms do not generate stable features that could be used for unsupervised learning tasks , as would a more generic algorithm such as the one we present . Models should also be able to adapt and scale reasonably to accommodate different learning tasks without using an exponential amount of resources , and preferably with little data scientist intervention . To tackle this challenge , we introduce hash-routed networks ( HRN ) . A HRN is composed of multiple independent processing units . Unlike typical convolutional neural networks ( CNN ) , the data flow between these units is determined dynamically by measuring similarity between hashed feature maps . The generated feature maps are stable . Scalability is insured through unit evolution and by increasing the number of available units , while avoiding exponential memory use . This new type of network maintains stable performance across a variety of tasks ( including semantically different tasks ) . We describe expansion , update and regularization algorithms for continual learning . We validate our approach using multiple publicly available datasets , by comparing supervised classification performance . Benchmarks include Pairwise-MNIST , MNIST/Fashion-MNIST ( Xiao et al. , 2017 ) and SVHN/incremental-Cifar100 ( Netzer et al. , 2011 ; Krizhevsky et al. , 2009 ) . Relevant background is introduced in section 2 . Section 3 details the hash-routing algorithm and discusses its key attributes . Section 4 compares our work with other continual learning and dynamic network studies . A large set of experiments is carried out in section 5 . 2 FEATURE HASHING BACKGROUND . Feature hashing , also known as the hashing trick ( Weinberger et al. , 2009 ) is a dimension reduction transformation with key properties for our work : inner product conservation and quasi-orthogonality . A feature hashing function φ : RN → Rs , can be built using two uniform hash functions h : N→ { 1 , 2 ... , s } and ξ : N→ { −1 , 1 } , as such : φi ( x ) = ∑ j∈ [ [ 1 , N ] ] j : h ( j ) =i ξ ( j ) xj where φi denotes the ith component of φ . Inner product is preserved as E [ φ ( a ) Tφ ( b ) ] = aTb . φ provides an unbiased estimator of the inner product . It can also be shown that if ||a||2 = ||b||2 = 1 , then σa , b = O ( 1s ) . Two different hash functions φ and φ′ ( e.g . h 6= h′ or ξ 6= ξ′ ) are orthogonal . In other words , ∀ ( v , w ) ∈ Im ( φ ) × Im ( φ′ ) , E [ vTw ] ≈ 0 . Furthermore , Weinberger et al . ( 2009 ) details the inner product bounds , given v ∈ Im ( φ ) and x ∈ RN : Pr ( |vTφ′ ( x ) | > ) ≤ 2 exp ( − 2/2 s−1 ‖v‖22 ‖x‖ 2 2 + ‖v‖∞ ‖x‖∞ /3 ) ( 1 ) Eq.1 shows that approximate orthogonality is better when φ′ handles bounded vectors . Data independent bounds can be obtained by setting ‖x‖∞ = 1 and replacing v by v ‖v‖2 , which leads to ‖x‖22 ≤ N and ‖v‖∞ ≤ 1 , hence : Pr ( |vTφ′ ( x ) | > ) ≤ 2 exp ( − 2/2 s−1 ‖x‖22 + ‖v‖∞ /3 ) ≤ 2 exp ( − 2/2 N/s+ /3 ) ( 2 ) Better approximate orthogonality significantly reduces correlation when summing feature vectors generated by different hashing functions , as is done in hash-routed networks . 3 HASH-ROUTED NETWORKS . 3.1 STRUCTURE . A hash-routed network maps input data to a feature vector of size s that is stable across successive learning tasks . An HRN exploits inner product preservation to insure that similarity between generated feature vectors reflect the similarity between input samples . Quasi-orthogonality of different feature hashing functions is used to reduce correlation between the output ’ s components , as it is the sum of individual hashed feature vectors . An HRN H is composed of M units { U1 , ... , UM } . Each unit Uk is composed of : • A series of convolution operations fk . It is characterized by a number of input channels and a number of output channels , resulting in a vector of trainable parameters wk . Note that fk can also include pooling operations . • An orthonormal projection basis Bk . It contains a maximum of m non-zeros orthogonal vectors of size s. Each basis is filled with zero vectors at first . These will be replaced by non-zero vectors during training . • A feature hashing function φk that maps a feature vector of any size to a vector of size s. The network also has an independent feature hashing function φ0 . All the feature hashing functions are different but generate feature vectors of size s . 3.2 OPERATION . 3.2.1 HASH-ROUTING ALGORITHM . H maps an input sample x to a feature vectorH ( x ) of size s. In a vanilla CNN , x would go through a series of deterministic convolutional layers to generate feature maps of growing size . In a HRN , the convolutional layers that will be involved will vary depending on intermediate results . Feature hashing is used to route operations . Since feature hashing preserves the inner product in the hashed features space , similar samples will be processed similarly . Intermediate features are hashed and projected upon the units ’ projection bases . The unit where the projection ’ s magnitude is the highest is selected for the next operation . Operations continue until a maximum depth d is reached ( i.e . there is a limit of d − 1 chained operations ) , or when the projection residue is below a given threshold τd . H ( x ) is the sum of all residues . Let { Ui1 , Ui2 , ... , Uid−1 } be the ordered set of units involved in processing x ( assuming the final projection residue ’ s magnitude is greater than τd ) . Operation 0 simply involves hashing the ( flattened ) input sample using φ0 . Let xik = fik ◦ fik−1 ◦ ... ◦ fi1 ( x ) be the intermediate features obtained at operation k. The normalized hashed features vector after operation k is computed as such : hik = φik ( xik ‖xik‖∞ ) ∥∥∥∥φik ( xik‖xik‖∞ ) ∥∥∥∥ 2 ( 3 ) For operation 0 , hi0 is computed using x and φ0 . pik = Bik+1hik and rik = hik − pik are the projection vector and residue vector over basis Bik+1 resp . As explained earlier , this means that : ik+1 = argmax j∈I\ { i1 , ... , ik } ‖Bjhik‖2 ( 4 ) where I is the subset of initialized units ( i.e . units with bases containing at least one non-zero vector ) . Finally , H ( x ) = ∑ j∈ { i0 , ... , id−1 } rj ( 5 ) The full inference algorithm is summarized in Algorithm 1 and an example is given in Figure 1 . 3.2.2 ANALYSIS . The output of a typical CNN is a feature map with a dimension that depends on the number of output channels used in each convolutional layer . In a HRN , this would lead to a variable dimension output as the final feature map depends on the routing . In a continual learning setup , dealing with variable dimension feature maps would be impractical . Feature hashing circumvents these problems by generating feature vectors of fixed dimension . Similar feature maps get to be processed by the same units , as a consequence of using feature hashing Algorithm 1 : Hash-routed inference Input : x Output : H = H ( x ) h0 = φ0 ( x ) ; J = ∅ H ← 0 ; h← h0 ; y ← x for j = 1 , ... , d− 1 do ij = argmaxk∈I\J ‖Bkh‖2 ; // select the best unit r← h−Bijh ; // compute new residue H ← H + r ; // accumulate residue for output J ← J ∪ { ij } ; // update set of used units if ‖r‖2 < τd then break ; // stop processing when residue is too low else y ← fij ( y ) ; // compute feature map h← φij ( y ‖y‖∞ ) ∥∥∥φij ( y‖y‖∞ ) ∥∥∥2 ; // new hash vector using flattened feature map end end for routing . In this context , similarity is measured by the inner product of flattened feature maps , projected onto different orthogonal subspaces ( each unit basis span ) . Another consequence is that unit weights become specialized in processing a certain type of features , rather than having to adapt to task specific features . This provides the kind of stability needed for continual learning . For a given unit Uk , rank ( Bk ) ≤ m < < s. Hence , it is reasonable to consider that the orthogonal subspace ’ s contribution to total variance is much more important than that of Bk . This is whyH ( x ) only contains projection residues . Note that in Eq.3 , hik ∈ Im ( φik ) and ‖hik‖2 = 1 . The operand under φik has an infinite norm of 1 , which under Eq.2 leads to inner product bounds independent of input data when considering orthogonality . Moreover , due to the approximate orthogonality of different feature hashing functions , summing the residues will not lead to much information loss as each residue vector rik is in Im ( φik−1 ) but this also explains why each unit can only be selected once . The residues ’ ` 1-norms are added to the loss function to induce sparsity . Denoting LT the specific loss for task T ( e.g . KL-divergence for supervised classification ) , the final loss L is : L = LT + λ ∑ j∈ { i0 , ... , id−1 } ‖rj‖1 ( 6 )
For a learning model to learn continuously, it needs to handle new datasets without catastrophic forgetting or requiring the model to grow larger. This paper proposes a hash-routed convolution neural network where a different set of convolution filters are used depending on the data. New convolution filters can be added to the network without increasing the computational cost of the network.
SP:5363b2718ed0168fe5a24e0e6a63c62b20c47c6f
Continual learning using hash-routed convolutional neural networks
Continual learning could shift the machine learning paradigm from data centric to model centric . A continual learning model needs to scale efficiently to handle semantically different datasets , while avoiding unnecessary growth . We introduce hash-routed convolutional neural networks : a group of convolutional units where data flows dynamically . Feature maps are compared using feature hashing and similar data is routed to the same units . A hash-routed network provides excellent plasticity thanks to its routed nature , while generating stable features through the use of orthogonal feature hashing . Each unit evolves separately and new units can be added ( to be used only when necessary ) . Hash-routed networks achieve excellent performance across a variety of typical continual learning benchmarks without storing raw data and train using only gradient descent . Besides providing a continual learning framework for supervised tasks with encouraging results , our model can be used for unsupervised or reinforcement learning . 1 INTRODUCTION . When faced with a new modeling challenge , a data scientist will typically train a model from a class of models based on her/his expert knowledge and retain the best performing one . The trained model is often useless when faced with different data . Retraining it on new data will result in poor performance when trying to reuse the model on the original data . This is what is known as catastrophic forgetting ( McCloskey & Cohen , 1989 ) . Although transfer learning avoids retraining networks from scratch , keeping the acquired knowledge in a trained model and using it to learn new tasks is not straightforward . The real knowledge remains with the human expert . Model training is usually a data centric task . Continual learning ( Thrun , 1995 ) makes model training a model centric task by maintaining acquired knowledge in previous learning tasks . Recent work in continual ( or lifelong ) learning has focused on supervised classification tasks and most of the developed algorithms do not generate stable features that could be used for unsupervised learning tasks , as would a more generic algorithm such as the one we present . Models should also be able to adapt and scale reasonably to accommodate different learning tasks without using an exponential amount of resources , and preferably with little data scientist intervention . To tackle this challenge , we introduce hash-routed networks ( HRN ) . A HRN is composed of multiple independent processing units . Unlike typical convolutional neural networks ( CNN ) , the data flow between these units is determined dynamically by measuring similarity between hashed feature maps . The generated feature maps are stable . Scalability is insured through unit evolution and by increasing the number of available units , while avoiding exponential memory use . This new type of network maintains stable performance across a variety of tasks ( including semantically different tasks ) . We describe expansion , update and regularization algorithms for continual learning . We validate our approach using multiple publicly available datasets , by comparing supervised classification performance . Benchmarks include Pairwise-MNIST , MNIST/Fashion-MNIST ( Xiao et al. , 2017 ) and SVHN/incremental-Cifar100 ( Netzer et al. , 2011 ; Krizhevsky et al. , 2009 ) . Relevant background is introduced in section 2 . Section 3 details the hash-routing algorithm and discusses its key attributes . Section 4 compares our work with other continual learning and dynamic network studies . A large set of experiments is carried out in section 5 . 2 FEATURE HASHING BACKGROUND . Feature hashing , also known as the hashing trick ( Weinberger et al. , 2009 ) is a dimension reduction transformation with key properties for our work : inner product conservation and quasi-orthogonality . A feature hashing function φ : RN → Rs , can be built using two uniform hash functions h : N→ { 1 , 2 ... , s } and ξ : N→ { −1 , 1 } , as such : φi ( x ) = ∑ j∈ [ [ 1 , N ] ] j : h ( j ) =i ξ ( j ) xj where φi denotes the ith component of φ . Inner product is preserved as E [ φ ( a ) Tφ ( b ) ] = aTb . φ provides an unbiased estimator of the inner product . It can also be shown that if ||a||2 = ||b||2 = 1 , then σa , b = O ( 1s ) . Two different hash functions φ and φ′ ( e.g . h 6= h′ or ξ 6= ξ′ ) are orthogonal . In other words , ∀ ( v , w ) ∈ Im ( φ ) × Im ( φ′ ) , E [ vTw ] ≈ 0 . Furthermore , Weinberger et al . ( 2009 ) details the inner product bounds , given v ∈ Im ( φ ) and x ∈ RN : Pr ( |vTφ′ ( x ) | > ) ≤ 2 exp ( − 2/2 s−1 ‖v‖22 ‖x‖ 2 2 + ‖v‖∞ ‖x‖∞ /3 ) ( 1 ) Eq.1 shows that approximate orthogonality is better when φ′ handles bounded vectors . Data independent bounds can be obtained by setting ‖x‖∞ = 1 and replacing v by v ‖v‖2 , which leads to ‖x‖22 ≤ N and ‖v‖∞ ≤ 1 , hence : Pr ( |vTφ′ ( x ) | > ) ≤ 2 exp ( − 2/2 s−1 ‖x‖22 + ‖v‖∞ /3 ) ≤ 2 exp ( − 2/2 N/s+ /3 ) ( 2 ) Better approximate orthogonality significantly reduces correlation when summing feature vectors generated by different hashing functions , as is done in hash-routed networks . 3 HASH-ROUTED NETWORKS . 3.1 STRUCTURE . A hash-routed network maps input data to a feature vector of size s that is stable across successive learning tasks . An HRN exploits inner product preservation to insure that similarity between generated feature vectors reflect the similarity between input samples . Quasi-orthogonality of different feature hashing functions is used to reduce correlation between the output ’ s components , as it is the sum of individual hashed feature vectors . An HRN H is composed of M units { U1 , ... , UM } . Each unit Uk is composed of : • A series of convolution operations fk . It is characterized by a number of input channels and a number of output channels , resulting in a vector of trainable parameters wk . Note that fk can also include pooling operations . • An orthonormal projection basis Bk . It contains a maximum of m non-zeros orthogonal vectors of size s. Each basis is filled with zero vectors at first . These will be replaced by non-zero vectors during training . • A feature hashing function φk that maps a feature vector of any size to a vector of size s. The network also has an independent feature hashing function φ0 . All the feature hashing functions are different but generate feature vectors of size s . 3.2 OPERATION . 3.2.1 HASH-ROUTING ALGORITHM . H maps an input sample x to a feature vectorH ( x ) of size s. In a vanilla CNN , x would go through a series of deterministic convolutional layers to generate feature maps of growing size . In a HRN , the convolutional layers that will be involved will vary depending on intermediate results . Feature hashing is used to route operations . Since feature hashing preserves the inner product in the hashed features space , similar samples will be processed similarly . Intermediate features are hashed and projected upon the units ’ projection bases . The unit where the projection ’ s magnitude is the highest is selected for the next operation . Operations continue until a maximum depth d is reached ( i.e . there is a limit of d − 1 chained operations ) , or when the projection residue is below a given threshold τd . H ( x ) is the sum of all residues . Let { Ui1 , Ui2 , ... , Uid−1 } be the ordered set of units involved in processing x ( assuming the final projection residue ’ s magnitude is greater than τd ) . Operation 0 simply involves hashing the ( flattened ) input sample using φ0 . Let xik = fik ◦ fik−1 ◦ ... ◦ fi1 ( x ) be the intermediate features obtained at operation k. The normalized hashed features vector after operation k is computed as such : hik = φik ( xik ‖xik‖∞ ) ∥∥∥∥φik ( xik‖xik‖∞ ) ∥∥∥∥ 2 ( 3 ) For operation 0 , hi0 is computed using x and φ0 . pik = Bik+1hik and rik = hik − pik are the projection vector and residue vector over basis Bik+1 resp . As explained earlier , this means that : ik+1 = argmax j∈I\ { i1 , ... , ik } ‖Bjhik‖2 ( 4 ) where I is the subset of initialized units ( i.e . units with bases containing at least one non-zero vector ) . Finally , H ( x ) = ∑ j∈ { i0 , ... , id−1 } rj ( 5 ) The full inference algorithm is summarized in Algorithm 1 and an example is given in Figure 1 . 3.2.2 ANALYSIS . The output of a typical CNN is a feature map with a dimension that depends on the number of output channels used in each convolutional layer . In a HRN , this would lead to a variable dimension output as the final feature map depends on the routing . In a continual learning setup , dealing with variable dimension feature maps would be impractical . Feature hashing circumvents these problems by generating feature vectors of fixed dimension . Similar feature maps get to be processed by the same units , as a consequence of using feature hashing Algorithm 1 : Hash-routed inference Input : x Output : H = H ( x ) h0 = φ0 ( x ) ; J = ∅ H ← 0 ; h← h0 ; y ← x for j = 1 , ... , d− 1 do ij = argmaxk∈I\J ‖Bkh‖2 ; // select the best unit r← h−Bijh ; // compute new residue H ← H + r ; // accumulate residue for output J ← J ∪ { ij } ; // update set of used units if ‖r‖2 < τd then break ; // stop processing when residue is too low else y ← fij ( y ) ; // compute feature map h← φij ( y ‖y‖∞ ) ∥∥∥φij ( y‖y‖∞ ) ∥∥∥2 ; // new hash vector using flattened feature map end end for routing . In this context , similarity is measured by the inner product of flattened feature maps , projected onto different orthogonal subspaces ( each unit basis span ) . Another consequence is that unit weights become specialized in processing a certain type of features , rather than having to adapt to task specific features . This provides the kind of stability needed for continual learning . For a given unit Uk , rank ( Bk ) ≤ m < < s. Hence , it is reasonable to consider that the orthogonal subspace ’ s contribution to total variance is much more important than that of Bk . This is whyH ( x ) only contains projection residues . Note that in Eq.3 , hik ∈ Im ( φik ) and ‖hik‖2 = 1 . The operand under φik has an infinite norm of 1 , which under Eq.2 leads to inner product bounds independent of input data when considering orthogonality . Moreover , due to the approximate orthogonality of different feature hashing functions , summing the residues will not lead to much information loss as each residue vector rik is in Im ( φik−1 ) but this also explains why each unit can only be selected once . The residues ’ ` 1-norms are added to the loss function to induce sparsity . Denoting LT the specific loss for task T ( e.g . KL-divergence for supervised classification ) , the final loss L is : L = LT + λ ∑ j∈ { i0 , ... , id−1 } ‖rj‖1 ( 6 )
Ok, but not good enough. The authors present Hash-Routed Convolutional Neural Networks (HRNs), intended to enable learning of stable representations for continual learning, i.e. representations that change little for previously-learned tasks as more tasks are learned. The authors benchmark HRNs against several baselines in a number of tasks. Overall, the proposed method does not appear as conceptually and empirically convincing as those of other papers at ICLR and similar conferences.
SP:5363b2718ed0168fe5a24e0e6a63c62b20c47c6f
Explicit Pareto Front Optimization for Constrained Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( RL ) has shown great potential for training policies that optimize a single scalar reward . Recent approaches have exceeded human-level performance on Atari ( Mnih et al. , 2015 ) and Go ( Silver et al. , 2016 ) , and have also achieved impressive results in continuous control tasks , including robot locomotion ( Lillicrap et al. , 2016 ; Schulman et al. , 2017 ) , acrobatics ( Peng et al. , 2018 ) , and real-world robot manipulation ( Levine et al. , 2016 ; Zeng et al. , 2019 ) . However , many problems , especially in the real world , require that policies meet certain constraints . For instance , we might want a factory robot to optimize task throughput while keeping actuator forces below a threshold , to limit wear-and-tear . Or , we might want to minimize energy usage for cooling a data center while ensuring that temperatures remain below some level ( Lazic et al. , 2018 ) . Such problems are often encoded as constrained Markov Decision Processes ( CMDPs ) ( Altman , 1999 ) , where the goal is to maximize task return while meeting the constraint ( s ) . Typical approaches for solving CMDPs use Lagrangian relaxation ( Bertsekas , 1999 ) to transform the constrained optimization problem into an unconstrained one . However , existing Lagrangian-based approaches suffer from several limitations . First , because the relaxed objective is a weighted-sum of the task return and constraint violation , this assumes a convex Pareto front ( Das & Dennis , 1997 ) . In addition , when the constraint is difficult to satisfy , in practice policies can struggle to obtain task reward . Finally , such approaches typically produce a single policy that satisfies a specific constraint threshold . However , the exact constraint threshold may not be known in advance , or one may prefer to choose from a set of policies across a range of acceptable thresholds . We aim to achieve the goal of CMDPs ( i.e. , finding a constraint-satisfying policy that maximizes task return ) while avoiding these limitations , by introducing a novel , general framework based on multi-objective MDPs ( MO-MDP ) . A MO-MDP can be seen as a CMDP where the constrained objectives are instead unconstrained . Our key insight is that if we have access to the Pareto front , then we can find the optimal constraint-satisfying policy by simply searching along this front . However , finding the entire Pareto front is unnecessary if only a relatively small portion of the policies along the Pareto front meet the constraints . Therefore , we propose to also simultaneously prioritize learning for the preferences ( i.e. , trade-offs between reward and cost ) that are most likely to produce policies that satisfy the constraints , and thus cover the relevant part of the Pareto front . To our knowledge , there is no existing framework for applying multi-objective RL algorithms to constrained RL problems . Our main contribution is a general framework that enables this , by learning which preferences produce constraint-satisfying policies . This framework can be combined with any multi-objective RL algorithm that learns an approximate Pareto front of policies . Our second contribution is to extend a state-of-the-art multi-objective RL algorithm , multi-objective maximum a posteriori policy optimization ( MO-MPO ) ( Abdolmaleki et al. , 2020 ) , to learn the Pareto front in a single training run . We use this extension of MO-MPO within our framework , and call the resulting algorithm constrained MO-MPO . We show in practice , constrained MO-MPO outperforms existing approaches on challenging continuous control tasks with constraints . 2 RELATED WORK . Constrained reinforcement learning . Constrained RL algorithms seek policies that meet the desired constraints at deployment time . Most approaches use Lagrangian relaxation ( Bertsekas , 1999 ) . Recent Lagrangian-based approaches claim convergence to constraint-satisfying ( Tessler et al. , 2019 ) or optimal ( Paternain et al. , 2019 ) solutions , but this is debatable ( Szepesvari , 2020 ) . Recent works seek to stabilize this optimization by approximating the reward and cost functions with convex relaxations ( Yu et al. , 2019 ) or by utilizing derivatives of the constraint function ( Stooke et al. , 2020 ) . Other works have applied Lagrangian relaxation to mean-value constraints ( Tessler et al. , 2019 ) , convex set constraints ( Miryoosefi et al. , 2019 ) , and local constraint satisfaction ( Bohez et al. , 2019 ) . Existing Lagrangian approaches involve linear scalarization , however , and thus can not find solutions that lie on concave portions of the true Pareto front ( Das & Dennis , 1997 ) . In contrast , we build on a multi-objective RL algorithm that does not rely on scalarization , and in practice , our approach can indeed find constraint-satisfying solutions on a concave Pareto front ( see Sec . 5.1 , humanoid walk ) . Safe reinforcement learning . In safe RL , the aim is to achieve constraint satisfaction not only during deployment , but also during learning ( Garcı́a & Fernández , 2015 ) . Recent works for deep RL modify the policy improvement step to guarantee that the policy will never violate constraints during training ( Achiam et al. , 2017 ; Berkenkamp et al. , 2017 ; Chow et al. , 2018 ; 2019 ; Yang et al. , 2020 ; Zhang et al. , 2020 ) . These approaches require , however , that the initial policy meets ( or almost meets ) the constraints . Otherwise , performance degrades substantially and constrained policy optimization ( CPO ) ( Achiam et al. , 2017 ) , for example , performs worse than Lagrangian-based approaches ( Ray et al. , 2019 ) . The aim of our work is to find better solutions for constrained RL , rather than safe RL . We discuss in Sec . 6 how our method can be extended to reduce constraint violation during training . Multi-objective reinforcement learning . Our approach is built on ideas from multi-objective RL ( MORL ) , which consists of single-policy and multi-policy approaches . Single policy methods learn a policy that is optimal for a given setting of reward preferences . Most rely on linear scalarization ( Roijers et al. , 2013 ) , which restricts solutions to the convex portions of the Pareto front and can be sensitive to reward scales . Non-linear scalarizations have been proposed ( Tesauro et al. , 2008 ; Van Moffaert et al. , 2013 ; Golovin & Zhang , 2020 ) , but these are harder to combine with value-based RL and have seen limited use in deep RL . Recently , Abdolmaleki et al . ( 2020 ) introduced MO-MPO , where the preferences represent per-objective constraints on the policy improvement step . MO-MPO does not rely on scalarization and is thus invariant to reward scales . Multi-policy MORL aims to find a set of policies that covers the whole Pareto front . Recent approaches learn a manifold in parameter space that optimizes the hypervolume of the Pareto front ( Parisi et al. , 2016 ; 2017 ) . While such approaches could be combined with our framework , their scalability to deep RL remains to be shown . Other works combine single policy approaches with a general objective to optimize hypervolume ( Xu et al. , 2020 ) . The instantiation of our framework is similar in spirit to such two-level methods , but applied to a different problem setting . 3 BACKGROUND AND NOTATION . 3.1 CONSTRAINED MARKOV DECISION PROCESSES . A constrained Markov Decision Process ( CMDP ) consists of states s ∈ S , actions a ∈ A , an initial state distribution p0 ( s ) , a transition function p ( s′|s , a ) , reward functions { rk ( s , a ) } Kk=0 , constraint thresholds { ck } Kk=1 , and a discount factor γ ∈ [ 0 , 1 ] . The ( K + 1 ) reward functions consist of a task reward r0 and constrained rewards r1 : K ; we will refer to these together as objectives . A policy π ( a|s ) maps from a given state to a distribution over actions . The optimal solution to a constrained MDP is a policy that maximizes the expected return for the task reward r0 , while ensuring that the expected return for all constrained rewards r1 : K satisfy their respective thresholds : max π Eπ [ ∑ t γtr0 ( st , at ) ] s.t . Eπ [ ∑ t γtri ( st , at ) ] ≥ ci ∀i = 1 , ... , K , ( 1 ) where Eπ is shorthand for the expectation over trajectories when following the policy π , given a fixed initial state distribution . Here the constraint thresholds are lower bounds , without loss of generality . The value function V πk ( s ) of a policy π is its expected return for objective rk when starting from state s. The action-value functionQπk ( s , a ) denotes the expected return for objective rk after taking action a in state s and thereafter acting according to the policy : Qπk ( s , a ) = rk ( s , a ) + γEs′∼p ( s′|s , a ) [ V πk ( s′ ) ] . Most approaches for solving CMDPs are based on Lagrangian relaxation , where the constrained problem is turned into the following unconstrained optimization problem : min λ≥0 max π Eπ [ ∑ t γtr0 ( st , at ) ] + K∑ k=1 λk ( Eπ [ ∑ t γtrk ( st , at ) ] − ci ) . ( 2 ) These approaches alternate between optimizing for the Lagrange multipliers λk and the policy π . While our multi-objective perspective on constrained RL aims to achieve the goal of CMDPs—finding a constraint-satisfying policy that maximizes task return—it does not directly solve ( 1 ) . Nonetheless , we will show our approach outperforms those that directly solve ( 1 ) via Lagrangian relaxation . 3.2 MULTI-OBJECTIVE REINFORCEMENT LEARNING . In order to achieve the goal of CMDPs , we propose to leverage advances in multi-objective RL . A multi-objective MDP ( MO-MDP ) is defined in the same way as a CMDP , except without constraint thresholds . Because there are multiple unconstrained objectives , there is not a single optimal policy . Instead , there is a set of optimal policies , called the Pareto front . A policy is Pareto optimal if there is no other policy that improves its return for one objective without decreasing return for another . Preferences . Each policy on the Pareto front is the optimal policy for a particular setting of preferences ( i.e. , desired trade-off over objectives ) .1 This is typically encoded via a preference vector , in which each element k represents the relative importance of the corresponding objective rk . Connection to CMDPs . Given a CMDP { S , A , p0 , p , r0 : K , c1 : K , γ } , consider the corresponding MO-MDP { S , A , p0 , p , r0 : K , γ } . Regardless of the thresholds c1 : K , the optimal policy for the CMDP must lie on the Pareto front for this corresponding MO-MDP.2 Thus , if we knew the Pareto front , we could simply search along it to find the constraint-satisfying policy that maximizes task return . Multi-objective Maximum a Posteriori Policy Optimization ( MO-MPO ) . Whereas most MORL algorithms are based on linear scalarization , MO-MPO takes a distributional approach to training policies . For each policy improvement step , MO-MPO first computes a non-parametric policy for each objective rk that improves the ( parametric ) policy with respect to that objective , subject to a non-negative constraint k on the KL-divergence between the improved and old policies . Then , the policy is updated via supervised learning on the sum of these non-parametric policies . Intuitively , k defines the influence of objective rk on the final policy ; an objective with larger k has more influence . However , MO-MPO can only train policies for a single preference setting . Sec . 4.1 explains how we extend MO-MPO to train preference-conditioned policies π ( a|s , ) , in order to use it in our framework . We choose to extend MO-MPO because it does not suffer from the limitations of linear scalarization , and has been shown to outperform such approaches ( Abdolmaleki et al. , 2020 ) . 1This assumes that the choice of preference encoding does not restrict optimal solutions to the convex portions of the Pareto front . Although linear scalarization does not satisfy this requirement , other kinds of preference encodings do , for instance Chebyshev scalarization ( Van Moffaert et al. , 2013 ) or the per-objective KL-divergence constraints in MO-MPO , described later in this section . 2This is because if the optimal policy for the CMDP is not Pareto optimal , then there must exist another policy that obtains higher task return while meeting the constraints , which leads to a contradiction .
The paper is interested in reinforcement learning where one needs to satisfy constraints (for instance energy spent) in addition to maximizing rewards. The proposed approach proposes to extend any method able to approximate the Pareto front of optimal policies by also learning portions of the front that satisfy user constraints (given that only small portion of the front may be valid). In particular, a previous approach MO-MPO is used to approximate the Pareto front in a first step and a second step learns another policy find preference vectors satisfying given constrains. Experiments are carried in two environments and show that the proposed method outperforms Lagrangian baselines (e.g. optimizing alternatively for reward and constrain violation) in particular in settings where constraints are harder to satisfy.
SP:d484cf1bcfab7795f88ea60a34ee9822be39e886
Explicit Pareto Front Optimization for Constrained Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( RL ) has shown great potential for training policies that optimize a single scalar reward . Recent approaches have exceeded human-level performance on Atari ( Mnih et al. , 2015 ) and Go ( Silver et al. , 2016 ) , and have also achieved impressive results in continuous control tasks , including robot locomotion ( Lillicrap et al. , 2016 ; Schulman et al. , 2017 ) , acrobatics ( Peng et al. , 2018 ) , and real-world robot manipulation ( Levine et al. , 2016 ; Zeng et al. , 2019 ) . However , many problems , especially in the real world , require that policies meet certain constraints . For instance , we might want a factory robot to optimize task throughput while keeping actuator forces below a threshold , to limit wear-and-tear . Or , we might want to minimize energy usage for cooling a data center while ensuring that temperatures remain below some level ( Lazic et al. , 2018 ) . Such problems are often encoded as constrained Markov Decision Processes ( CMDPs ) ( Altman , 1999 ) , where the goal is to maximize task return while meeting the constraint ( s ) . Typical approaches for solving CMDPs use Lagrangian relaxation ( Bertsekas , 1999 ) to transform the constrained optimization problem into an unconstrained one . However , existing Lagrangian-based approaches suffer from several limitations . First , because the relaxed objective is a weighted-sum of the task return and constraint violation , this assumes a convex Pareto front ( Das & Dennis , 1997 ) . In addition , when the constraint is difficult to satisfy , in practice policies can struggle to obtain task reward . Finally , such approaches typically produce a single policy that satisfies a specific constraint threshold . However , the exact constraint threshold may not be known in advance , or one may prefer to choose from a set of policies across a range of acceptable thresholds . We aim to achieve the goal of CMDPs ( i.e. , finding a constraint-satisfying policy that maximizes task return ) while avoiding these limitations , by introducing a novel , general framework based on multi-objective MDPs ( MO-MDP ) . A MO-MDP can be seen as a CMDP where the constrained objectives are instead unconstrained . Our key insight is that if we have access to the Pareto front , then we can find the optimal constraint-satisfying policy by simply searching along this front . However , finding the entire Pareto front is unnecessary if only a relatively small portion of the policies along the Pareto front meet the constraints . Therefore , we propose to also simultaneously prioritize learning for the preferences ( i.e. , trade-offs between reward and cost ) that are most likely to produce policies that satisfy the constraints , and thus cover the relevant part of the Pareto front . To our knowledge , there is no existing framework for applying multi-objective RL algorithms to constrained RL problems . Our main contribution is a general framework that enables this , by learning which preferences produce constraint-satisfying policies . This framework can be combined with any multi-objective RL algorithm that learns an approximate Pareto front of policies . Our second contribution is to extend a state-of-the-art multi-objective RL algorithm , multi-objective maximum a posteriori policy optimization ( MO-MPO ) ( Abdolmaleki et al. , 2020 ) , to learn the Pareto front in a single training run . We use this extension of MO-MPO within our framework , and call the resulting algorithm constrained MO-MPO . We show in practice , constrained MO-MPO outperforms existing approaches on challenging continuous control tasks with constraints . 2 RELATED WORK . Constrained reinforcement learning . Constrained RL algorithms seek policies that meet the desired constraints at deployment time . Most approaches use Lagrangian relaxation ( Bertsekas , 1999 ) . Recent Lagrangian-based approaches claim convergence to constraint-satisfying ( Tessler et al. , 2019 ) or optimal ( Paternain et al. , 2019 ) solutions , but this is debatable ( Szepesvari , 2020 ) . Recent works seek to stabilize this optimization by approximating the reward and cost functions with convex relaxations ( Yu et al. , 2019 ) or by utilizing derivatives of the constraint function ( Stooke et al. , 2020 ) . Other works have applied Lagrangian relaxation to mean-value constraints ( Tessler et al. , 2019 ) , convex set constraints ( Miryoosefi et al. , 2019 ) , and local constraint satisfaction ( Bohez et al. , 2019 ) . Existing Lagrangian approaches involve linear scalarization , however , and thus can not find solutions that lie on concave portions of the true Pareto front ( Das & Dennis , 1997 ) . In contrast , we build on a multi-objective RL algorithm that does not rely on scalarization , and in practice , our approach can indeed find constraint-satisfying solutions on a concave Pareto front ( see Sec . 5.1 , humanoid walk ) . Safe reinforcement learning . In safe RL , the aim is to achieve constraint satisfaction not only during deployment , but also during learning ( Garcı́a & Fernández , 2015 ) . Recent works for deep RL modify the policy improvement step to guarantee that the policy will never violate constraints during training ( Achiam et al. , 2017 ; Berkenkamp et al. , 2017 ; Chow et al. , 2018 ; 2019 ; Yang et al. , 2020 ; Zhang et al. , 2020 ) . These approaches require , however , that the initial policy meets ( or almost meets ) the constraints . Otherwise , performance degrades substantially and constrained policy optimization ( CPO ) ( Achiam et al. , 2017 ) , for example , performs worse than Lagrangian-based approaches ( Ray et al. , 2019 ) . The aim of our work is to find better solutions for constrained RL , rather than safe RL . We discuss in Sec . 6 how our method can be extended to reduce constraint violation during training . Multi-objective reinforcement learning . Our approach is built on ideas from multi-objective RL ( MORL ) , which consists of single-policy and multi-policy approaches . Single policy methods learn a policy that is optimal for a given setting of reward preferences . Most rely on linear scalarization ( Roijers et al. , 2013 ) , which restricts solutions to the convex portions of the Pareto front and can be sensitive to reward scales . Non-linear scalarizations have been proposed ( Tesauro et al. , 2008 ; Van Moffaert et al. , 2013 ; Golovin & Zhang , 2020 ) , but these are harder to combine with value-based RL and have seen limited use in deep RL . Recently , Abdolmaleki et al . ( 2020 ) introduced MO-MPO , where the preferences represent per-objective constraints on the policy improvement step . MO-MPO does not rely on scalarization and is thus invariant to reward scales . Multi-policy MORL aims to find a set of policies that covers the whole Pareto front . Recent approaches learn a manifold in parameter space that optimizes the hypervolume of the Pareto front ( Parisi et al. , 2016 ; 2017 ) . While such approaches could be combined with our framework , their scalability to deep RL remains to be shown . Other works combine single policy approaches with a general objective to optimize hypervolume ( Xu et al. , 2020 ) . The instantiation of our framework is similar in spirit to such two-level methods , but applied to a different problem setting . 3 BACKGROUND AND NOTATION . 3.1 CONSTRAINED MARKOV DECISION PROCESSES . A constrained Markov Decision Process ( CMDP ) consists of states s ∈ S , actions a ∈ A , an initial state distribution p0 ( s ) , a transition function p ( s′|s , a ) , reward functions { rk ( s , a ) } Kk=0 , constraint thresholds { ck } Kk=1 , and a discount factor γ ∈ [ 0 , 1 ] . The ( K + 1 ) reward functions consist of a task reward r0 and constrained rewards r1 : K ; we will refer to these together as objectives . A policy π ( a|s ) maps from a given state to a distribution over actions . The optimal solution to a constrained MDP is a policy that maximizes the expected return for the task reward r0 , while ensuring that the expected return for all constrained rewards r1 : K satisfy their respective thresholds : max π Eπ [ ∑ t γtr0 ( st , at ) ] s.t . Eπ [ ∑ t γtri ( st , at ) ] ≥ ci ∀i = 1 , ... , K , ( 1 ) where Eπ is shorthand for the expectation over trajectories when following the policy π , given a fixed initial state distribution . Here the constraint thresholds are lower bounds , without loss of generality . The value function V πk ( s ) of a policy π is its expected return for objective rk when starting from state s. The action-value functionQπk ( s , a ) denotes the expected return for objective rk after taking action a in state s and thereafter acting according to the policy : Qπk ( s , a ) = rk ( s , a ) + γEs′∼p ( s′|s , a ) [ V πk ( s′ ) ] . Most approaches for solving CMDPs are based on Lagrangian relaxation , where the constrained problem is turned into the following unconstrained optimization problem : min λ≥0 max π Eπ [ ∑ t γtr0 ( st , at ) ] + K∑ k=1 λk ( Eπ [ ∑ t γtrk ( st , at ) ] − ci ) . ( 2 ) These approaches alternate between optimizing for the Lagrange multipliers λk and the policy π . While our multi-objective perspective on constrained RL aims to achieve the goal of CMDPs—finding a constraint-satisfying policy that maximizes task return—it does not directly solve ( 1 ) . Nonetheless , we will show our approach outperforms those that directly solve ( 1 ) via Lagrangian relaxation . 3.2 MULTI-OBJECTIVE REINFORCEMENT LEARNING . In order to achieve the goal of CMDPs , we propose to leverage advances in multi-objective RL . A multi-objective MDP ( MO-MDP ) is defined in the same way as a CMDP , except without constraint thresholds . Because there are multiple unconstrained objectives , there is not a single optimal policy . Instead , there is a set of optimal policies , called the Pareto front . A policy is Pareto optimal if there is no other policy that improves its return for one objective without decreasing return for another . Preferences . Each policy on the Pareto front is the optimal policy for a particular setting of preferences ( i.e. , desired trade-off over objectives ) .1 This is typically encoded via a preference vector , in which each element k represents the relative importance of the corresponding objective rk . Connection to CMDPs . Given a CMDP { S , A , p0 , p , r0 : K , c1 : K , γ } , consider the corresponding MO-MDP { S , A , p0 , p , r0 : K , γ } . Regardless of the thresholds c1 : K , the optimal policy for the CMDP must lie on the Pareto front for this corresponding MO-MDP.2 Thus , if we knew the Pareto front , we could simply search along it to find the constraint-satisfying policy that maximizes task return . Multi-objective Maximum a Posteriori Policy Optimization ( MO-MPO ) . Whereas most MORL algorithms are based on linear scalarization , MO-MPO takes a distributional approach to training policies . For each policy improvement step , MO-MPO first computes a non-parametric policy for each objective rk that improves the ( parametric ) policy with respect to that objective , subject to a non-negative constraint k on the KL-divergence between the improved and old policies . Then , the policy is updated via supervised learning on the sum of these non-parametric policies . Intuitively , k defines the influence of objective rk on the final policy ; an objective with larger k has more influence . However , MO-MPO can only train policies for a single preference setting . Sec . 4.1 explains how we extend MO-MPO to train preference-conditioned policies π ( a|s , ) , in order to use it in our framework . We choose to extend MO-MPO because it does not suffer from the limitations of linear scalarization , and has been shown to outperform such approaches ( Abdolmaleki et al. , 2020 ) . 1This assumes that the choice of preference encoding does not restrict optimal solutions to the convex portions of the Pareto front . Although linear scalarization does not satisfy this requirement , other kinds of preference encodings do , for instance Chebyshev scalarization ( Van Moffaert et al. , 2013 ) or the per-objective KL-divergence constraints in MO-MPO , described later in this section . 2This is because if the optimal policy for the CMDP is not Pareto optimal , then there must exist another policy that obtains higher task return while meeting the constraints , which leads to a contradiction .
In Reinforcement Learning (RL) it is common that one searches for policies that optimize the reward and that meet certain constraints. A common approach for handling the constraints is Lagrangian relaxation, i.e., to incorporate the constraints in some way into the objective. In this submission, a different approach is suggested, in which the constraints are treated as additional objectives and then the Pareto front of policies is computed. This is reasonable as the optimal policy for a single objective that satisfies certain constraints must be Pareto optimal when the constraints are interpreted as additional objectives. It is then explained how the new approach can be implemented and several experiments are conducted on well-known data sets. It turns out that it is indeed beneficial for some data set to compute the set of Pareto-optimal policies instead of using Lagrangian relaxation because in some cases Lagrangian relaxation finds only the extreme policies while the Pareto front also contains intermediate policies that balance the criteria better.
SP:d484cf1bcfab7795f88ea60a34ee9822be39e886
Explicit Pareto Front Optimization for Constrained Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( RL ) has shown great potential for training policies that optimize a single scalar reward . Recent approaches have exceeded human-level performance on Atari ( Mnih et al. , 2015 ) and Go ( Silver et al. , 2016 ) , and have also achieved impressive results in continuous control tasks , including robot locomotion ( Lillicrap et al. , 2016 ; Schulman et al. , 2017 ) , acrobatics ( Peng et al. , 2018 ) , and real-world robot manipulation ( Levine et al. , 2016 ; Zeng et al. , 2019 ) . However , many problems , especially in the real world , require that policies meet certain constraints . For instance , we might want a factory robot to optimize task throughput while keeping actuator forces below a threshold , to limit wear-and-tear . Or , we might want to minimize energy usage for cooling a data center while ensuring that temperatures remain below some level ( Lazic et al. , 2018 ) . Such problems are often encoded as constrained Markov Decision Processes ( CMDPs ) ( Altman , 1999 ) , where the goal is to maximize task return while meeting the constraint ( s ) . Typical approaches for solving CMDPs use Lagrangian relaxation ( Bertsekas , 1999 ) to transform the constrained optimization problem into an unconstrained one . However , existing Lagrangian-based approaches suffer from several limitations . First , because the relaxed objective is a weighted-sum of the task return and constraint violation , this assumes a convex Pareto front ( Das & Dennis , 1997 ) . In addition , when the constraint is difficult to satisfy , in practice policies can struggle to obtain task reward . Finally , such approaches typically produce a single policy that satisfies a specific constraint threshold . However , the exact constraint threshold may not be known in advance , or one may prefer to choose from a set of policies across a range of acceptable thresholds . We aim to achieve the goal of CMDPs ( i.e. , finding a constraint-satisfying policy that maximizes task return ) while avoiding these limitations , by introducing a novel , general framework based on multi-objective MDPs ( MO-MDP ) . A MO-MDP can be seen as a CMDP where the constrained objectives are instead unconstrained . Our key insight is that if we have access to the Pareto front , then we can find the optimal constraint-satisfying policy by simply searching along this front . However , finding the entire Pareto front is unnecessary if only a relatively small portion of the policies along the Pareto front meet the constraints . Therefore , we propose to also simultaneously prioritize learning for the preferences ( i.e. , trade-offs between reward and cost ) that are most likely to produce policies that satisfy the constraints , and thus cover the relevant part of the Pareto front . To our knowledge , there is no existing framework for applying multi-objective RL algorithms to constrained RL problems . Our main contribution is a general framework that enables this , by learning which preferences produce constraint-satisfying policies . This framework can be combined with any multi-objective RL algorithm that learns an approximate Pareto front of policies . Our second contribution is to extend a state-of-the-art multi-objective RL algorithm , multi-objective maximum a posteriori policy optimization ( MO-MPO ) ( Abdolmaleki et al. , 2020 ) , to learn the Pareto front in a single training run . We use this extension of MO-MPO within our framework , and call the resulting algorithm constrained MO-MPO . We show in practice , constrained MO-MPO outperforms existing approaches on challenging continuous control tasks with constraints . 2 RELATED WORK . Constrained reinforcement learning . Constrained RL algorithms seek policies that meet the desired constraints at deployment time . Most approaches use Lagrangian relaxation ( Bertsekas , 1999 ) . Recent Lagrangian-based approaches claim convergence to constraint-satisfying ( Tessler et al. , 2019 ) or optimal ( Paternain et al. , 2019 ) solutions , but this is debatable ( Szepesvari , 2020 ) . Recent works seek to stabilize this optimization by approximating the reward and cost functions with convex relaxations ( Yu et al. , 2019 ) or by utilizing derivatives of the constraint function ( Stooke et al. , 2020 ) . Other works have applied Lagrangian relaxation to mean-value constraints ( Tessler et al. , 2019 ) , convex set constraints ( Miryoosefi et al. , 2019 ) , and local constraint satisfaction ( Bohez et al. , 2019 ) . Existing Lagrangian approaches involve linear scalarization , however , and thus can not find solutions that lie on concave portions of the true Pareto front ( Das & Dennis , 1997 ) . In contrast , we build on a multi-objective RL algorithm that does not rely on scalarization , and in practice , our approach can indeed find constraint-satisfying solutions on a concave Pareto front ( see Sec . 5.1 , humanoid walk ) . Safe reinforcement learning . In safe RL , the aim is to achieve constraint satisfaction not only during deployment , but also during learning ( Garcı́a & Fernández , 2015 ) . Recent works for deep RL modify the policy improvement step to guarantee that the policy will never violate constraints during training ( Achiam et al. , 2017 ; Berkenkamp et al. , 2017 ; Chow et al. , 2018 ; 2019 ; Yang et al. , 2020 ; Zhang et al. , 2020 ) . These approaches require , however , that the initial policy meets ( or almost meets ) the constraints . Otherwise , performance degrades substantially and constrained policy optimization ( CPO ) ( Achiam et al. , 2017 ) , for example , performs worse than Lagrangian-based approaches ( Ray et al. , 2019 ) . The aim of our work is to find better solutions for constrained RL , rather than safe RL . We discuss in Sec . 6 how our method can be extended to reduce constraint violation during training . Multi-objective reinforcement learning . Our approach is built on ideas from multi-objective RL ( MORL ) , which consists of single-policy and multi-policy approaches . Single policy methods learn a policy that is optimal for a given setting of reward preferences . Most rely on linear scalarization ( Roijers et al. , 2013 ) , which restricts solutions to the convex portions of the Pareto front and can be sensitive to reward scales . Non-linear scalarizations have been proposed ( Tesauro et al. , 2008 ; Van Moffaert et al. , 2013 ; Golovin & Zhang , 2020 ) , but these are harder to combine with value-based RL and have seen limited use in deep RL . Recently , Abdolmaleki et al . ( 2020 ) introduced MO-MPO , where the preferences represent per-objective constraints on the policy improvement step . MO-MPO does not rely on scalarization and is thus invariant to reward scales . Multi-policy MORL aims to find a set of policies that covers the whole Pareto front . Recent approaches learn a manifold in parameter space that optimizes the hypervolume of the Pareto front ( Parisi et al. , 2016 ; 2017 ) . While such approaches could be combined with our framework , their scalability to deep RL remains to be shown . Other works combine single policy approaches with a general objective to optimize hypervolume ( Xu et al. , 2020 ) . The instantiation of our framework is similar in spirit to such two-level methods , but applied to a different problem setting . 3 BACKGROUND AND NOTATION . 3.1 CONSTRAINED MARKOV DECISION PROCESSES . A constrained Markov Decision Process ( CMDP ) consists of states s ∈ S , actions a ∈ A , an initial state distribution p0 ( s ) , a transition function p ( s′|s , a ) , reward functions { rk ( s , a ) } Kk=0 , constraint thresholds { ck } Kk=1 , and a discount factor γ ∈ [ 0 , 1 ] . The ( K + 1 ) reward functions consist of a task reward r0 and constrained rewards r1 : K ; we will refer to these together as objectives . A policy π ( a|s ) maps from a given state to a distribution over actions . The optimal solution to a constrained MDP is a policy that maximizes the expected return for the task reward r0 , while ensuring that the expected return for all constrained rewards r1 : K satisfy their respective thresholds : max π Eπ [ ∑ t γtr0 ( st , at ) ] s.t . Eπ [ ∑ t γtri ( st , at ) ] ≥ ci ∀i = 1 , ... , K , ( 1 ) where Eπ is shorthand for the expectation over trajectories when following the policy π , given a fixed initial state distribution . Here the constraint thresholds are lower bounds , without loss of generality . The value function V πk ( s ) of a policy π is its expected return for objective rk when starting from state s. The action-value functionQπk ( s , a ) denotes the expected return for objective rk after taking action a in state s and thereafter acting according to the policy : Qπk ( s , a ) = rk ( s , a ) + γEs′∼p ( s′|s , a ) [ V πk ( s′ ) ] . Most approaches for solving CMDPs are based on Lagrangian relaxation , where the constrained problem is turned into the following unconstrained optimization problem : min λ≥0 max π Eπ [ ∑ t γtr0 ( st , at ) ] + K∑ k=1 λk ( Eπ [ ∑ t γtrk ( st , at ) ] − ci ) . ( 2 ) These approaches alternate between optimizing for the Lagrange multipliers λk and the policy π . While our multi-objective perspective on constrained RL aims to achieve the goal of CMDPs—finding a constraint-satisfying policy that maximizes task return—it does not directly solve ( 1 ) . Nonetheless , we will show our approach outperforms those that directly solve ( 1 ) via Lagrangian relaxation . 3.2 MULTI-OBJECTIVE REINFORCEMENT LEARNING . In order to achieve the goal of CMDPs , we propose to leverage advances in multi-objective RL . A multi-objective MDP ( MO-MDP ) is defined in the same way as a CMDP , except without constraint thresholds . Because there are multiple unconstrained objectives , there is not a single optimal policy . Instead , there is a set of optimal policies , called the Pareto front . A policy is Pareto optimal if there is no other policy that improves its return for one objective without decreasing return for another . Preferences . Each policy on the Pareto front is the optimal policy for a particular setting of preferences ( i.e. , desired trade-off over objectives ) .1 This is typically encoded via a preference vector , in which each element k represents the relative importance of the corresponding objective rk . Connection to CMDPs . Given a CMDP { S , A , p0 , p , r0 : K , c1 : K , γ } , consider the corresponding MO-MDP { S , A , p0 , p , r0 : K , γ } . Regardless of the thresholds c1 : K , the optimal policy for the CMDP must lie on the Pareto front for this corresponding MO-MDP.2 Thus , if we knew the Pareto front , we could simply search along it to find the constraint-satisfying policy that maximizes task return . Multi-objective Maximum a Posteriori Policy Optimization ( MO-MPO ) . Whereas most MORL algorithms are based on linear scalarization , MO-MPO takes a distributional approach to training policies . For each policy improvement step , MO-MPO first computes a non-parametric policy for each objective rk that improves the ( parametric ) policy with respect to that objective , subject to a non-negative constraint k on the KL-divergence between the improved and old policies . Then , the policy is updated via supervised learning on the sum of these non-parametric policies . Intuitively , k defines the influence of objective rk on the final policy ; an objective with larger k has more influence . However , MO-MPO can only train policies for a single preference setting . Sec . 4.1 explains how we extend MO-MPO to train preference-conditioned policies π ( a|s , ) , in order to use it in our framework . We choose to extend MO-MPO because it does not suffer from the limitations of linear scalarization , and has been shown to outperform such approaches ( Abdolmaleki et al. , 2020 ) . 1This assumes that the choice of preference encoding does not restrict optimal solutions to the convex portions of the Pareto front . Although linear scalarization does not satisfy this requirement , other kinds of preference encodings do , for instance Chebyshev scalarization ( Van Moffaert et al. , 2013 ) or the per-objective KL-divergence constraints in MO-MPO , described later in this section . 2This is because if the optimal policy for the CMDP is not Pareto optimal , then there must exist another policy that obtains higher task return while meeting the constraints , which leads to a contradiction .
This paper introduced a general framework that incorporates multi-object reinforcement learning(MORL) perspective for constrained reinforcement learning to a policy set, called Pareto front, that meets the constrained. The author has instantiated a method based on the previous method MO-MPO. Compared to previous Lagrangian-based approaches, the proposed method has advantages in solution quality, stability, and sample-efficiency in few empirical environments.
SP:d484cf1bcfab7795f88ea60a34ee9822be39e886
Low Complexity Approximate Bayesian Logistic Regression for Sparse Online Learning
1 INTRODUCTION . We consider online ( Bottou , 1998 ; Shalev-Shwartz et al. , 2011 ) binary logistic regression over a series of rounds t ∈ { 1 , 2 , . . . , T } . At round t , a sparse feature vector xt ∈ [ −1 , 1 ] d with dt d nonzero values , is revealed , and a prediction for the label yt ∈ { −1 , 1 } must be generated . The dimension d can be huge ( billions ) , but dt is usually tens or hundreds . Logistic regression is used in a huge portion of existing learning problems . It can be used to predict medical risk factors , to predict world phenomena , stock market movements , or click-through-rate in online advertising . The online sparse setup is also very common to these application areas , particularly , if predictions need to be streamed in real time as the model keeps updating from newly seen examples . A prediction algorithm attempts to maximize probabilities of the observed labels . Online methods sequentially learn parameters for the d features . With stochastic gradient methods ( Bottou , 2010 ; Duchi et al. , 2011 ) , these are weights wi , t associated with feature i ∈ { 1 , · · · , d } at round t. Bayesian methods keep track of some distribution over the parameters , and assign an expected mixture probability to the generated prediction ( Hoffman et al. , 2010 ; Opper & Winther , 1998 ) . The overall objective is to maximize a sequence likelihood probability , or to minimize its negative logarithm . A benchmark measure of an algorithm ’ s performance is its regret , the excess loss it attains over an algorithm that uses some fixed comparator values of w∗ 4 = ( w1 , w2 , . . . , wd ) T ( T denoting transpose ) . A comparator w∗ that minimizes the cumulative loss can be picked to measure the regret relative to the best possible comparator in some space of parameter values . Kakade & Ng ( 2005 ) ; Foster et al . ( 2018 ) ; Shamir ( 2020 ) demonstrated that , in theory , Bayesian methods are capable to achieve regret , logarithmic with the horizon T and linear with d , that even matches regret lower bounds for d = o ( T ) . Classical stochastic gradient methods are usually implemented as proper learning algorithms , that determine wt prior to observing xt , and are inferior in the worst-case ( Hazan et al. , 2014 ) , although , in many cases depending on the data , they can still achieve logarithmic regret ( Bach , 2010 ; 2014 ; Bach & Moulines , 2013 ) . Recent work ( Jézéquel et al. , 2020 ) demonstrated non-Bayesian improper gradient based algorithms with better regret . Unfortunately , superiority of Bayesian methods diminishes by their intractability . A theoretically optimal prior has a diagonal covariance matrix , with each component either uniformly or Normally distributed with large variance . Effects of such a prior can not be maintained in practical online problems with a large sparse feature set , as the posterior of such a prior no longer has the properties of the prior , but must be maintained as a subsequent prior . Gaussian approximations that rely on diagonalization of the covariance must be used . Neither normal nor the diagonal assumptions are true for the real posterior ( even with diagonal prior ) . They thus lead to performance degradations . Diagonalization is similar to linearization in convex optimization , specifically for stochastic gradient descent ( SGD ) ( Zinkevich , 2003 ) . It allows handling features independently , but limits performance . Bayesian learning literature focused on applying such methods to predict posterior probabilities , and provide model ( epistemic ) uncertainty measurements ( Bishop , 2006 ; Dempster , 1968 ; Huelsenbeck & Ronquist , 2001 ; Knill & Richards , 1996 ) . However , uncertainty of a feature is , in fact , mostly a function of the number of examples in which it was present ; a measure that can be tracked , not estimated . Methods , such as Variational Bayesian ( VB ) Inference ( Bishop , 2006 ; Blei et al. , 2017 ; Drugowitsch , 2019 ; Drugowitsch et al. , 2019 ; Ranganath et al. , 2014 ) , track such measurements by matching the posterior . However , as demonstrated in Rissanen ( 1984 ) seminal work , minimizing regret is identical to uncertainty reduction , as regret is merely a different representation of uncertainty . Regret can be universally minimized over the possible parameter space through a good choice of a prior . Hence , to minimize uncertainty , the role of an approximation is to preserve the effect of such a prior at least in the region of the distribution that dominates the ultimate posterior at the horizon T . This is a simpler problem than matching the posterior , and opens possibilities for simpler approximations that can lead to results identical to those of heavy methods as VB . VB methods are typically used offline to match a tractable posterior to the true one by upper bounding overall loss . They are computationally involved , requiring either iterative techniques ( Bishop , 2006 ; Blei et al. , 2017 ; Murphy , 2012 ) like Expectation Maximization ( EM ) ( Dempster et al. , 1977 ; Moon , 1996 ) ; or Monte Carlo ( MC ) sampling , replacing analytical expectation by an empirical one over a randomly drawn set . To converge , MC can be combined with gradient descent , either requiring heavy computations , or adapting stochastic gradient methods to update posteriors ( Broderick et al. , 2013 ; Knowles , 2015 ; Nguyen et al. , 2017a ; b ) . For online problems , the posterior of an example is the prior of the subsequent one . To minimize losses , online VB must converge to the optimal approximation at every example . Otherwise , additional losses may be incurred , as the algorithm may not converge at each example , while the target posterior keeps moving with subsequent examples . Moreover , combining methods that need to tune hyper-parameters defeats the parameter free nature ( Abdellaoui , 2000 ; Mcmahan & Streeter , 2012 ; Orabona & Pál , 2016 ) of Bayesian methods . Most Bayesian literature addressed the dense problem , where xt consists of mostly nonzero entries for every t , and the dimension d of the feature space is relatively small . Techniques , like Gaussian Mixtures ( Herbrich et al. , 2003 ; Montuelle et al. , 2013 ; 2014 ; Rasmussen , 2000 ; Reynolds et al. , 2000 ; Sung , 2004 ) , that may use VB , usually apply matrix computations quadratic in d on the covariance matrix . In many practical problems , however , a very small feature subset is present in each example . For categorical features , only one of the features in the vector is present at any example . Techniques , useful for the low dimensional dense problem , may thus not be practical . Paper Contributions : We provide a simple analytical Bayesian method for online sparse logistic and probit regressions with closed form updates . We generalize the method also for dense multidimensional updates , if the problem is not completely sparse . Our results are first to study regret for Bayesian methods that are simple enough to be applied in practice . They provide an example to the connection between uncertainty and regret , and more broadly the Minimum Description Length ( MDL ) principle ( Grunwald , 2007 ; Rissanen , 1978a ; b ; 1984 ; 1986 ; Shamir , 2015 ; 2020 ) . Empirical results demonstrate the advantages of our method over computationally involved methods and over other simpler approximations , both by achieving better regret and better loss on real data . As part of the algorithm , uncertainty measures are provided with no added complexity . We specifically demonstrate that it is sufficient to have an approximation focus on the location of the peak of the posterior and its curvature or value , which are most likely to dominate regret , instead of approximating the full posterior , which brings unnecessary complexity missing the real goal of preserving the effects of a good prior . In fact , approximating the full posterior may eventually lead to poor generalization and overfitting by focusing too much on the tails of the posterior . Our approach directly approximates the posterior , unlike VB methods that approximate by minimizing an upper bound on the loss . Finally , our approach leverages sparsity to solve a sparse problem . Related Work : The simplest single dimensional online logistic regression problem ( d = 1 and x1 , t = 1 , ∀t ) was widely studied . Jefferys ’ prior , ρ ( θ ) 4 = 1/ ( π √ θ ( 1− θ ) ) , is asymptotically optimal ( Clarke & Barron , 1994 ; Xie & Barron , 1997 ; 2000 ; Drmota & Szpankowski. , 2004 ) ) . It can be expressed in terms of log-odds weights w as ρ ( w ) = ew/2/ [ π ( 1 + ew ) ] . Applying a mixture leads to the Krichevsky & Trofimov ( 1981 ) ( KT ) add-1/2 estimator Q ( yt|yt−1 ) = [ nt−1 ( yt ) + 0.5 ] /t , where nt−1 ( yt ) counts occurrences of yt . We use yt to express a sequence from 1 to t. Applying this prior in a Follow The Regularized Leader ( FTRL ) setting ( McMahan , 2011 ) also leads to the KT estimator . This raised the question whether regret optimality generalizes to large dimensions ( McMahan & Streeter , 2012 ) . Hazan et al . ( 2014 ) showed that this was not the case for proper methods . The bounds , however , theoretically generalize for Bayesian methods ( Kakade & Ng , 2005 ; Foster et al. , 2018 ; Shamir , 2020 ) , with large variance Gaussian or uniform prior with diagonal covariance . Peaked priors fail , as for each feature in an example , other features provide a self excluding log-odds prior , that shifts the relation between the overall distribution and the feature weight . While wide priors are good theoretically , because of the intractability of the Bayesian mixture integrals , diagonal approximations that are used unfortunately degrade their effect . Bayesian methods have been studied extensively for estimating posteriors and uncertainty ( Bishop , 2006 ; Makowski et al. , 2002 ; Sen & Stoffa , 1996 ) . There is ample literature researching such techniques in deep networks ( see , e.g. , Blundell et al . ( 2015 ) ; Hwang et al . ( 2020 ) ; Kendall & Gal ( 2017 ) ; Lakshminarayanan et al . ( 2017 ) ; Malinin & Gales ( 2018 ) ; Wilson ( 2020 ) ) . Most of the work focuses on the ultimate posterior after the full training dataset has been visited . One attempts to leverage the uncertainty measurements to aid in inference on unseen examples . Techniques like expectation propagation ( EP ) ( Minka , 2001 ; 2013 ) ( see also Bishop ( 2006 ) ; Chu et al . ( 2011 ) ; Cunningham et al . ( 2011 ) ; Graepel et al . ( 2010 ) ) and VB are used to generate estimates of the posterior . In a dense setup , where there is a relatively small number features ( or units in a deep network ) , Gaussian Mixture models can also be learned , where a jointly Gaussian posterior is learned , usually with some kernel that is used to reduce the dimensionality of the parameters that are actually being trained . Such methods , however , do not fit the sparse online setup . Variational methods are derived utilizing Jensen ’ s inequality to upper bound loss of expectation by expectation of the negative logarithm of the product of the prior ρ ( w ) and data likelihood P ( yT |xT , w ) . Normalizing this joint by the expected label sequence probability gives the posterior P ( w|xT , yT ) . Then , a posterior Q ( · ) with a desired form is matched by minimizing the KL divergence KL ( Q||P ) , which decomposes into expectation w.r.t . Q ( ) ̇ over the loss on yT and KL ( Q||ρ ) between the approximated posterior and the true prior . The first term may require techniques like the iterative mean field approximation EM ( Bishop , 2006 ; Jaakkola & Jordan , 1998 ) , or MC sampling to be approximated . Gradient methods can also minimize KL ( Q||P ) . In the sparse setup , it is standard to assume a diagonal Q ( · ) . In an online setting , the process can be iterated over the examples ( or mini-batches ) , where the posterior at t is the prior at t+ 1 . Computing the approximate posterior may be very expensive if done for every example . SGD can be used with MC sampling , but that would incur additional losses , as the posterior changes between successive examples . Like VB , EP minimizes the opposite divergence KL ( P ||Q ) between the posterior and its approximate .
This paper proposes an algorithm for online logistic regression based on analytical formulas that approximate the Bayesian predictive posterior. These approximations are based on assuming a diagonal covariance Gaussian form for the posterior at each iteration that is optimized to fit the true posterior. Two alternatives are proposed for the optimization: one based on Newton's method and the other based on a Taylor series approximation, which experimentally yields similar results. Thanks to these closed formula approximations, the resulting algorithm has a constant low cost per observation and is particularly suitable for sparse high-dimensional scenarios. It is empirically shown that the algorithm achieves a known regret lower bound on synthetic data when the true prior on the weights used to generate the data is provided to the algorithm.
SP:7f9f0d2f54a3f42cceb03d9fce97dd36fd78fb6a
Low Complexity Approximate Bayesian Logistic Regression for Sparse Online Learning
1 INTRODUCTION . We consider online ( Bottou , 1998 ; Shalev-Shwartz et al. , 2011 ) binary logistic regression over a series of rounds t ∈ { 1 , 2 , . . . , T } . At round t , a sparse feature vector xt ∈ [ −1 , 1 ] d with dt d nonzero values , is revealed , and a prediction for the label yt ∈ { −1 , 1 } must be generated . The dimension d can be huge ( billions ) , but dt is usually tens or hundreds . Logistic regression is used in a huge portion of existing learning problems . It can be used to predict medical risk factors , to predict world phenomena , stock market movements , or click-through-rate in online advertising . The online sparse setup is also very common to these application areas , particularly , if predictions need to be streamed in real time as the model keeps updating from newly seen examples . A prediction algorithm attempts to maximize probabilities of the observed labels . Online methods sequentially learn parameters for the d features . With stochastic gradient methods ( Bottou , 2010 ; Duchi et al. , 2011 ) , these are weights wi , t associated with feature i ∈ { 1 , · · · , d } at round t. Bayesian methods keep track of some distribution over the parameters , and assign an expected mixture probability to the generated prediction ( Hoffman et al. , 2010 ; Opper & Winther , 1998 ) . The overall objective is to maximize a sequence likelihood probability , or to minimize its negative logarithm . A benchmark measure of an algorithm ’ s performance is its regret , the excess loss it attains over an algorithm that uses some fixed comparator values of w∗ 4 = ( w1 , w2 , . . . , wd ) T ( T denoting transpose ) . A comparator w∗ that minimizes the cumulative loss can be picked to measure the regret relative to the best possible comparator in some space of parameter values . Kakade & Ng ( 2005 ) ; Foster et al . ( 2018 ) ; Shamir ( 2020 ) demonstrated that , in theory , Bayesian methods are capable to achieve regret , logarithmic with the horizon T and linear with d , that even matches regret lower bounds for d = o ( T ) . Classical stochastic gradient methods are usually implemented as proper learning algorithms , that determine wt prior to observing xt , and are inferior in the worst-case ( Hazan et al. , 2014 ) , although , in many cases depending on the data , they can still achieve logarithmic regret ( Bach , 2010 ; 2014 ; Bach & Moulines , 2013 ) . Recent work ( Jézéquel et al. , 2020 ) demonstrated non-Bayesian improper gradient based algorithms with better regret . Unfortunately , superiority of Bayesian methods diminishes by their intractability . A theoretically optimal prior has a diagonal covariance matrix , with each component either uniformly or Normally distributed with large variance . Effects of such a prior can not be maintained in practical online problems with a large sparse feature set , as the posterior of such a prior no longer has the properties of the prior , but must be maintained as a subsequent prior . Gaussian approximations that rely on diagonalization of the covariance must be used . Neither normal nor the diagonal assumptions are true for the real posterior ( even with diagonal prior ) . They thus lead to performance degradations . Diagonalization is similar to linearization in convex optimization , specifically for stochastic gradient descent ( SGD ) ( Zinkevich , 2003 ) . It allows handling features independently , but limits performance . Bayesian learning literature focused on applying such methods to predict posterior probabilities , and provide model ( epistemic ) uncertainty measurements ( Bishop , 2006 ; Dempster , 1968 ; Huelsenbeck & Ronquist , 2001 ; Knill & Richards , 1996 ) . However , uncertainty of a feature is , in fact , mostly a function of the number of examples in which it was present ; a measure that can be tracked , not estimated . Methods , such as Variational Bayesian ( VB ) Inference ( Bishop , 2006 ; Blei et al. , 2017 ; Drugowitsch , 2019 ; Drugowitsch et al. , 2019 ; Ranganath et al. , 2014 ) , track such measurements by matching the posterior . However , as demonstrated in Rissanen ( 1984 ) seminal work , minimizing regret is identical to uncertainty reduction , as regret is merely a different representation of uncertainty . Regret can be universally minimized over the possible parameter space through a good choice of a prior . Hence , to minimize uncertainty , the role of an approximation is to preserve the effect of such a prior at least in the region of the distribution that dominates the ultimate posterior at the horizon T . This is a simpler problem than matching the posterior , and opens possibilities for simpler approximations that can lead to results identical to those of heavy methods as VB . VB methods are typically used offline to match a tractable posterior to the true one by upper bounding overall loss . They are computationally involved , requiring either iterative techniques ( Bishop , 2006 ; Blei et al. , 2017 ; Murphy , 2012 ) like Expectation Maximization ( EM ) ( Dempster et al. , 1977 ; Moon , 1996 ) ; or Monte Carlo ( MC ) sampling , replacing analytical expectation by an empirical one over a randomly drawn set . To converge , MC can be combined with gradient descent , either requiring heavy computations , or adapting stochastic gradient methods to update posteriors ( Broderick et al. , 2013 ; Knowles , 2015 ; Nguyen et al. , 2017a ; b ) . For online problems , the posterior of an example is the prior of the subsequent one . To minimize losses , online VB must converge to the optimal approximation at every example . Otherwise , additional losses may be incurred , as the algorithm may not converge at each example , while the target posterior keeps moving with subsequent examples . Moreover , combining methods that need to tune hyper-parameters defeats the parameter free nature ( Abdellaoui , 2000 ; Mcmahan & Streeter , 2012 ; Orabona & Pál , 2016 ) of Bayesian methods . Most Bayesian literature addressed the dense problem , where xt consists of mostly nonzero entries for every t , and the dimension d of the feature space is relatively small . Techniques , like Gaussian Mixtures ( Herbrich et al. , 2003 ; Montuelle et al. , 2013 ; 2014 ; Rasmussen , 2000 ; Reynolds et al. , 2000 ; Sung , 2004 ) , that may use VB , usually apply matrix computations quadratic in d on the covariance matrix . In many practical problems , however , a very small feature subset is present in each example . For categorical features , only one of the features in the vector is present at any example . Techniques , useful for the low dimensional dense problem , may thus not be practical . Paper Contributions : We provide a simple analytical Bayesian method for online sparse logistic and probit regressions with closed form updates . We generalize the method also for dense multidimensional updates , if the problem is not completely sparse . Our results are first to study regret for Bayesian methods that are simple enough to be applied in practice . They provide an example to the connection between uncertainty and regret , and more broadly the Minimum Description Length ( MDL ) principle ( Grunwald , 2007 ; Rissanen , 1978a ; b ; 1984 ; 1986 ; Shamir , 2015 ; 2020 ) . Empirical results demonstrate the advantages of our method over computationally involved methods and over other simpler approximations , both by achieving better regret and better loss on real data . As part of the algorithm , uncertainty measures are provided with no added complexity . We specifically demonstrate that it is sufficient to have an approximation focus on the location of the peak of the posterior and its curvature or value , which are most likely to dominate regret , instead of approximating the full posterior , which brings unnecessary complexity missing the real goal of preserving the effects of a good prior . In fact , approximating the full posterior may eventually lead to poor generalization and overfitting by focusing too much on the tails of the posterior . Our approach directly approximates the posterior , unlike VB methods that approximate by minimizing an upper bound on the loss . Finally , our approach leverages sparsity to solve a sparse problem . Related Work : The simplest single dimensional online logistic regression problem ( d = 1 and x1 , t = 1 , ∀t ) was widely studied . Jefferys ’ prior , ρ ( θ ) 4 = 1/ ( π √ θ ( 1− θ ) ) , is asymptotically optimal ( Clarke & Barron , 1994 ; Xie & Barron , 1997 ; 2000 ; Drmota & Szpankowski. , 2004 ) ) . It can be expressed in terms of log-odds weights w as ρ ( w ) = ew/2/ [ π ( 1 + ew ) ] . Applying a mixture leads to the Krichevsky & Trofimov ( 1981 ) ( KT ) add-1/2 estimator Q ( yt|yt−1 ) = [ nt−1 ( yt ) + 0.5 ] /t , where nt−1 ( yt ) counts occurrences of yt . We use yt to express a sequence from 1 to t. Applying this prior in a Follow The Regularized Leader ( FTRL ) setting ( McMahan , 2011 ) also leads to the KT estimator . This raised the question whether regret optimality generalizes to large dimensions ( McMahan & Streeter , 2012 ) . Hazan et al . ( 2014 ) showed that this was not the case for proper methods . The bounds , however , theoretically generalize for Bayesian methods ( Kakade & Ng , 2005 ; Foster et al. , 2018 ; Shamir , 2020 ) , with large variance Gaussian or uniform prior with diagonal covariance . Peaked priors fail , as for each feature in an example , other features provide a self excluding log-odds prior , that shifts the relation between the overall distribution and the feature weight . While wide priors are good theoretically , because of the intractability of the Bayesian mixture integrals , diagonal approximations that are used unfortunately degrade their effect . Bayesian methods have been studied extensively for estimating posteriors and uncertainty ( Bishop , 2006 ; Makowski et al. , 2002 ; Sen & Stoffa , 1996 ) . There is ample literature researching such techniques in deep networks ( see , e.g. , Blundell et al . ( 2015 ) ; Hwang et al . ( 2020 ) ; Kendall & Gal ( 2017 ) ; Lakshminarayanan et al . ( 2017 ) ; Malinin & Gales ( 2018 ) ; Wilson ( 2020 ) ) . Most of the work focuses on the ultimate posterior after the full training dataset has been visited . One attempts to leverage the uncertainty measurements to aid in inference on unseen examples . Techniques like expectation propagation ( EP ) ( Minka , 2001 ; 2013 ) ( see also Bishop ( 2006 ) ; Chu et al . ( 2011 ) ; Cunningham et al . ( 2011 ) ; Graepel et al . ( 2010 ) ) and VB are used to generate estimates of the posterior . In a dense setup , where there is a relatively small number features ( or units in a deep network ) , Gaussian Mixture models can also be learned , where a jointly Gaussian posterior is learned , usually with some kernel that is used to reduce the dimensionality of the parameters that are actually being trained . Such methods , however , do not fit the sparse online setup . Variational methods are derived utilizing Jensen ’ s inequality to upper bound loss of expectation by expectation of the negative logarithm of the product of the prior ρ ( w ) and data likelihood P ( yT |xT , w ) . Normalizing this joint by the expected label sequence probability gives the posterior P ( w|xT , yT ) . Then , a posterior Q ( · ) with a desired form is matched by minimizing the KL divergence KL ( Q||P ) , which decomposes into expectation w.r.t . Q ( ) ̇ over the loss on yT and KL ( Q||ρ ) between the approximated posterior and the true prior . The first term may require techniques like the iterative mean field approximation EM ( Bishop , 2006 ; Jaakkola & Jordan , 1998 ) , or MC sampling to be approximated . Gradient methods can also minimize KL ( Q||P ) . In the sparse setup , it is standard to assume a diagonal Q ( · ) . In an online setting , the process can be iterated over the examples ( or mini-batches ) , where the posterior at t is the prior at t+ 1 . Computing the approximate posterior may be very expensive if done for every example . SGD can be used with MC sampling , but that would incur additional losses , as the posterior changes between successive examples . Like VB , EP minimizes the opposite divergence KL ( P ||Q ) between the posterior and its approximate .
The paper proposes an algorithm for learning the parameters of a logistic regression model in an online setting. The proposed algorithm is based on two approximations: the posterior at iteration t over the model parameters is assumed to be multivariate Gaussian distribution with a diagonal covariance matrix and the logistic/sigmoid function is approximated by the CDF of the normal distribution. The numerical results show the usefulness of the proposed algorithm.
SP:7f9f0d2f54a3f42cceb03d9fce97dd36fd78fb6a
Low Complexity Approximate Bayesian Logistic Regression for Sparse Online Learning
1 INTRODUCTION . We consider online ( Bottou , 1998 ; Shalev-Shwartz et al. , 2011 ) binary logistic regression over a series of rounds t ∈ { 1 , 2 , . . . , T } . At round t , a sparse feature vector xt ∈ [ −1 , 1 ] d with dt d nonzero values , is revealed , and a prediction for the label yt ∈ { −1 , 1 } must be generated . The dimension d can be huge ( billions ) , but dt is usually tens or hundreds . Logistic regression is used in a huge portion of existing learning problems . It can be used to predict medical risk factors , to predict world phenomena , stock market movements , or click-through-rate in online advertising . The online sparse setup is also very common to these application areas , particularly , if predictions need to be streamed in real time as the model keeps updating from newly seen examples . A prediction algorithm attempts to maximize probabilities of the observed labels . Online methods sequentially learn parameters for the d features . With stochastic gradient methods ( Bottou , 2010 ; Duchi et al. , 2011 ) , these are weights wi , t associated with feature i ∈ { 1 , · · · , d } at round t. Bayesian methods keep track of some distribution over the parameters , and assign an expected mixture probability to the generated prediction ( Hoffman et al. , 2010 ; Opper & Winther , 1998 ) . The overall objective is to maximize a sequence likelihood probability , or to minimize its negative logarithm . A benchmark measure of an algorithm ’ s performance is its regret , the excess loss it attains over an algorithm that uses some fixed comparator values of w∗ 4 = ( w1 , w2 , . . . , wd ) T ( T denoting transpose ) . A comparator w∗ that minimizes the cumulative loss can be picked to measure the regret relative to the best possible comparator in some space of parameter values . Kakade & Ng ( 2005 ) ; Foster et al . ( 2018 ) ; Shamir ( 2020 ) demonstrated that , in theory , Bayesian methods are capable to achieve regret , logarithmic with the horizon T and linear with d , that even matches regret lower bounds for d = o ( T ) . Classical stochastic gradient methods are usually implemented as proper learning algorithms , that determine wt prior to observing xt , and are inferior in the worst-case ( Hazan et al. , 2014 ) , although , in many cases depending on the data , they can still achieve logarithmic regret ( Bach , 2010 ; 2014 ; Bach & Moulines , 2013 ) . Recent work ( Jézéquel et al. , 2020 ) demonstrated non-Bayesian improper gradient based algorithms with better regret . Unfortunately , superiority of Bayesian methods diminishes by their intractability . A theoretically optimal prior has a diagonal covariance matrix , with each component either uniformly or Normally distributed with large variance . Effects of such a prior can not be maintained in practical online problems with a large sparse feature set , as the posterior of such a prior no longer has the properties of the prior , but must be maintained as a subsequent prior . Gaussian approximations that rely on diagonalization of the covariance must be used . Neither normal nor the diagonal assumptions are true for the real posterior ( even with diagonal prior ) . They thus lead to performance degradations . Diagonalization is similar to linearization in convex optimization , specifically for stochastic gradient descent ( SGD ) ( Zinkevich , 2003 ) . It allows handling features independently , but limits performance . Bayesian learning literature focused on applying such methods to predict posterior probabilities , and provide model ( epistemic ) uncertainty measurements ( Bishop , 2006 ; Dempster , 1968 ; Huelsenbeck & Ronquist , 2001 ; Knill & Richards , 1996 ) . However , uncertainty of a feature is , in fact , mostly a function of the number of examples in which it was present ; a measure that can be tracked , not estimated . Methods , such as Variational Bayesian ( VB ) Inference ( Bishop , 2006 ; Blei et al. , 2017 ; Drugowitsch , 2019 ; Drugowitsch et al. , 2019 ; Ranganath et al. , 2014 ) , track such measurements by matching the posterior . However , as demonstrated in Rissanen ( 1984 ) seminal work , minimizing regret is identical to uncertainty reduction , as regret is merely a different representation of uncertainty . Regret can be universally minimized over the possible parameter space through a good choice of a prior . Hence , to minimize uncertainty , the role of an approximation is to preserve the effect of such a prior at least in the region of the distribution that dominates the ultimate posterior at the horizon T . This is a simpler problem than matching the posterior , and opens possibilities for simpler approximations that can lead to results identical to those of heavy methods as VB . VB methods are typically used offline to match a tractable posterior to the true one by upper bounding overall loss . They are computationally involved , requiring either iterative techniques ( Bishop , 2006 ; Blei et al. , 2017 ; Murphy , 2012 ) like Expectation Maximization ( EM ) ( Dempster et al. , 1977 ; Moon , 1996 ) ; or Monte Carlo ( MC ) sampling , replacing analytical expectation by an empirical one over a randomly drawn set . To converge , MC can be combined with gradient descent , either requiring heavy computations , or adapting stochastic gradient methods to update posteriors ( Broderick et al. , 2013 ; Knowles , 2015 ; Nguyen et al. , 2017a ; b ) . For online problems , the posterior of an example is the prior of the subsequent one . To minimize losses , online VB must converge to the optimal approximation at every example . Otherwise , additional losses may be incurred , as the algorithm may not converge at each example , while the target posterior keeps moving with subsequent examples . Moreover , combining methods that need to tune hyper-parameters defeats the parameter free nature ( Abdellaoui , 2000 ; Mcmahan & Streeter , 2012 ; Orabona & Pál , 2016 ) of Bayesian methods . Most Bayesian literature addressed the dense problem , where xt consists of mostly nonzero entries for every t , and the dimension d of the feature space is relatively small . Techniques , like Gaussian Mixtures ( Herbrich et al. , 2003 ; Montuelle et al. , 2013 ; 2014 ; Rasmussen , 2000 ; Reynolds et al. , 2000 ; Sung , 2004 ) , that may use VB , usually apply matrix computations quadratic in d on the covariance matrix . In many practical problems , however , a very small feature subset is present in each example . For categorical features , only one of the features in the vector is present at any example . Techniques , useful for the low dimensional dense problem , may thus not be practical . Paper Contributions : We provide a simple analytical Bayesian method for online sparse logistic and probit regressions with closed form updates . We generalize the method also for dense multidimensional updates , if the problem is not completely sparse . Our results are first to study regret for Bayesian methods that are simple enough to be applied in practice . They provide an example to the connection between uncertainty and regret , and more broadly the Minimum Description Length ( MDL ) principle ( Grunwald , 2007 ; Rissanen , 1978a ; b ; 1984 ; 1986 ; Shamir , 2015 ; 2020 ) . Empirical results demonstrate the advantages of our method over computationally involved methods and over other simpler approximations , both by achieving better regret and better loss on real data . As part of the algorithm , uncertainty measures are provided with no added complexity . We specifically demonstrate that it is sufficient to have an approximation focus on the location of the peak of the posterior and its curvature or value , which are most likely to dominate regret , instead of approximating the full posterior , which brings unnecessary complexity missing the real goal of preserving the effects of a good prior . In fact , approximating the full posterior may eventually lead to poor generalization and overfitting by focusing too much on the tails of the posterior . Our approach directly approximates the posterior , unlike VB methods that approximate by minimizing an upper bound on the loss . Finally , our approach leverages sparsity to solve a sparse problem . Related Work : The simplest single dimensional online logistic regression problem ( d = 1 and x1 , t = 1 , ∀t ) was widely studied . Jefferys ’ prior , ρ ( θ ) 4 = 1/ ( π √ θ ( 1− θ ) ) , is asymptotically optimal ( Clarke & Barron , 1994 ; Xie & Barron , 1997 ; 2000 ; Drmota & Szpankowski. , 2004 ) ) . It can be expressed in terms of log-odds weights w as ρ ( w ) = ew/2/ [ π ( 1 + ew ) ] . Applying a mixture leads to the Krichevsky & Trofimov ( 1981 ) ( KT ) add-1/2 estimator Q ( yt|yt−1 ) = [ nt−1 ( yt ) + 0.5 ] /t , where nt−1 ( yt ) counts occurrences of yt . We use yt to express a sequence from 1 to t. Applying this prior in a Follow The Regularized Leader ( FTRL ) setting ( McMahan , 2011 ) also leads to the KT estimator . This raised the question whether regret optimality generalizes to large dimensions ( McMahan & Streeter , 2012 ) . Hazan et al . ( 2014 ) showed that this was not the case for proper methods . The bounds , however , theoretically generalize for Bayesian methods ( Kakade & Ng , 2005 ; Foster et al. , 2018 ; Shamir , 2020 ) , with large variance Gaussian or uniform prior with diagonal covariance . Peaked priors fail , as for each feature in an example , other features provide a self excluding log-odds prior , that shifts the relation between the overall distribution and the feature weight . While wide priors are good theoretically , because of the intractability of the Bayesian mixture integrals , diagonal approximations that are used unfortunately degrade their effect . Bayesian methods have been studied extensively for estimating posteriors and uncertainty ( Bishop , 2006 ; Makowski et al. , 2002 ; Sen & Stoffa , 1996 ) . There is ample literature researching such techniques in deep networks ( see , e.g. , Blundell et al . ( 2015 ) ; Hwang et al . ( 2020 ) ; Kendall & Gal ( 2017 ) ; Lakshminarayanan et al . ( 2017 ) ; Malinin & Gales ( 2018 ) ; Wilson ( 2020 ) ) . Most of the work focuses on the ultimate posterior after the full training dataset has been visited . One attempts to leverage the uncertainty measurements to aid in inference on unseen examples . Techniques like expectation propagation ( EP ) ( Minka , 2001 ; 2013 ) ( see also Bishop ( 2006 ) ; Chu et al . ( 2011 ) ; Cunningham et al . ( 2011 ) ; Graepel et al . ( 2010 ) ) and VB are used to generate estimates of the posterior . In a dense setup , where there is a relatively small number features ( or units in a deep network ) , Gaussian Mixture models can also be learned , where a jointly Gaussian posterior is learned , usually with some kernel that is used to reduce the dimensionality of the parameters that are actually being trained . Such methods , however , do not fit the sparse online setup . Variational methods are derived utilizing Jensen ’ s inequality to upper bound loss of expectation by expectation of the negative logarithm of the product of the prior ρ ( w ) and data likelihood P ( yT |xT , w ) . Normalizing this joint by the expected label sequence probability gives the posterior P ( w|xT , yT ) . Then , a posterior Q ( · ) with a desired form is matched by minimizing the KL divergence KL ( Q||P ) , which decomposes into expectation w.r.t . Q ( ) ̇ over the loss on yT and KL ( Q||ρ ) between the approximated posterior and the true prior . The first term may require techniques like the iterative mean field approximation EM ( Bishop , 2006 ; Jaakkola & Jordan , 1998 ) , or MC sampling to be approximated . Gradient methods can also minimize KL ( Q||P ) . In the sparse setup , it is standard to assume a diagonal Q ( · ) . In an online setting , the process can be iterated over the examples ( or mini-batches ) , where the posterior at t is the prior at t+ 1 . Computing the approximate posterior may be very expensive if done for every example . SGD can be used with MC sampling , but that would incur additional losses , as the posterior changes between successive examples . Like VB , EP minimizes the opposite divergence KL ( P ||Q ) between the posterior and its approximate .
The authors propose a low complexity approximation method with closed analytic forms for doing logistic regression in the sparse, online setting. They first introduce the marginalized bayesian gaussian approximation approach, which essentially replaces the sigmoidal with a gaussian. They then give approximate expressions for the prediction and marginalization terms, as well as ways to approximate/update the posterior.
SP:7f9f0d2f54a3f42cceb03d9fce97dd36fd78fb6a
Discriminative Cross-Modal Data Augmentation for Medical Imaging Applications
While deep learning methods have shown great success in medical image analysis , they require a number of medical images to train . Due to data privacy concerns and unavailability of medical annotators , it is oftentimes very difficult to obtain a lot of labeled medical images for model training . In this paper , we study crossmodality data augmentation to mitigate the data deficiency issue in the medical imaging domain . We propose a discriminative unpaired image-to-image translation model which translates images in source modality into images in target modality where the translation task is conducted jointly with the downstream prediction task and the translation is guided by the prediction . Experiments on two applications demonstrate the effectiveness of our method . 1 INTRODUCTION . Developing deep learning methods to analyze medical images for decision-making has aroused much research interest in the past few years . Promising results have been achieved in using medical images for skin cancer diagnosis ( Esteva et al. , 2017 ; Tschandl et al. , 2019 ) , chest diseases identification ( Jaiswal et al. , 2019 ) , diabetic eye disease detection ( Cheung et al. , 2019 ) , to name a few . It is well-known that deep learning methods are data-hungry . Deep learning models typically contain tens of millions of weight parameters . To effectively train such large-sized models , a large number of labeled training images are needed . However , in the medical domain , it is very difficult to collect labeled training images due to many reasons including privacy barriers , unavailability of doctors for annotating disease labels , etc . To address the deficiency of medical images , many approaches ( Krizhevsky et al. , 2012 ; Cubuk et al. , 2018 ; Takahashi et al. , 2019 ; Zhong et al. , 2017 ; Perez & Wang , 2017 ) have been proposed for data augmentation . These approaches create synthetic images based on the original images and use the synthetic images as additional training data . The most commonly used data augmentation approaches include crop , flip , rotation , translation , scaling , etc . Augmented images created by these methods are oftentimes very similar to the original images . For example , a cropped image is part of the original image . In clinical practice , due to the large disparity among patients , the medical image of a new patient ( during test time ) is oftentimes very different from the images of patients used for model training . If the augmented images are very close to the original images , they are not very useful in improving the ability of the model to generalize to unseen patients . It is important to create diverse augmented images that are non-redundant with the original images . To create non-redundant augmented images for one modality such as CT , one possible solution is to leverage images from other modalities such as X-ray , MRI , PET , etc . In clinical practice , for the same disease , many different types of imaging techniques are applied to diagnose and treat this disease . For example , to diagnose lung cancer , doctors can use chest X-rays , CT scans , MRI scans , to name a few . As a result , different modalities of medical images are accumulated for the same disease . When training a deep learning model on an interested modality ( denoted by X ) of images , if the number of original images in this modality is small , we may convert the images in other modalities into the target modality X and use these converted images as additional training data . For example , when a hospital would like to train a deep learning model for CT-based lung cancer diagnosis , the hospital can collect MRI , X-ray , PET images about lung cancer and use them to augment the CT training dataset . Images of different modalities are typically from different patients . Therefore , their clinical diversity is large . This motivates us to study cross-modality data augmentation to address the data deficiency issue in training deep learning models for medical image based clinical decision-making . The problem setup is as follows . The goal is to train a deep learning model to diagnose diseaseD based on one modality ( denoted by X ) of medical images . However , the number of images in this modality is limited , which are not sufficient to train effective models . Meanwhile , there is another modality ( denoted by Y ) of medical images used for diagnosing disease D. Cross-modality data augmentation refers to leveraging the images in Y to augment the training set in X . Specifically , we translate images in Y into images that have a similar style as those in X and add the translated images together with their disease labels into the training dataset in X . Compared with simple augmentation such as cropping , scaling , rotation , cross-modality data augmentation can bring in more diversity since the images in different modalities are from different patients and hence are clinically more heterogeneous . More diverse augmented images are more valuable in improving the generalization ability of the model to unseen patients . To perform cross-modality data augmentation , we propose a discriminative unpaired image-toimage translation ( DUIIT ) method . Given images in a source modality , we translate them into images in a target modality . The translated images , together with their associated disease labels , are added to the training set in the target modality to train the predictive model . Different from unsupervised translation methods such as CycleGAN ( Zhu et al. , 2017a ) which perform the translation between images without considering their disease labels , our method conducts the translation in a discriminative way , where the translation is guided by the predictive task . Our model performs cross-modality image translation and predictive modeling simultaneously , to enable these two tasks to mutually benefit each other . The translated images are not only aimed to have similar style as those in the target modality , but also are targeted to be useful in training the predictive model . Our model consists of two modules : a translator and a predictor . The translator transforms the images in the source modality into synthesized images in the target modality . Then the translated images ( together with their class labels ) are combined with the images in the target modality to train the predictor . The predictor takes an image as input and predicts the class label . The two modules are trained jointly so that the translator is learned to generate target images that are effective in training the predictor . We apply our method to two medical imaging applications . In the first application , the source modality is MRI and the target modality is CT. Our method translates MRI images into CTs in a discriminative way and uses the combination of original CTs and translated CTs to train the predictive model , which achieves substantially lower prediction error compared with using original CTs only . In the second application , the source modality is PET and the target modality is CT. By translating PET images to CTs , our method significantly improves prediction performance . The major contributions of this paper include : • We propose a discriminative unpaired image-to-image translation method to translate medical images from the source modality to the target modality to augment the training data in the target modality . The translation is guided by the predictive task . • On two applications , we demonstrate the effectiveness of our method . The rest of the paper is organized as follows . Section 2 reviews related works . Section 3 and 4 present the methods and experiments . Section 5 concludes the paper . 2 RELATED WORKS . 2.1 MEDICAL IMAGE SYNTHESIS . Several attempts have been made to synthesize medical images . Frid-Adar et al . ( 2018 ) combine three DCGANs ( Radford et al. , 2015 ) to generate synthetic medical images , which are used for data augmentation and lesion classification . Jin et al . ( 2018 ) develop a 3D GAN to learn lung nodule properties in the 3D space . The 3D GAN is conditioned on a volume of interest whose central part containing nodules has been erased . GANs are also used for generating segmentation maps ( Guibas et al. , 2017 ) where a two stage pipeline is applied . Mok & Chung ( 2018 ) apply conditional GANs ( Mirza & Osindero , 2014 ; Odena et al. , 2017 ) to synthesize brain MRI images in a coarse-to-fine manner , for brain tumour segmentation . To reserve fine-grained details of the tumor core , they encourage the generator to delineate tumor boundaries . Cross-modality translation has been studied to synthesize medical images . In Wolterink et al . ( 2017 ) , it is found that using unpaired medical images for augmentation is better than using aligned medical images . Chartsias et al . ( 2017 ) apply CycleGAN for generating synthetic multi-modal cardiac data . Zhang et al . ( 2018 ) combine the synthetic data translated from other modalities with real data for segmenting multimodal medical volumes . A shape-consistency loss is used to reduce geometric distortion . 2.2 IMAGE GENERATION . Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ; Radford et al. , 2015 ; Arjovsky et al. , 2017 ) have been widely used for image generation from random vectors . Conditional GANs ( Mirza & Osindero , 2014 ; Odena et al. , 2017 ) generates images from class labels . Image-toimage translation ( Isola et al. , 2016 ; Wang et al. , 2018 ; Zhu et al. , 2017a ) studies how to generate one image ( set ) from another ( set ) based on GANs . A number of works have been devoted to generating images from texts . Mansimov et al . ( 2015 ) propose an encoder-decoder architecture for text-toimage generation . The encoder of text and the decoder of image are both based on recurrent networks . Attention is used between image patches and words . AttnGAN ( Xu et al. , 2018 ) synthesizes fine-grained details at different subregions of the image by paying attention to the relevant words in the natural language description . DM-GAN ( Zhu et al. , 2019 ) uses a dynamic memory module to refine fuzzy image contents , when the initial images are not well generated , and designs a memory writing gate to select the important text information . Obj-GAN ( Li et al. , 2019 ) proposes an objectdriven attentive image generator to synthesize salient objects by paying attention to the most relevant words in the text description and the pre-generated semantic layout . MirrorGAN ( Qiao et al. , 2019 ) uses an autoencoder architecture , which generates an image from a text , then reconstructs the text from the image . Many techniques have been proposed to improve the fidelity of generated images by GANs . Brock et al . ( 2018 ) demonstrate that GANs benefit remarkably from scaling : increasing model size and minibatch size improves the fidelity of generated images . To generate images with higher resolution , the progressive technique used in PGGAN ( Karras et al. , 2017 ) has been widely adopted . StackGAN ( Zhang et al. , 2017 ) first uses a GAN to generate low-resolution images , which are then fed into another GAN to generate high-resolution images . 2.3 IMAGE AUGMENTATION . Image augmentation is a widely used technique to enlarge the training dataset and alleviate overfitting . Basic augmentation methods ( Krizhevsky et al. , 2012 ) include geometric and color transformations , such as crop , flip , rotation , translation , scale , color jitter , contrast , etc . Cubuk et al . ( 2018 ) propose a reinforcement learning based algorithm to automatically search for augmentation policies . Takahashi et al . ( 2019 ) propose to randomly crop four images and patch them to create a new training image . Zhong et al . ( 2017 ) propose Random Erasing which assigns random values to pixels in randomly-sampled rectangle regions , to generate augmented images with different occlusion levels . Perez & Wang ( 2017 ) design two methods for data augmentation . One is using GAN to synthesize new images with different styles . The other is training an augmentation network for generating augmented data . Zhao et al . ( 2020 ) propose DiffAugment that can improve the sample efficiency of training GANs . This method applies the same differentiable augmentation to both real and fake images when training the generator and discriminator .
The authors propose an algorithm to enlarge the training set for image classification problems in certain medical applications where training data of the target modality is scarce. They do so by training an unpaired image-to-image translator network and an image classifier end-to-end in order to utilize labeled images acquired through various imaging modalities. Moreover, they demonstrate the effectiveness of the proposed algorithm via extensive numerical experiments on a prediction problem and compare their method to several different approaches ranging from transfer learning to data augmentation.
SP:2c70c132373daf3644f009748f343decdc4886ba
Discriminative Cross-Modal Data Augmentation for Medical Imaging Applications
While deep learning methods have shown great success in medical image analysis , they require a number of medical images to train . Due to data privacy concerns and unavailability of medical annotators , it is oftentimes very difficult to obtain a lot of labeled medical images for model training . In this paper , we study crossmodality data augmentation to mitigate the data deficiency issue in the medical imaging domain . We propose a discriminative unpaired image-to-image translation model which translates images in source modality into images in target modality where the translation task is conducted jointly with the downstream prediction task and the translation is guided by the prediction . Experiments on two applications demonstrate the effectiveness of our method . 1 INTRODUCTION . Developing deep learning methods to analyze medical images for decision-making has aroused much research interest in the past few years . Promising results have been achieved in using medical images for skin cancer diagnosis ( Esteva et al. , 2017 ; Tschandl et al. , 2019 ) , chest diseases identification ( Jaiswal et al. , 2019 ) , diabetic eye disease detection ( Cheung et al. , 2019 ) , to name a few . It is well-known that deep learning methods are data-hungry . Deep learning models typically contain tens of millions of weight parameters . To effectively train such large-sized models , a large number of labeled training images are needed . However , in the medical domain , it is very difficult to collect labeled training images due to many reasons including privacy barriers , unavailability of doctors for annotating disease labels , etc . To address the deficiency of medical images , many approaches ( Krizhevsky et al. , 2012 ; Cubuk et al. , 2018 ; Takahashi et al. , 2019 ; Zhong et al. , 2017 ; Perez & Wang , 2017 ) have been proposed for data augmentation . These approaches create synthetic images based on the original images and use the synthetic images as additional training data . The most commonly used data augmentation approaches include crop , flip , rotation , translation , scaling , etc . Augmented images created by these methods are oftentimes very similar to the original images . For example , a cropped image is part of the original image . In clinical practice , due to the large disparity among patients , the medical image of a new patient ( during test time ) is oftentimes very different from the images of patients used for model training . If the augmented images are very close to the original images , they are not very useful in improving the ability of the model to generalize to unseen patients . It is important to create diverse augmented images that are non-redundant with the original images . To create non-redundant augmented images for one modality such as CT , one possible solution is to leverage images from other modalities such as X-ray , MRI , PET , etc . In clinical practice , for the same disease , many different types of imaging techniques are applied to diagnose and treat this disease . For example , to diagnose lung cancer , doctors can use chest X-rays , CT scans , MRI scans , to name a few . As a result , different modalities of medical images are accumulated for the same disease . When training a deep learning model on an interested modality ( denoted by X ) of images , if the number of original images in this modality is small , we may convert the images in other modalities into the target modality X and use these converted images as additional training data . For example , when a hospital would like to train a deep learning model for CT-based lung cancer diagnosis , the hospital can collect MRI , X-ray , PET images about lung cancer and use them to augment the CT training dataset . Images of different modalities are typically from different patients . Therefore , their clinical diversity is large . This motivates us to study cross-modality data augmentation to address the data deficiency issue in training deep learning models for medical image based clinical decision-making . The problem setup is as follows . The goal is to train a deep learning model to diagnose diseaseD based on one modality ( denoted by X ) of medical images . However , the number of images in this modality is limited , which are not sufficient to train effective models . Meanwhile , there is another modality ( denoted by Y ) of medical images used for diagnosing disease D. Cross-modality data augmentation refers to leveraging the images in Y to augment the training set in X . Specifically , we translate images in Y into images that have a similar style as those in X and add the translated images together with their disease labels into the training dataset in X . Compared with simple augmentation such as cropping , scaling , rotation , cross-modality data augmentation can bring in more diversity since the images in different modalities are from different patients and hence are clinically more heterogeneous . More diverse augmented images are more valuable in improving the generalization ability of the model to unseen patients . To perform cross-modality data augmentation , we propose a discriminative unpaired image-toimage translation ( DUIIT ) method . Given images in a source modality , we translate them into images in a target modality . The translated images , together with their associated disease labels , are added to the training set in the target modality to train the predictive model . Different from unsupervised translation methods such as CycleGAN ( Zhu et al. , 2017a ) which perform the translation between images without considering their disease labels , our method conducts the translation in a discriminative way , where the translation is guided by the predictive task . Our model performs cross-modality image translation and predictive modeling simultaneously , to enable these two tasks to mutually benefit each other . The translated images are not only aimed to have similar style as those in the target modality , but also are targeted to be useful in training the predictive model . Our model consists of two modules : a translator and a predictor . The translator transforms the images in the source modality into synthesized images in the target modality . Then the translated images ( together with their class labels ) are combined with the images in the target modality to train the predictor . The predictor takes an image as input and predicts the class label . The two modules are trained jointly so that the translator is learned to generate target images that are effective in training the predictor . We apply our method to two medical imaging applications . In the first application , the source modality is MRI and the target modality is CT. Our method translates MRI images into CTs in a discriminative way and uses the combination of original CTs and translated CTs to train the predictive model , which achieves substantially lower prediction error compared with using original CTs only . In the second application , the source modality is PET and the target modality is CT. By translating PET images to CTs , our method significantly improves prediction performance . The major contributions of this paper include : • We propose a discriminative unpaired image-to-image translation method to translate medical images from the source modality to the target modality to augment the training data in the target modality . The translation is guided by the predictive task . • On two applications , we demonstrate the effectiveness of our method . The rest of the paper is organized as follows . Section 2 reviews related works . Section 3 and 4 present the methods and experiments . Section 5 concludes the paper . 2 RELATED WORKS . 2.1 MEDICAL IMAGE SYNTHESIS . Several attempts have been made to synthesize medical images . Frid-Adar et al . ( 2018 ) combine three DCGANs ( Radford et al. , 2015 ) to generate synthetic medical images , which are used for data augmentation and lesion classification . Jin et al . ( 2018 ) develop a 3D GAN to learn lung nodule properties in the 3D space . The 3D GAN is conditioned on a volume of interest whose central part containing nodules has been erased . GANs are also used for generating segmentation maps ( Guibas et al. , 2017 ) where a two stage pipeline is applied . Mok & Chung ( 2018 ) apply conditional GANs ( Mirza & Osindero , 2014 ; Odena et al. , 2017 ) to synthesize brain MRI images in a coarse-to-fine manner , for brain tumour segmentation . To reserve fine-grained details of the tumor core , they encourage the generator to delineate tumor boundaries . Cross-modality translation has been studied to synthesize medical images . In Wolterink et al . ( 2017 ) , it is found that using unpaired medical images for augmentation is better than using aligned medical images . Chartsias et al . ( 2017 ) apply CycleGAN for generating synthetic multi-modal cardiac data . Zhang et al . ( 2018 ) combine the synthetic data translated from other modalities with real data for segmenting multimodal medical volumes . A shape-consistency loss is used to reduce geometric distortion . 2.2 IMAGE GENERATION . Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ; Radford et al. , 2015 ; Arjovsky et al. , 2017 ) have been widely used for image generation from random vectors . Conditional GANs ( Mirza & Osindero , 2014 ; Odena et al. , 2017 ) generates images from class labels . Image-toimage translation ( Isola et al. , 2016 ; Wang et al. , 2018 ; Zhu et al. , 2017a ) studies how to generate one image ( set ) from another ( set ) based on GANs . A number of works have been devoted to generating images from texts . Mansimov et al . ( 2015 ) propose an encoder-decoder architecture for text-toimage generation . The encoder of text and the decoder of image are both based on recurrent networks . Attention is used between image patches and words . AttnGAN ( Xu et al. , 2018 ) synthesizes fine-grained details at different subregions of the image by paying attention to the relevant words in the natural language description . DM-GAN ( Zhu et al. , 2019 ) uses a dynamic memory module to refine fuzzy image contents , when the initial images are not well generated , and designs a memory writing gate to select the important text information . Obj-GAN ( Li et al. , 2019 ) proposes an objectdriven attentive image generator to synthesize salient objects by paying attention to the most relevant words in the text description and the pre-generated semantic layout . MirrorGAN ( Qiao et al. , 2019 ) uses an autoencoder architecture , which generates an image from a text , then reconstructs the text from the image . Many techniques have been proposed to improve the fidelity of generated images by GANs . Brock et al . ( 2018 ) demonstrate that GANs benefit remarkably from scaling : increasing model size and minibatch size improves the fidelity of generated images . To generate images with higher resolution , the progressive technique used in PGGAN ( Karras et al. , 2017 ) has been widely adopted . StackGAN ( Zhang et al. , 2017 ) first uses a GAN to generate low-resolution images , which are then fed into another GAN to generate high-resolution images . 2.3 IMAGE AUGMENTATION . Image augmentation is a widely used technique to enlarge the training dataset and alleviate overfitting . Basic augmentation methods ( Krizhevsky et al. , 2012 ) include geometric and color transformations , such as crop , flip , rotation , translation , scale , color jitter , contrast , etc . Cubuk et al . ( 2018 ) propose a reinforcement learning based algorithm to automatically search for augmentation policies . Takahashi et al . ( 2019 ) propose to randomly crop four images and patch them to create a new training image . Zhong et al . ( 2017 ) propose Random Erasing which assigns random values to pixels in randomly-sampled rectangle regions , to generate augmented images with different occlusion levels . Perez & Wang ( 2017 ) design two methods for data augmentation . One is using GAN to synthesize new images with different styles . The other is training an augmentation network for generating augmented data . Zhao et al . ( 2020 ) propose DiffAugment that can improve the sample efficiency of training GANs . This method applies the same differentiable augmentation to both real and fake images when training the generator and discriminator .
This paper studies the problem of learning a predictor from a specified modality using a dataset where each example has images from only one modality. The proposed approach is to set up a CycleGAN to translate between the modalities and a predictor from the required modality to the prediction target. The authors propose to learn the CycleGAN and the predictor parameters jointly. Experimental results show that this performs better than either not doing the translation at all (i.e. only learning the predictor from examples with the required modality) or learning the translation followed by learning the prediction.
SP:2c70c132373daf3644f009748f343decdc4886ba
Discriminative Cross-Modal Data Augmentation for Medical Imaging Applications
While deep learning methods have shown great success in medical image analysis , they require a number of medical images to train . Due to data privacy concerns and unavailability of medical annotators , it is oftentimes very difficult to obtain a lot of labeled medical images for model training . In this paper , we study crossmodality data augmentation to mitigate the data deficiency issue in the medical imaging domain . We propose a discriminative unpaired image-to-image translation model which translates images in source modality into images in target modality where the translation task is conducted jointly with the downstream prediction task and the translation is guided by the prediction . Experiments on two applications demonstrate the effectiveness of our method . 1 INTRODUCTION . Developing deep learning methods to analyze medical images for decision-making has aroused much research interest in the past few years . Promising results have been achieved in using medical images for skin cancer diagnosis ( Esteva et al. , 2017 ; Tschandl et al. , 2019 ) , chest diseases identification ( Jaiswal et al. , 2019 ) , diabetic eye disease detection ( Cheung et al. , 2019 ) , to name a few . It is well-known that deep learning methods are data-hungry . Deep learning models typically contain tens of millions of weight parameters . To effectively train such large-sized models , a large number of labeled training images are needed . However , in the medical domain , it is very difficult to collect labeled training images due to many reasons including privacy barriers , unavailability of doctors for annotating disease labels , etc . To address the deficiency of medical images , many approaches ( Krizhevsky et al. , 2012 ; Cubuk et al. , 2018 ; Takahashi et al. , 2019 ; Zhong et al. , 2017 ; Perez & Wang , 2017 ) have been proposed for data augmentation . These approaches create synthetic images based on the original images and use the synthetic images as additional training data . The most commonly used data augmentation approaches include crop , flip , rotation , translation , scaling , etc . Augmented images created by these methods are oftentimes very similar to the original images . For example , a cropped image is part of the original image . In clinical practice , due to the large disparity among patients , the medical image of a new patient ( during test time ) is oftentimes very different from the images of patients used for model training . If the augmented images are very close to the original images , they are not very useful in improving the ability of the model to generalize to unseen patients . It is important to create diverse augmented images that are non-redundant with the original images . To create non-redundant augmented images for one modality such as CT , one possible solution is to leverage images from other modalities such as X-ray , MRI , PET , etc . In clinical practice , for the same disease , many different types of imaging techniques are applied to diagnose and treat this disease . For example , to diagnose lung cancer , doctors can use chest X-rays , CT scans , MRI scans , to name a few . As a result , different modalities of medical images are accumulated for the same disease . When training a deep learning model on an interested modality ( denoted by X ) of images , if the number of original images in this modality is small , we may convert the images in other modalities into the target modality X and use these converted images as additional training data . For example , when a hospital would like to train a deep learning model for CT-based lung cancer diagnosis , the hospital can collect MRI , X-ray , PET images about lung cancer and use them to augment the CT training dataset . Images of different modalities are typically from different patients . Therefore , their clinical diversity is large . This motivates us to study cross-modality data augmentation to address the data deficiency issue in training deep learning models for medical image based clinical decision-making . The problem setup is as follows . The goal is to train a deep learning model to diagnose diseaseD based on one modality ( denoted by X ) of medical images . However , the number of images in this modality is limited , which are not sufficient to train effective models . Meanwhile , there is another modality ( denoted by Y ) of medical images used for diagnosing disease D. Cross-modality data augmentation refers to leveraging the images in Y to augment the training set in X . Specifically , we translate images in Y into images that have a similar style as those in X and add the translated images together with their disease labels into the training dataset in X . Compared with simple augmentation such as cropping , scaling , rotation , cross-modality data augmentation can bring in more diversity since the images in different modalities are from different patients and hence are clinically more heterogeneous . More diverse augmented images are more valuable in improving the generalization ability of the model to unseen patients . To perform cross-modality data augmentation , we propose a discriminative unpaired image-toimage translation ( DUIIT ) method . Given images in a source modality , we translate them into images in a target modality . The translated images , together with their associated disease labels , are added to the training set in the target modality to train the predictive model . Different from unsupervised translation methods such as CycleGAN ( Zhu et al. , 2017a ) which perform the translation between images without considering their disease labels , our method conducts the translation in a discriminative way , where the translation is guided by the predictive task . Our model performs cross-modality image translation and predictive modeling simultaneously , to enable these two tasks to mutually benefit each other . The translated images are not only aimed to have similar style as those in the target modality , but also are targeted to be useful in training the predictive model . Our model consists of two modules : a translator and a predictor . The translator transforms the images in the source modality into synthesized images in the target modality . Then the translated images ( together with their class labels ) are combined with the images in the target modality to train the predictor . The predictor takes an image as input and predicts the class label . The two modules are trained jointly so that the translator is learned to generate target images that are effective in training the predictor . We apply our method to two medical imaging applications . In the first application , the source modality is MRI and the target modality is CT. Our method translates MRI images into CTs in a discriminative way and uses the combination of original CTs and translated CTs to train the predictive model , which achieves substantially lower prediction error compared with using original CTs only . In the second application , the source modality is PET and the target modality is CT. By translating PET images to CTs , our method significantly improves prediction performance . The major contributions of this paper include : • We propose a discriminative unpaired image-to-image translation method to translate medical images from the source modality to the target modality to augment the training data in the target modality . The translation is guided by the predictive task . • On two applications , we demonstrate the effectiveness of our method . The rest of the paper is organized as follows . Section 2 reviews related works . Section 3 and 4 present the methods and experiments . Section 5 concludes the paper . 2 RELATED WORKS . 2.1 MEDICAL IMAGE SYNTHESIS . Several attempts have been made to synthesize medical images . Frid-Adar et al . ( 2018 ) combine three DCGANs ( Radford et al. , 2015 ) to generate synthetic medical images , which are used for data augmentation and lesion classification . Jin et al . ( 2018 ) develop a 3D GAN to learn lung nodule properties in the 3D space . The 3D GAN is conditioned on a volume of interest whose central part containing nodules has been erased . GANs are also used for generating segmentation maps ( Guibas et al. , 2017 ) where a two stage pipeline is applied . Mok & Chung ( 2018 ) apply conditional GANs ( Mirza & Osindero , 2014 ; Odena et al. , 2017 ) to synthesize brain MRI images in a coarse-to-fine manner , for brain tumour segmentation . To reserve fine-grained details of the tumor core , they encourage the generator to delineate tumor boundaries . Cross-modality translation has been studied to synthesize medical images . In Wolterink et al . ( 2017 ) , it is found that using unpaired medical images for augmentation is better than using aligned medical images . Chartsias et al . ( 2017 ) apply CycleGAN for generating synthetic multi-modal cardiac data . Zhang et al . ( 2018 ) combine the synthetic data translated from other modalities with real data for segmenting multimodal medical volumes . A shape-consistency loss is used to reduce geometric distortion . 2.2 IMAGE GENERATION . Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ; Radford et al. , 2015 ; Arjovsky et al. , 2017 ) have been widely used for image generation from random vectors . Conditional GANs ( Mirza & Osindero , 2014 ; Odena et al. , 2017 ) generates images from class labels . Image-toimage translation ( Isola et al. , 2016 ; Wang et al. , 2018 ; Zhu et al. , 2017a ) studies how to generate one image ( set ) from another ( set ) based on GANs . A number of works have been devoted to generating images from texts . Mansimov et al . ( 2015 ) propose an encoder-decoder architecture for text-toimage generation . The encoder of text and the decoder of image are both based on recurrent networks . Attention is used between image patches and words . AttnGAN ( Xu et al. , 2018 ) synthesizes fine-grained details at different subregions of the image by paying attention to the relevant words in the natural language description . DM-GAN ( Zhu et al. , 2019 ) uses a dynamic memory module to refine fuzzy image contents , when the initial images are not well generated , and designs a memory writing gate to select the important text information . Obj-GAN ( Li et al. , 2019 ) proposes an objectdriven attentive image generator to synthesize salient objects by paying attention to the most relevant words in the text description and the pre-generated semantic layout . MirrorGAN ( Qiao et al. , 2019 ) uses an autoencoder architecture , which generates an image from a text , then reconstructs the text from the image . Many techniques have been proposed to improve the fidelity of generated images by GANs . Brock et al . ( 2018 ) demonstrate that GANs benefit remarkably from scaling : increasing model size and minibatch size improves the fidelity of generated images . To generate images with higher resolution , the progressive technique used in PGGAN ( Karras et al. , 2017 ) has been widely adopted . StackGAN ( Zhang et al. , 2017 ) first uses a GAN to generate low-resolution images , which are then fed into another GAN to generate high-resolution images . 2.3 IMAGE AUGMENTATION . Image augmentation is a widely used technique to enlarge the training dataset and alleviate overfitting . Basic augmentation methods ( Krizhevsky et al. , 2012 ) include geometric and color transformations , such as crop , flip , rotation , translation , scale , color jitter , contrast , etc . Cubuk et al . ( 2018 ) propose a reinforcement learning based algorithm to automatically search for augmentation policies . Takahashi et al . ( 2019 ) propose to randomly crop four images and patch them to create a new training image . Zhong et al . ( 2017 ) propose Random Erasing which assigns random values to pixels in randomly-sampled rectangle regions , to generate augmented images with different occlusion levels . Perez & Wang ( 2017 ) design two methods for data augmentation . One is using GAN to synthesize new images with different styles . The other is training an augmentation network for generating augmented data . Zhao et al . ( 2020 ) propose DiffAugment that can improve the sample efficiency of training GANs . This method applies the same differentiable augmentation to both real and fake images when training the generator and discriminator .
This paper discusses an approach to augment a medical imaging dataset using images from another modality. The images in the other (i.e. source) modality should have been originally collected & labeled to perform the same discrimination or regression task as the target modality. A network consisting of a prediction network for the mixture of augmented and target images & another network based on CycleGAN for the image translation network are jointly optimized using end to end training.
SP:2c70c132373daf3644f009748f343decdc4886ba
Conformation-Guided Molecular Representation with Hamiltonian Neural Networks
1 INTRODUCTION . The past several years have seen a prevalence of the intersection between medical chemistry and deep learning . Remarkable progress has been made in various applications on small molecules , ranging from generation ( Jin et al. , 2018 ; You et al. , 2018 ) and property prediction ( Gilmer et al. , 2017 ; Cho & Choi , 2019 ; Klicpera et al. , 2020 ) to protein-ligand interaction analysis ( Lim et al. , 2019 ; Wang et al. , 2020 ) , yet all these tasks rely on well-designed numerical representations , or fingerprints , of molecules . These fingerprints encode molecular structures and serve as the indicators in downstream tasks . Early work of molecular fingerprints ( Morgan , 1965 ; Rogers & Hahn , 2010 ) started from encoding the two-dimensional ( 2D ) structures of molecules , i.e . the chemical bonds between atoms , often stored as atom-bond graphs . More recently , a trend of incorporating molecular geometry into the representations arose ( Axen et al. , 2017 ; Cho & Choi , 2019 ) . Molecular geometry refers to the conformation ( the three-dimensional ( 3D ) coordinations of atoms ) of a molecule , which contains widely interested chemical information such as bond lengths and angles , and thus stands vital for determining physical , chemical , and biomedical properties of the molecule . Whereas incorporating 3D geometry of molecules seems indeed beneficial , 3D fingerprints , especially in combination with deep learning , are still in infancy . The use of 3D fingerprints is limited by pragmatic considerations including i ) calculation costs , ii ) translational & rotational invariances , and iii ) the availability of conformations , especially considering the generated ligand candidates in drug discovery tasks . Furthermore , compared with current 3D algorithms , mature 2D fingerprints ( Rogers & Hahn , 2010 ; Gilmer et al. , 2017 ; Xiong et al. , 2020 ) are generally more popular with equivalent or even better performances in practice . For example , as a 2D approach , Attentive Fingerprints ( Attentive FP ) ( Xiong et al. , 2020 ) have become the de facto state-of-the-art approach . To push the boundaries of leveraging 3D geometries in molecular fingerprints , we propose HamNet ( Molecular Hamiltonian Networks ) . HamNet simulates the process of molecular dynamics ( MD ) ∗Equal Contribution . †Corresponding Author . to model the conformations of small molecules , based on which final fingerprints are calculated similarly to ( Xiong et al. , 2020 ) . To address the potential lack of labeled conformations , HamNet does not regard molecular conformations as all-time available inputs . Instead , A Hamiltonian engine is designed to reconstruct known conformations and generalize for unknown ones . Encoded from atom features , implicit positions and momentums of atoms interact in the engine following the discretized Hamiltonian Equations with learnable energy and dissipation functions . Final positions are supervised with real conformations , and further used as inputs to a Message-Passing Neural Network ( MPNN ) ( Gilmer et al. , 2017 ) to generate the fingerprints . Novel loss functions with translational & rotational invariances are proposed to supervise the Hamiltonian Engine , and the architecture of the Fingerprint Generator is elaborated to better incorporate the output quantities from the engine . We show via our conformation-reconstructing experiments that the proposed Hamiltonian Engine is eligible to better predict molecular conformations than conventional geometric approaches as well as common neural structures ( MPNNs ) . We also evaluate HamNet on several datasets with different targets collected in a standard molecular machine learning benchmark , MoleculeNet ( Wu et al. , 2017 ) , all following the same experimental setups . HamNet demonstrates state-of-the-art performances , outperforming baselines including both 2D and 3D approaches . 2 PRELIMINARIES . Notations . Given a molecule with n atoms , we use vi to denote the features of atom i , and eij that of the chemical bond between i and j ( if exists ) . Bold , upper-case letters denote matrices , and lower-case , vectors . All vectors in this paper are column vectors , and · > stands for the transpose operation . We use ⊕ for the concatenation operation of vectors . The positions and momentums of atom i are denoted as qi and pi , and the set of all positions of atoms in a molecule is denoted as Q = ( qi , · · · , qn ) > . N ( v ) refers to the neighborhood of node v in some graph . Graph Convolutional Networks ( GCNs ) . Given an attributed graph G = ( V , A , X ) , where V = { v1 , · · · , vn } is the set of vertices , A ∈ Rn×n the ( weighted ) adjacency matrix , and X ∈ Rn×d the attribute matrix , GCNs ( Kipf & Welling , 2017 ) calculate the hidden states of graph nodes as GCN ( L ) ( X ) ≡H ( L ) , H ( l+1 ) = σ ( ÂH ( l ) W ( l ) ) , H ( 0 ) = X , l = 0 , 1 , · · · , L− 1 . ( 1 ) Here , H = ( hv1 , · · · , hvn ) > are hidden representations of nodes , Â = D− 1 2AD− 1 2 is the normalized adjacency matrix , D with Dii = ∑ jAij is the diagonal matrix of node degrees , and W s are network parameters . Message-Passing Neural Networks ( MPNNs ) . MPNN ( Gilmer et al. , 2017 ) introduced a general framework of Graph Neural Networks ( GNNs ) . In the t-th layer of a typical MPNN , messages ( mt ) are generated between two connected nodes ( i , j ) based on the hidden representations of both nodes ( ht ) and the edge in-between . After that , nodes receive the messages and update their own hidden representations . A readout function is then defined over final node representations ( hT ) to derive graph-level representations . Denoted in formula , the calculation follows mt+1v = ∑ w∈N ( v ) Mt ( h t v , h t w , ev , w ) , h t+1 v = Ut ( h t v , m t+1 v ) , ŷ = R ( { hTv |v ∈ V } ) , ( 2 ) where Mt , Ut , R are the message , update and readout functions . Hamiltonian Equations . The Hamiltonian Equations depict Newton ’ s laws of motion in the form of first-order PDEs . Considering a system of n particles with positions ( q1 , · · · , qn ) and momentums ( p1 , · · · , pn ) , the dynamics of the system follow q̇i ≡ dqi dt = ∂H ∂pi , ṗi ≡ dpi dt = −∂H ∂qi , ( 3 ) where H is the Hamiltonian of the system , and equals to the total system energy . Generally , the Hamiltonian is composed of the kinetic energy of all particles and the potential energy as H = n∑ i=1 Ti + U . ( 4 ) Meanwhile , if dissipation exists in the system , the Hamiltonian Equations shall be adapted as q̇i = ∂H ∂pi , ṗi = − ( ∂H ∂qi + ∂Φ ∂q̇i ) = − ( ∂H ∂qi +mi ∂Φ ∂pi ) ( 5 ) where mi is the mass of the particle and Φ is the dissipation function which describes how the system energy is dissipated by the outer environment . 3 METHOD : HAMNET . Figure 1 shows the overall architecture of HamNet . HamNet consists of two modules : i ) a Hamiltonian Engine , where molecular conformations are reconstructed ; and ii ) a Fingerprint Generator , where final fingerprints are generated from atom & bond features and outputs from the Hamiltonian Engine . 3.1 HAMILTONIAN ENGINE . Discretized Hamiltonian Equations . The Hamiltonian Engine is designed to simulate the physical interactions between atoms in a molecule . To correctly incorporate the laws of motion , we discretize the Hamiltonian Equations with dissipation ( Equation 5 ) and model the energy and dissipation with learnable functions . At the t-th step ( t = 0 , 1 , · · · , T ) in the engine , for atom i , q ( t+1 ) i = q ( t ) i + η ∂H ( t ) ∂p ( t ) i , p ( t+1 ) i = p ( t ) i − η ( ∂H ( t ) ∂q ( t ) i +mi ∂Φ ( t ) ∂p ( t ) i ) . ( 6 ) Here , η is a hyperparameter of step size which controls the granularity of the discretization , mi is the ( normalized ) mass of atom i , andH ( t ) , Φ ( t ) are the learnable Hamiltonian and dissipation functions of q ( t ) and p ( t ) : ( superscripts skipped ) H = n∑ i=1 Ti ( pi ) + U ( qi , · · · , qn ) , Φ = n∑ i=1 φ ( pi ) . ( 7 ) It should be noted that in order to improve the expressional power of the network , we extend the concept of positions and momentums into implicit ones in a generalized df -dimensional space , i.e . q , p ∈ Rdf , df > 3 . We will discuss how to supervise these implicit quantities , and will show the influences of the dimensionality in the experimental results . Nonetheless , we parameterize the energy and dissipation function in a physically inspired manner : for the atom-wise kinetic energy , we generalize the definition of kinetic energy ( T = p 2 2m ) as the quadratic forms of the implicit momentums ; for the atom-wise dissipation , we adapt the Rayleigh ’ s dissipation function ( Φ = 12 ∑n i , j=1 cij q̇iq̇j ) into the generalized space . Denoted in formula , we have Ti ( pi ) = p > i W > T WTpi 2mi , φi ( pi ) = p > i W > φ Wφpi 2m2i . ( 8 ) For the potential energy , we simplify the Lennard-Jones potential ( U ( r ) = ( r−12 − r−6 ) ) with parameterized distances rs in the generalized space , that is , U = ∑ i 6=j uij , uij = r −4 ij − r −2 ij , r 2 ij ≡ r ( qi , qj ) = ( qi − qj ) > W > U WU ( qi − qj ) . ( 9 ) In both Equation 8 and Equation 9 , W s are network parameters . For the mass of the atoms , we empirically normalize the relative atomic mass Mi of atom i with mi = Mi/50 . One would also note that the parameters in each step of the engine remain the same , and thus the scale of parameters in the engine depends only on df and is irrelevant to the depth T . Initial positions and momentums . Graph-based neural networks are used to initialize these spatial quantities . Molecules are essentially graphs , while bonds between atoms can be of different types ( single , double , triple and aromatic ) . Instead of using channel-wise GCNs which assign different parameters for different types of edges ( Schlichtkrull et al. , 2018 ) , we calculate a bond-strength adjacency for the molecules : the strength of a bond depends on the atom-bond-atom tuple , i.e . Aij = sigmoid ( MLP ( ( vi ⊕ eij ⊕ vj ) ) ) if the bond exists , Aij = 0 otherwise . ( 10 ) With so-defined adjacency , we first encode the atoms with vanilla GCNs ( Equation 1 ) and concatenate all hidden layers following the DenseNet scheme ( Huang et al. , 2017 ) . Deep enough GCNs do capture entire molecular structures , however , atoms with identical chemical environment can not be distinguished , for example , carbon atoms in the benzene ring . This may not be a problem in conventional MPNNs , but atoms with coinciding positions are inacceptable in physics as well as the Hamiltonian engine . Therefore , we conduct an LSTM over the GCN outputs to generate unique positions for atoms . The order that the atoms appear in the LSTM conforms with the SMILES representations ( Weininger , 1988 ) of the molecule , which display atoms in the molecule in a specific topological order . Denoted in formula , initial positions and momentums of atoms are calculated as q̃i = L⊕ l=0 f ( l ) i , q ( 0 ) i = LSTMsi ( q̃s1 , q̃s2 , · · · , q̃sn ) ( 11 ) p̃i = L⊕ l=0 g ( l ) i , p ( 0 ) i = LSTMsi ( p̃s1 , p̃s2 , · · · , p̃sn ) ( 12 ) where f ( l ) i , g ( l ) i are hidden representations of atom i in the l-th GCN layer and sk is the atom at k-th position in the SMILES . As unique orders are assigned for atoms , their initial positions are thus unique . Conformation preserving . After the dynamical process in the Hamiltonian Engine , positions in the generalized Rdf space are transformed into real 3D space linearly , that is , Q̂ = QWtrans , Q̂ ∈ Rn×3 , Q = ( q1 , · · · , qn ) ∈ Rn×df . ( 13 ) Considering translational & rotational invariances , we do not require that Q̂ approximates the labeled 3D coordinations of atoms . Instead , three translational- and rotational-invariant metrics are proposed and used to supervise Q̂ : I ) Kabsch-RMSD ( K-RMSD ) . We use the Kabsch Algorithm ( Kabsch , 1976 ) to rotate and align the approximated atom positions ( Q̂ ) to the real ones ( QR ) , and then calculate the Root of Mean Squared Deviations ( RMSD ) of two conformations using atom mass as weights : Q̂K = Kabsch ( Q̂ ; QR ) , Lk−rmsd ( Q̂ , QR ) = √√√√∑ni=1mi × ∥∥q̂Ki − qRi ∥∥22∑n i=1mi . ( 14 ) One should note that the alignment Kabsch ( · ; · ) is calculated with SVD and is thus differentiable . II ) Distance Loss . Pair-wise distances between atoms are vital quantities in describing molecular conformations and enjoy desired invariances . Therefore , we propose the metric Ldist as L2dist ( Q̂ , Q R ) = 1 n2 n∑ i , j=1 ( ‖qi − qj‖22 − ∥∥qRi − qRj ∥∥22 ) 2 ( 15 ) III ) ADJ-k Loss . A drawback of the naive distance loss is that distances between far atoms are over-emphasized , leading to deformed local structures . Therefore , we further propose ADJ-k loss , where only distances between k-hop connected atoms are preserved under weights calculated from hop-distances . Denote the normalized , simple adjacency matrix as Ã,1 the ADJ-k loss is defined as L2adj−k ( Q̂ , Q R ) = 1 n n∑ i , j=1 Ãkij ( ‖qi − qj‖22 − ∥∥qRi − qRj ∥∥22 ) 2 ( 16 ) In implementation , we use a linear combination of K-RMSD and ADJ-3 losses to supervise the engine , i.e . LHE = Lk−rmsd + λLadj−3 , where λ is a hyperparameter .
This paper proposes to use 3d conformations for learning molecular fingerprints by 1) training a generative model to predict the 3d coordinates and 2) use those to train a "fingerprint generator" to obtain fingerprints by learning to predict molecular properties. The paper is well structured and clearly written. The intuition behind the Hamiltonian engine is nicely explained in the discussion section. The idea of a two step procedure to include 3d structure information in the training even when it is not available at test time is interesting and original.
SP:5ae0998f30b7d1308c97b68fc8f840a6de3ffeee
Conformation-Guided Molecular Representation with Hamiltonian Neural Networks
1 INTRODUCTION . The past several years have seen a prevalence of the intersection between medical chemistry and deep learning . Remarkable progress has been made in various applications on small molecules , ranging from generation ( Jin et al. , 2018 ; You et al. , 2018 ) and property prediction ( Gilmer et al. , 2017 ; Cho & Choi , 2019 ; Klicpera et al. , 2020 ) to protein-ligand interaction analysis ( Lim et al. , 2019 ; Wang et al. , 2020 ) , yet all these tasks rely on well-designed numerical representations , or fingerprints , of molecules . These fingerprints encode molecular structures and serve as the indicators in downstream tasks . Early work of molecular fingerprints ( Morgan , 1965 ; Rogers & Hahn , 2010 ) started from encoding the two-dimensional ( 2D ) structures of molecules , i.e . the chemical bonds between atoms , often stored as atom-bond graphs . More recently , a trend of incorporating molecular geometry into the representations arose ( Axen et al. , 2017 ; Cho & Choi , 2019 ) . Molecular geometry refers to the conformation ( the three-dimensional ( 3D ) coordinations of atoms ) of a molecule , which contains widely interested chemical information such as bond lengths and angles , and thus stands vital for determining physical , chemical , and biomedical properties of the molecule . Whereas incorporating 3D geometry of molecules seems indeed beneficial , 3D fingerprints , especially in combination with deep learning , are still in infancy . The use of 3D fingerprints is limited by pragmatic considerations including i ) calculation costs , ii ) translational & rotational invariances , and iii ) the availability of conformations , especially considering the generated ligand candidates in drug discovery tasks . Furthermore , compared with current 3D algorithms , mature 2D fingerprints ( Rogers & Hahn , 2010 ; Gilmer et al. , 2017 ; Xiong et al. , 2020 ) are generally more popular with equivalent or even better performances in practice . For example , as a 2D approach , Attentive Fingerprints ( Attentive FP ) ( Xiong et al. , 2020 ) have become the de facto state-of-the-art approach . To push the boundaries of leveraging 3D geometries in molecular fingerprints , we propose HamNet ( Molecular Hamiltonian Networks ) . HamNet simulates the process of molecular dynamics ( MD ) ∗Equal Contribution . †Corresponding Author . to model the conformations of small molecules , based on which final fingerprints are calculated similarly to ( Xiong et al. , 2020 ) . To address the potential lack of labeled conformations , HamNet does not regard molecular conformations as all-time available inputs . Instead , A Hamiltonian engine is designed to reconstruct known conformations and generalize for unknown ones . Encoded from atom features , implicit positions and momentums of atoms interact in the engine following the discretized Hamiltonian Equations with learnable energy and dissipation functions . Final positions are supervised with real conformations , and further used as inputs to a Message-Passing Neural Network ( MPNN ) ( Gilmer et al. , 2017 ) to generate the fingerprints . Novel loss functions with translational & rotational invariances are proposed to supervise the Hamiltonian Engine , and the architecture of the Fingerprint Generator is elaborated to better incorporate the output quantities from the engine . We show via our conformation-reconstructing experiments that the proposed Hamiltonian Engine is eligible to better predict molecular conformations than conventional geometric approaches as well as common neural structures ( MPNNs ) . We also evaluate HamNet on several datasets with different targets collected in a standard molecular machine learning benchmark , MoleculeNet ( Wu et al. , 2017 ) , all following the same experimental setups . HamNet demonstrates state-of-the-art performances , outperforming baselines including both 2D and 3D approaches . 2 PRELIMINARIES . Notations . Given a molecule with n atoms , we use vi to denote the features of atom i , and eij that of the chemical bond between i and j ( if exists ) . Bold , upper-case letters denote matrices , and lower-case , vectors . All vectors in this paper are column vectors , and · > stands for the transpose operation . We use ⊕ for the concatenation operation of vectors . The positions and momentums of atom i are denoted as qi and pi , and the set of all positions of atoms in a molecule is denoted as Q = ( qi , · · · , qn ) > . N ( v ) refers to the neighborhood of node v in some graph . Graph Convolutional Networks ( GCNs ) . Given an attributed graph G = ( V , A , X ) , where V = { v1 , · · · , vn } is the set of vertices , A ∈ Rn×n the ( weighted ) adjacency matrix , and X ∈ Rn×d the attribute matrix , GCNs ( Kipf & Welling , 2017 ) calculate the hidden states of graph nodes as GCN ( L ) ( X ) ≡H ( L ) , H ( l+1 ) = σ ( ÂH ( l ) W ( l ) ) , H ( 0 ) = X , l = 0 , 1 , · · · , L− 1 . ( 1 ) Here , H = ( hv1 , · · · , hvn ) > are hidden representations of nodes , Â = D− 1 2AD− 1 2 is the normalized adjacency matrix , D with Dii = ∑ jAij is the diagonal matrix of node degrees , and W s are network parameters . Message-Passing Neural Networks ( MPNNs ) . MPNN ( Gilmer et al. , 2017 ) introduced a general framework of Graph Neural Networks ( GNNs ) . In the t-th layer of a typical MPNN , messages ( mt ) are generated between two connected nodes ( i , j ) based on the hidden representations of both nodes ( ht ) and the edge in-between . After that , nodes receive the messages and update their own hidden representations . A readout function is then defined over final node representations ( hT ) to derive graph-level representations . Denoted in formula , the calculation follows mt+1v = ∑ w∈N ( v ) Mt ( h t v , h t w , ev , w ) , h t+1 v = Ut ( h t v , m t+1 v ) , ŷ = R ( { hTv |v ∈ V } ) , ( 2 ) where Mt , Ut , R are the message , update and readout functions . Hamiltonian Equations . The Hamiltonian Equations depict Newton ’ s laws of motion in the form of first-order PDEs . Considering a system of n particles with positions ( q1 , · · · , qn ) and momentums ( p1 , · · · , pn ) , the dynamics of the system follow q̇i ≡ dqi dt = ∂H ∂pi , ṗi ≡ dpi dt = −∂H ∂qi , ( 3 ) where H is the Hamiltonian of the system , and equals to the total system energy . Generally , the Hamiltonian is composed of the kinetic energy of all particles and the potential energy as H = n∑ i=1 Ti + U . ( 4 ) Meanwhile , if dissipation exists in the system , the Hamiltonian Equations shall be adapted as q̇i = ∂H ∂pi , ṗi = − ( ∂H ∂qi + ∂Φ ∂q̇i ) = − ( ∂H ∂qi +mi ∂Φ ∂pi ) ( 5 ) where mi is the mass of the particle and Φ is the dissipation function which describes how the system energy is dissipated by the outer environment . 3 METHOD : HAMNET . Figure 1 shows the overall architecture of HamNet . HamNet consists of two modules : i ) a Hamiltonian Engine , where molecular conformations are reconstructed ; and ii ) a Fingerprint Generator , where final fingerprints are generated from atom & bond features and outputs from the Hamiltonian Engine . 3.1 HAMILTONIAN ENGINE . Discretized Hamiltonian Equations . The Hamiltonian Engine is designed to simulate the physical interactions between atoms in a molecule . To correctly incorporate the laws of motion , we discretize the Hamiltonian Equations with dissipation ( Equation 5 ) and model the energy and dissipation with learnable functions . At the t-th step ( t = 0 , 1 , · · · , T ) in the engine , for atom i , q ( t+1 ) i = q ( t ) i + η ∂H ( t ) ∂p ( t ) i , p ( t+1 ) i = p ( t ) i − η ( ∂H ( t ) ∂q ( t ) i +mi ∂Φ ( t ) ∂p ( t ) i ) . ( 6 ) Here , η is a hyperparameter of step size which controls the granularity of the discretization , mi is the ( normalized ) mass of atom i , andH ( t ) , Φ ( t ) are the learnable Hamiltonian and dissipation functions of q ( t ) and p ( t ) : ( superscripts skipped ) H = n∑ i=1 Ti ( pi ) + U ( qi , · · · , qn ) , Φ = n∑ i=1 φ ( pi ) . ( 7 ) It should be noted that in order to improve the expressional power of the network , we extend the concept of positions and momentums into implicit ones in a generalized df -dimensional space , i.e . q , p ∈ Rdf , df > 3 . We will discuss how to supervise these implicit quantities , and will show the influences of the dimensionality in the experimental results . Nonetheless , we parameterize the energy and dissipation function in a physically inspired manner : for the atom-wise kinetic energy , we generalize the definition of kinetic energy ( T = p 2 2m ) as the quadratic forms of the implicit momentums ; for the atom-wise dissipation , we adapt the Rayleigh ’ s dissipation function ( Φ = 12 ∑n i , j=1 cij q̇iq̇j ) into the generalized space . Denoted in formula , we have Ti ( pi ) = p > i W > T WTpi 2mi , φi ( pi ) = p > i W > φ Wφpi 2m2i . ( 8 ) For the potential energy , we simplify the Lennard-Jones potential ( U ( r ) = ( r−12 − r−6 ) ) with parameterized distances rs in the generalized space , that is , U = ∑ i 6=j uij , uij = r −4 ij − r −2 ij , r 2 ij ≡ r ( qi , qj ) = ( qi − qj ) > W > U WU ( qi − qj ) . ( 9 ) In both Equation 8 and Equation 9 , W s are network parameters . For the mass of the atoms , we empirically normalize the relative atomic mass Mi of atom i with mi = Mi/50 . One would also note that the parameters in each step of the engine remain the same , and thus the scale of parameters in the engine depends only on df and is irrelevant to the depth T . Initial positions and momentums . Graph-based neural networks are used to initialize these spatial quantities . Molecules are essentially graphs , while bonds between atoms can be of different types ( single , double , triple and aromatic ) . Instead of using channel-wise GCNs which assign different parameters for different types of edges ( Schlichtkrull et al. , 2018 ) , we calculate a bond-strength adjacency for the molecules : the strength of a bond depends on the atom-bond-atom tuple , i.e . Aij = sigmoid ( MLP ( ( vi ⊕ eij ⊕ vj ) ) ) if the bond exists , Aij = 0 otherwise . ( 10 ) With so-defined adjacency , we first encode the atoms with vanilla GCNs ( Equation 1 ) and concatenate all hidden layers following the DenseNet scheme ( Huang et al. , 2017 ) . Deep enough GCNs do capture entire molecular structures , however , atoms with identical chemical environment can not be distinguished , for example , carbon atoms in the benzene ring . This may not be a problem in conventional MPNNs , but atoms with coinciding positions are inacceptable in physics as well as the Hamiltonian engine . Therefore , we conduct an LSTM over the GCN outputs to generate unique positions for atoms . The order that the atoms appear in the LSTM conforms with the SMILES representations ( Weininger , 1988 ) of the molecule , which display atoms in the molecule in a specific topological order . Denoted in formula , initial positions and momentums of atoms are calculated as q̃i = L⊕ l=0 f ( l ) i , q ( 0 ) i = LSTMsi ( q̃s1 , q̃s2 , · · · , q̃sn ) ( 11 ) p̃i = L⊕ l=0 g ( l ) i , p ( 0 ) i = LSTMsi ( p̃s1 , p̃s2 , · · · , p̃sn ) ( 12 ) where f ( l ) i , g ( l ) i are hidden representations of atom i in the l-th GCN layer and sk is the atom at k-th position in the SMILES . As unique orders are assigned for atoms , their initial positions are thus unique . Conformation preserving . After the dynamical process in the Hamiltonian Engine , positions in the generalized Rdf space are transformed into real 3D space linearly , that is , Q̂ = QWtrans , Q̂ ∈ Rn×3 , Q = ( q1 , · · · , qn ) ∈ Rn×df . ( 13 ) Considering translational & rotational invariances , we do not require that Q̂ approximates the labeled 3D coordinations of atoms . Instead , three translational- and rotational-invariant metrics are proposed and used to supervise Q̂ : I ) Kabsch-RMSD ( K-RMSD ) . We use the Kabsch Algorithm ( Kabsch , 1976 ) to rotate and align the approximated atom positions ( Q̂ ) to the real ones ( QR ) , and then calculate the Root of Mean Squared Deviations ( RMSD ) of two conformations using atom mass as weights : Q̂K = Kabsch ( Q̂ ; QR ) , Lk−rmsd ( Q̂ , QR ) = √√√√∑ni=1mi × ∥∥q̂Ki − qRi ∥∥22∑n i=1mi . ( 14 ) One should note that the alignment Kabsch ( · ; · ) is calculated with SVD and is thus differentiable . II ) Distance Loss . Pair-wise distances between atoms are vital quantities in describing molecular conformations and enjoy desired invariances . Therefore , we propose the metric Ldist as L2dist ( Q̂ , Q R ) = 1 n2 n∑ i , j=1 ( ‖qi − qj‖22 − ∥∥qRi − qRj ∥∥22 ) 2 ( 15 ) III ) ADJ-k Loss . A drawback of the naive distance loss is that distances between far atoms are over-emphasized , leading to deformed local structures . Therefore , we further propose ADJ-k loss , where only distances between k-hop connected atoms are preserved under weights calculated from hop-distances . Denote the normalized , simple adjacency matrix as Ã,1 the ADJ-k loss is defined as L2adj−k ( Q̂ , Q R ) = 1 n n∑ i , j=1 Ãkij ( ‖qi − qj‖22 − ∥∥qRi − qRj ∥∥22 ) 2 ( 16 ) In implementation , we use a linear combination of K-RMSD and ADJ-3 losses to supervise the engine , i.e . LHE = Lk−rmsd + λLadj−3 , where λ is a hyperparameter .
The paper proposes a new method for generating fingerprints for small molecules. It is based on two components: a "Hamiltonian Engine" that runs a brief simulation, predicting the structure of the small molecule by minimizing a learned potential energy, and 2) a message passing algorithm that uses the predicted structure as input. The reported experimental results demonstrate state-of-the-art performance.
SP:5ae0998f30b7d1308c97b68fc8f840a6de3ffeee
Conformation-Guided Molecular Representation with Hamiltonian Neural Networks
1 INTRODUCTION . The past several years have seen a prevalence of the intersection between medical chemistry and deep learning . Remarkable progress has been made in various applications on small molecules , ranging from generation ( Jin et al. , 2018 ; You et al. , 2018 ) and property prediction ( Gilmer et al. , 2017 ; Cho & Choi , 2019 ; Klicpera et al. , 2020 ) to protein-ligand interaction analysis ( Lim et al. , 2019 ; Wang et al. , 2020 ) , yet all these tasks rely on well-designed numerical representations , or fingerprints , of molecules . These fingerprints encode molecular structures and serve as the indicators in downstream tasks . Early work of molecular fingerprints ( Morgan , 1965 ; Rogers & Hahn , 2010 ) started from encoding the two-dimensional ( 2D ) structures of molecules , i.e . the chemical bonds between atoms , often stored as atom-bond graphs . More recently , a trend of incorporating molecular geometry into the representations arose ( Axen et al. , 2017 ; Cho & Choi , 2019 ) . Molecular geometry refers to the conformation ( the three-dimensional ( 3D ) coordinations of atoms ) of a molecule , which contains widely interested chemical information such as bond lengths and angles , and thus stands vital for determining physical , chemical , and biomedical properties of the molecule . Whereas incorporating 3D geometry of molecules seems indeed beneficial , 3D fingerprints , especially in combination with deep learning , are still in infancy . The use of 3D fingerprints is limited by pragmatic considerations including i ) calculation costs , ii ) translational & rotational invariances , and iii ) the availability of conformations , especially considering the generated ligand candidates in drug discovery tasks . Furthermore , compared with current 3D algorithms , mature 2D fingerprints ( Rogers & Hahn , 2010 ; Gilmer et al. , 2017 ; Xiong et al. , 2020 ) are generally more popular with equivalent or even better performances in practice . For example , as a 2D approach , Attentive Fingerprints ( Attentive FP ) ( Xiong et al. , 2020 ) have become the de facto state-of-the-art approach . To push the boundaries of leveraging 3D geometries in molecular fingerprints , we propose HamNet ( Molecular Hamiltonian Networks ) . HamNet simulates the process of molecular dynamics ( MD ) ∗Equal Contribution . †Corresponding Author . to model the conformations of small molecules , based on which final fingerprints are calculated similarly to ( Xiong et al. , 2020 ) . To address the potential lack of labeled conformations , HamNet does not regard molecular conformations as all-time available inputs . Instead , A Hamiltonian engine is designed to reconstruct known conformations and generalize for unknown ones . Encoded from atom features , implicit positions and momentums of atoms interact in the engine following the discretized Hamiltonian Equations with learnable energy and dissipation functions . Final positions are supervised with real conformations , and further used as inputs to a Message-Passing Neural Network ( MPNN ) ( Gilmer et al. , 2017 ) to generate the fingerprints . Novel loss functions with translational & rotational invariances are proposed to supervise the Hamiltonian Engine , and the architecture of the Fingerprint Generator is elaborated to better incorporate the output quantities from the engine . We show via our conformation-reconstructing experiments that the proposed Hamiltonian Engine is eligible to better predict molecular conformations than conventional geometric approaches as well as common neural structures ( MPNNs ) . We also evaluate HamNet on several datasets with different targets collected in a standard molecular machine learning benchmark , MoleculeNet ( Wu et al. , 2017 ) , all following the same experimental setups . HamNet demonstrates state-of-the-art performances , outperforming baselines including both 2D and 3D approaches . 2 PRELIMINARIES . Notations . Given a molecule with n atoms , we use vi to denote the features of atom i , and eij that of the chemical bond between i and j ( if exists ) . Bold , upper-case letters denote matrices , and lower-case , vectors . All vectors in this paper are column vectors , and · > stands for the transpose operation . We use ⊕ for the concatenation operation of vectors . The positions and momentums of atom i are denoted as qi and pi , and the set of all positions of atoms in a molecule is denoted as Q = ( qi , · · · , qn ) > . N ( v ) refers to the neighborhood of node v in some graph . Graph Convolutional Networks ( GCNs ) . Given an attributed graph G = ( V , A , X ) , where V = { v1 , · · · , vn } is the set of vertices , A ∈ Rn×n the ( weighted ) adjacency matrix , and X ∈ Rn×d the attribute matrix , GCNs ( Kipf & Welling , 2017 ) calculate the hidden states of graph nodes as GCN ( L ) ( X ) ≡H ( L ) , H ( l+1 ) = σ ( ÂH ( l ) W ( l ) ) , H ( 0 ) = X , l = 0 , 1 , · · · , L− 1 . ( 1 ) Here , H = ( hv1 , · · · , hvn ) > are hidden representations of nodes , Â = D− 1 2AD− 1 2 is the normalized adjacency matrix , D with Dii = ∑ jAij is the diagonal matrix of node degrees , and W s are network parameters . Message-Passing Neural Networks ( MPNNs ) . MPNN ( Gilmer et al. , 2017 ) introduced a general framework of Graph Neural Networks ( GNNs ) . In the t-th layer of a typical MPNN , messages ( mt ) are generated between two connected nodes ( i , j ) based on the hidden representations of both nodes ( ht ) and the edge in-between . After that , nodes receive the messages and update their own hidden representations . A readout function is then defined over final node representations ( hT ) to derive graph-level representations . Denoted in formula , the calculation follows mt+1v = ∑ w∈N ( v ) Mt ( h t v , h t w , ev , w ) , h t+1 v = Ut ( h t v , m t+1 v ) , ŷ = R ( { hTv |v ∈ V } ) , ( 2 ) where Mt , Ut , R are the message , update and readout functions . Hamiltonian Equations . The Hamiltonian Equations depict Newton ’ s laws of motion in the form of first-order PDEs . Considering a system of n particles with positions ( q1 , · · · , qn ) and momentums ( p1 , · · · , pn ) , the dynamics of the system follow q̇i ≡ dqi dt = ∂H ∂pi , ṗi ≡ dpi dt = −∂H ∂qi , ( 3 ) where H is the Hamiltonian of the system , and equals to the total system energy . Generally , the Hamiltonian is composed of the kinetic energy of all particles and the potential energy as H = n∑ i=1 Ti + U . ( 4 ) Meanwhile , if dissipation exists in the system , the Hamiltonian Equations shall be adapted as q̇i = ∂H ∂pi , ṗi = − ( ∂H ∂qi + ∂Φ ∂q̇i ) = − ( ∂H ∂qi +mi ∂Φ ∂pi ) ( 5 ) where mi is the mass of the particle and Φ is the dissipation function which describes how the system energy is dissipated by the outer environment . 3 METHOD : HAMNET . Figure 1 shows the overall architecture of HamNet . HamNet consists of two modules : i ) a Hamiltonian Engine , where molecular conformations are reconstructed ; and ii ) a Fingerprint Generator , where final fingerprints are generated from atom & bond features and outputs from the Hamiltonian Engine . 3.1 HAMILTONIAN ENGINE . Discretized Hamiltonian Equations . The Hamiltonian Engine is designed to simulate the physical interactions between atoms in a molecule . To correctly incorporate the laws of motion , we discretize the Hamiltonian Equations with dissipation ( Equation 5 ) and model the energy and dissipation with learnable functions . At the t-th step ( t = 0 , 1 , · · · , T ) in the engine , for atom i , q ( t+1 ) i = q ( t ) i + η ∂H ( t ) ∂p ( t ) i , p ( t+1 ) i = p ( t ) i − η ( ∂H ( t ) ∂q ( t ) i +mi ∂Φ ( t ) ∂p ( t ) i ) . ( 6 ) Here , η is a hyperparameter of step size which controls the granularity of the discretization , mi is the ( normalized ) mass of atom i , andH ( t ) , Φ ( t ) are the learnable Hamiltonian and dissipation functions of q ( t ) and p ( t ) : ( superscripts skipped ) H = n∑ i=1 Ti ( pi ) + U ( qi , · · · , qn ) , Φ = n∑ i=1 φ ( pi ) . ( 7 ) It should be noted that in order to improve the expressional power of the network , we extend the concept of positions and momentums into implicit ones in a generalized df -dimensional space , i.e . q , p ∈ Rdf , df > 3 . We will discuss how to supervise these implicit quantities , and will show the influences of the dimensionality in the experimental results . Nonetheless , we parameterize the energy and dissipation function in a physically inspired manner : for the atom-wise kinetic energy , we generalize the definition of kinetic energy ( T = p 2 2m ) as the quadratic forms of the implicit momentums ; for the atom-wise dissipation , we adapt the Rayleigh ’ s dissipation function ( Φ = 12 ∑n i , j=1 cij q̇iq̇j ) into the generalized space . Denoted in formula , we have Ti ( pi ) = p > i W > T WTpi 2mi , φi ( pi ) = p > i W > φ Wφpi 2m2i . ( 8 ) For the potential energy , we simplify the Lennard-Jones potential ( U ( r ) = ( r−12 − r−6 ) ) with parameterized distances rs in the generalized space , that is , U = ∑ i 6=j uij , uij = r −4 ij − r −2 ij , r 2 ij ≡ r ( qi , qj ) = ( qi − qj ) > W > U WU ( qi − qj ) . ( 9 ) In both Equation 8 and Equation 9 , W s are network parameters . For the mass of the atoms , we empirically normalize the relative atomic mass Mi of atom i with mi = Mi/50 . One would also note that the parameters in each step of the engine remain the same , and thus the scale of parameters in the engine depends only on df and is irrelevant to the depth T . Initial positions and momentums . Graph-based neural networks are used to initialize these spatial quantities . Molecules are essentially graphs , while bonds between atoms can be of different types ( single , double , triple and aromatic ) . Instead of using channel-wise GCNs which assign different parameters for different types of edges ( Schlichtkrull et al. , 2018 ) , we calculate a bond-strength adjacency for the molecules : the strength of a bond depends on the atom-bond-atom tuple , i.e . Aij = sigmoid ( MLP ( ( vi ⊕ eij ⊕ vj ) ) ) if the bond exists , Aij = 0 otherwise . ( 10 ) With so-defined adjacency , we first encode the atoms with vanilla GCNs ( Equation 1 ) and concatenate all hidden layers following the DenseNet scheme ( Huang et al. , 2017 ) . Deep enough GCNs do capture entire molecular structures , however , atoms with identical chemical environment can not be distinguished , for example , carbon atoms in the benzene ring . This may not be a problem in conventional MPNNs , but atoms with coinciding positions are inacceptable in physics as well as the Hamiltonian engine . Therefore , we conduct an LSTM over the GCN outputs to generate unique positions for atoms . The order that the atoms appear in the LSTM conforms with the SMILES representations ( Weininger , 1988 ) of the molecule , which display atoms in the molecule in a specific topological order . Denoted in formula , initial positions and momentums of atoms are calculated as q̃i = L⊕ l=0 f ( l ) i , q ( 0 ) i = LSTMsi ( q̃s1 , q̃s2 , · · · , q̃sn ) ( 11 ) p̃i = L⊕ l=0 g ( l ) i , p ( 0 ) i = LSTMsi ( p̃s1 , p̃s2 , · · · , p̃sn ) ( 12 ) where f ( l ) i , g ( l ) i are hidden representations of atom i in the l-th GCN layer and sk is the atom at k-th position in the SMILES . As unique orders are assigned for atoms , their initial positions are thus unique . Conformation preserving . After the dynamical process in the Hamiltonian Engine , positions in the generalized Rdf space are transformed into real 3D space linearly , that is , Q̂ = QWtrans , Q̂ ∈ Rn×3 , Q = ( q1 , · · · , qn ) ∈ Rn×df . ( 13 ) Considering translational & rotational invariances , we do not require that Q̂ approximates the labeled 3D coordinations of atoms . Instead , three translational- and rotational-invariant metrics are proposed and used to supervise Q̂ : I ) Kabsch-RMSD ( K-RMSD ) . We use the Kabsch Algorithm ( Kabsch , 1976 ) to rotate and align the approximated atom positions ( Q̂ ) to the real ones ( QR ) , and then calculate the Root of Mean Squared Deviations ( RMSD ) of two conformations using atom mass as weights : Q̂K = Kabsch ( Q̂ ; QR ) , Lk−rmsd ( Q̂ , QR ) = √√√√∑ni=1mi × ∥∥q̂Ki − qRi ∥∥22∑n i=1mi . ( 14 ) One should note that the alignment Kabsch ( · ; · ) is calculated with SVD and is thus differentiable . II ) Distance Loss . Pair-wise distances between atoms are vital quantities in describing molecular conformations and enjoy desired invariances . Therefore , we propose the metric Ldist as L2dist ( Q̂ , Q R ) = 1 n2 n∑ i , j=1 ( ‖qi − qj‖22 − ∥∥qRi − qRj ∥∥22 ) 2 ( 15 ) III ) ADJ-k Loss . A drawback of the naive distance loss is that distances between far atoms are over-emphasized , leading to deformed local structures . Therefore , we further propose ADJ-k loss , where only distances between k-hop connected atoms are preserved under weights calculated from hop-distances . Denote the normalized , simple adjacency matrix as Ã,1 the ADJ-k loss is defined as L2adj−k ( Q̂ , Q R ) = 1 n n∑ i , j=1 Ãkij ( ‖qi − qj‖22 − ∥∥qRi − qRj ∥∥22 ) 2 ( 16 ) In implementation , we use a linear combination of K-RMSD and ADJ-3 losses to supervise the engine , i.e . LHE = Lk−rmsd + λLadj−3 , where λ is a hyperparameter .
This paper presents a novel neural network module called Hamiltonian Neural Networks to learn representation of molecules. The module consists of two main components: 1) Hamiltonian Engine (HE), and 2) Fingerprint Generator (FG). The HE 1) takes a molecular graph with atom and bond features as inputs, and first generate "generalized" positions p and momentums q via GNN+LSTM. These ps and qs are fed into a discrete Hamiltonian system with dissipation, and produces (generalized) "conformations" of molecules. The FG also takes a molecular graph with atom and bond features + the generalized positions and momentums from 1) as inputs to generate the final vector embedding of the input molecule. HE is trained to fit the input 3D conformation with a weighted combination of two types lossses (K-RMSD + 5 * ADJ-k loss). Posing this "Hamiltonian" inductive bias to the model, the paper demonstrated that the prediction performance over multiple molecular tasks from MoleculeNet are all improved. Also, the analysis of HE module or the hyperparamter sensitivity analysis are provided.
SP:5ae0998f30b7d1308c97b68fc8f840a6de3ffeee
Revisiting BFfloat16 Training
State-of-the-art generic low-precision training algorithms use a mix of 16-bit and 32-bit precision , creating the folklore that 16-bit precision alone is not enough to maximize model accuracy . As a result , deep learning accelerators are forced to support both 16-bit and 32-bit compute units which is more costly than only using 16-bit units for hardware design . We ask can we do pure 16-bit training which requires only 16-bit compute units , while still matching the model accuracy attained by 32-bit training . Towards this end , we study pure 16-bit training algorithms on the widely adopted BFloat16 compute unit . While these units conventionally use nearest rounding to cast output to 16-bit precision , we show that nearest rounding for model weight updates can often cancel small updates , which degrades the convergence and model accuracy . Motivated by this , we identify two simple existing techniques , stochastic rounding and Kahan summation , to remedy the model accuracy degradation in pure 16-bit training . We empirically show that these two techniques can enable up to 7 % absolute validation accuracy gain in pure 16-bit training . This leads to 0.1 % lower to 0.2 % higher matching validation accuracy compared to 32-bit precision training across seven deep learning applications . 1 INTRODUCTION . Recently there has been an explosion in the compute resources required for training deep learning models ( Shoeybi et al. , 2019 ; Rajbhandari et al. , 2019 ; Real et al. , 2019 ) . As a result , there has been broad interest in leveraging low-precision ( < 32-bit ) training algorithms to reduce the required compute resources ( De Sa et al. , 2017 ; Hubara et al. , 2017 ; Gupta et al. , 2015 ) . Among these algorithms , mixed-precision training—in which model activations and gradients are stored using a 16-bit floating point format while model weights and optimizer states use 32-bit precision—is commonly used when training generic deep learning models ( Micikevicius et al. , 2017 ; Kalamkar et al. , 2019 ) . While there is a wide body of literature showing that low-precision training can minimally impact accuracy on specific models ( Wang et al. , 2018b ; De Sa et al. , 2015 ; Zhang et al. , 2017 ) , conventional wisdom suggests that at least some 32-bit computation is required as a fail-safe in generic deep learning training . As such , new accelerator architectures for deep learning are forced to support both 32-bit and 16-bit compute units . This is much more costly in terms of area , power , and speed when compared to hardware with only 16-bit compute units ( Horowitz , 2014 ; Galal et al. , 2013 ) . In this paper we question if 32-bit compute units are truly needed for new deep learning hardware accelerators . Namely , can we match the model accuracy of 32-bit-precision algorithms while leveraging only 16-bit compute units ? To answer this question , we study pure 16-bit training algorithms , ones which use only 16-bit compute units and which store activations , gradients , model weights , and optimizer states all in a 16-bit precision . Specifically , we focus on training with the BFloat16 compute unit which is widely adopted in modern deep learning accelerators ( Jouppi et al. , 2017 ; Burgess et al. , 2019 ) . Such units take 16-bit inputs , perform computation , and then round the results to a 16- bit output . BFloat16 compute units can provide 3⇥ higher power efficiency , 1.5⇥ lower latency , and 1.5⇥ less chip area than 32-bit units ( Horowitz , 2014 ; Galal et al. , 2013 ) . In addition , pure 16-bit training algorithms can reduce the memory footprint and bandwidth consumption of model weights and optimizers by 2⇥ compared to mixed precision or 32-bit precision training , especially for large models with billions of weights ( Shoeybi et al. , 2019 ; Rajbhandari et al. , 2019 ) . Developing reliable pure 16-bit training algorithms will enable hardware designers to realize these advantages . The simplest approach to pure 16-bit training is to take a 32-bit baseline and “ make it low-precision ” by replacing all the 32-bit numbers with 16-bit numbers and replacing each 32-bit floating-point op- eration with its 16-bit analog , using nearest rounding1 to quantize as necessary : we call this approach the standard algorithm . Unfortunately , we show empirically that standard pure 16-bit training does not match 32-bit training on model accuracy across deep learning models . For example , the standard pure 16-bit training algorithm one would run on conventional hardware attains 16 % and 7 % lower training and validation accuracies than a 32-bit baseline . Motivated by this observation , we start by analyzing what factors limit the model accuracy of this standard pure 16-bit algorithm . The goal of our analysis is to inspire a clean , minimal set of simple techniques that allow pure 16-bit training to attain strong model accuracy for state-of-the-art deep learning models across application domains . Towards this end , we derive insights from a simple least-squares regression model in Section 3 . Using this least-squares regression model , we reveal that nearest rounding of compute unit outputs causes significant convergence degradation and consequent model accuracy loss . More concretely , we show a key theoretical insight hidden in existing work : when running stochastic gradient descent on a least-squares regression model , nearest rounding while updating model weights ignores small updates . This phenomenon significantly degrades the convergence of stochastic gradient descent when model updates become small relative to model weights , which is also what we observe when training deep learning models . In comparison , nearest rounding in the forward and backward pass of backpropagation has a negligible impact on convergence . These insights lead us to consider two simple existing techniques to achieve high-accuracy pure 16-bit training . First , we can use stochastic rounding instead of nearest rounding for the model weight updates . Here , the rounded weights become an unbiased estimate of the precise weights without rounding : thus , regardless of the magnitude of updates , the expectation of rounded weights converges at the same speed as the precise weights . Second , we can use the well-known Kahan summation algorithm ( Kahan , 1965 ) to accumulate model updates while still keeping nearest rounding for all operations . This method tracks and compensates weight rounding errors across iterations with auxiliary 16-bit values , which avoids catastrophic cancellation of many small model weight updates . Empirically , in Section 4 we first validate that , as suggested by our theory , nearest rounding for model weight updates is the sole bottleneck for convergence and model accuracy on several deep learning models . We then demonstrate that pure 16-bit training using stochastic rounding or Kahan summation on model weight updates can match 32-bit training in model accuracy across a wide range of applications ( He et al. , 2016 ; Amodei et al. , 2016 ; Devlin et al. , 2018 ; Naumov et al. , 2019 ) . To validate that nearest rounding for model weight updates is the cause of the accuracy degradation , we show that if we store model weights in 32-bit precision without rounding during weight updates , and we keep using 16-bits and nearest rounding for all other operations , then the attained model accuracy matches full 32-bit precision training . Next , we demonstrate that 16-bit training with stochastic rounding for weight updates attains model accuracy matching 32-bit training for five out of seven applications in our study . Note that while it works most of the time , this is not a silver bullet , as using stochastic rounding alone could not fully match 32-bit training on all models . To address this , we show that Kahan summation for model weight updates closes remaining gaps on all the models we consider ; this Kahan summation comes with a trade off , as it requires 2⇥ weight memory , but achieves up to 0.2 % higher validation accuracy than stochastic rounding . Our results suggest that deep learning accelerators using only 16-bit compute units are feasible if stochastic rounding and Kahan summation are supported respectively by the hardware and the software stack . 2 PRELIMINARY . In this section we establish the background and notation for our study and present the preliminary observations that motivate our work . We focus on the case of stochastic gradient descent ( SGD ) , which is the primary workhorse used to train deep learning models . SGD computes gradients from a subset of training samples , and uses them to update the model weights so as to decrease the loss in expectation . In the classic supervised learning setting , let ( X , y ) be a dataset where X = [ x1 , x2 , ... , xn ] 2 Rn⇥d and y = ( y1 , y2 , ... , yn ) 2 Rn . On this dataset , we use stochastic gradient descent to optimize a loss function f ( w ) = 1/n Pn i=1 fi ( w , xi , yi ) defined by the model . At the t-th iteration , we sample an index subset ( t ) ⇢ { 1 , 2 , .. , n } and compute a sample gradient rf ( t ) ( wt ) as an unbiased estimate of the full gradient rf ( w ) . In deep learning , model training can be described as a compute graph where the compute graph operators such as addition and ma- 1This nearest rounding is the standard rounding mode for compute unit output commonly supported across hardware platforms ( Intel , 2018 ; Nvidia , 2020 ) . trix multiplication are the nodes . For example , the model weight update operator is defined as the subtraction in the operation wt+1 = wt ↵rf ( t ) ( wt ) which updates the model weight w. 16-bit Compute Units On modern hardware , numerical operators in the compute graph are supported by fused multiply-and-accumulation ( FMAC ) compute units . These units work by computing a a + ( x ⇥ y ) , where x and y are input floating point numbers , and a is an accumulator that is part of the FMAC unit . Importantly , for a 16-bit FMAC unit , the accumulator a has higher-than-16bit precision . This higher precision accumulator is inexpensive compared to the multiply in terms of chip area and energy consumption in FMAC units , but is critical to the numerical accuracy of operations such as matrix multiplication and convolution . Thus 16-bit FMAC units with higher precision accumulator is standard for modern hardware including TPUs and GPUs ( Chao & Saeta , 2019 ; Markidis et al. , 2018 ; Stephens , 2019 ) ; this will likely continue to be standard in emerging accelerators . Because of the higher precision accumulator , the result in the accumulator then needs to be rounded to 16-bits before it is output from the FMAC unit ( e.g . before writing to memory ) . FMAC units use the same hardware implementation to support all operators from simple additions to computationally intensive convolutions , so this output-rounding step happens for all the operators in a compute graph . Nearest Rounding FMAC output rounding is widely implemented with nearest rounding as the standard mode , due to its efficient support across hardware platforms . “ Nearest rounding ” means rounding a higher precision floating point number to the closest low-precision representable value . Given that the add step already uses accurate higher preicision accumulators , this nearest rounding is the primary source of numerical errors for training using 16-bit FMAC units . In this context of 16 bit FMAC units and nearest rounding , we discuss the following training-precision approaches . • In 32-bit precision training , all the compute graph operators read and write memory using a 32- bit precision . These operators require 32-bit compute units , which constrains the compute and memory efficiency . • In mixed precision training , model weights are stored in 32-bit precision while activations and gradients use 16-bit precision . Thus , new accelerators customized to maximize efficiency for mixed precision training still require 32-bit compute units for operators involving 32-bit weights as the input ; this has lower efficiency in power , speed and chip area than only using 16-bit units . • In pure 16-bit training , activation , gradients and model weights are all stored in 16-bit precision . All operators use pure 16-bit input and write out 16-bit output after rounding . Thus , aside from just saving memory , pure 16-bit training can eliminate the requirement for 32-bit compute units . This opens the possibility for highly-efficient accelerators using only 16-bit compute units . In spite of this favorable efficiency , we now show that it can be surprisingly challenging for standard pure 16-bit training to match 32-bit training on model accuracy . Motivating Observations Although recent works have shown that certain models are robust to numerical error during training ( Wang et al. , 2018b ; De Sa et al. , 2015 ; Zhang et al. , 2017 ) , surprisingly , we observe that it is challenging for pure 16-bit training to attain the same accuracy as 32-bit precision training on several state-of-the-art deep learning models . To demonstrate this , we compare 32-bit precision training and standard pure 16-bit training ( using nearest rounding for all its operator outputs ) . For example , Figure 1 illustrates that for a BERT-Base model for natural language inference , the standard pure 16-bit training algorithm demonstrates 16 % and 7 % lower training and validation accuracies than 32-bit precision training2 . This gap suggests that nearest rounding is the primary source of numerical error in pure 16-bit algorithms , significantly degrading the convergence and model accuracy . To alleviate this problem , in Section 3 , we study how nearest rounding impacts convergence , and we expose insights which lead to simple techniques to improve the model accuracy in pure 16-bit training . 2We note that 32-bit and standard 16-bit training in Figure 1 start from the same initialization with the same model accuracy . The gap at the beginning of the two curves is due to curve smoothing for visualization clarity . We refer to Appendix D.1 for the unsmoothed curves which start from the same model accuracy .
This work reinvigorates half precision training as an alternative to either full single precision or mixed half and single precision. The authors demonstrate that the nearest rounding is the culprit for the worse performance of half precision training compared to single precision, due to cancelling small updates. They then propose two known techniques that can mitigate this effect, stochastic rounding and Kahan summation. Empirically, they demonstrate on an extensive suite of tasks that the proposed adjustments lead to half precision performance that is almost on par to single precision.
SP:eee5cfc44781aebad99973ffaaaa0a5c5acecef8
Revisiting BFfloat16 Training
State-of-the-art generic low-precision training algorithms use a mix of 16-bit and 32-bit precision , creating the folklore that 16-bit precision alone is not enough to maximize model accuracy . As a result , deep learning accelerators are forced to support both 16-bit and 32-bit compute units which is more costly than only using 16-bit units for hardware design . We ask can we do pure 16-bit training which requires only 16-bit compute units , while still matching the model accuracy attained by 32-bit training . Towards this end , we study pure 16-bit training algorithms on the widely adopted BFloat16 compute unit . While these units conventionally use nearest rounding to cast output to 16-bit precision , we show that nearest rounding for model weight updates can often cancel small updates , which degrades the convergence and model accuracy . Motivated by this , we identify two simple existing techniques , stochastic rounding and Kahan summation , to remedy the model accuracy degradation in pure 16-bit training . We empirically show that these two techniques can enable up to 7 % absolute validation accuracy gain in pure 16-bit training . This leads to 0.1 % lower to 0.2 % higher matching validation accuracy compared to 32-bit precision training across seven deep learning applications . 1 INTRODUCTION . Recently there has been an explosion in the compute resources required for training deep learning models ( Shoeybi et al. , 2019 ; Rajbhandari et al. , 2019 ; Real et al. , 2019 ) . As a result , there has been broad interest in leveraging low-precision ( < 32-bit ) training algorithms to reduce the required compute resources ( De Sa et al. , 2017 ; Hubara et al. , 2017 ; Gupta et al. , 2015 ) . Among these algorithms , mixed-precision training—in which model activations and gradients are stored using a 16-bit floating point format while model weights and optimizer states use 32-bit precision—is commonly used when training generic deep learning models ( Micikevicius et al. , 2017 ; Kalamkar et al. , 2019 ) . While there is a wide body of literature showing that low-precision training can minimally impact accuracy on specific models ( Wang et al. , 2018b ; De Sa et al. , 2015 ; Zhang et al. , 2017 ) , conventional wisdom suggests that at least some 32-bit computation is required as a fail-safe in generic deep learning training . As such , new accelerator architectures for deep learning are forced to support both 32-bit and 16-bit compute units . This is much more costly in terms of area , power , and speed when compared to hardware with only 16-bit compute units ( Horowitz , 2014 ; Galal et al. , 2013 ) . In this paper we question if 32-bit compute units are truly needed for new deep learning hardware accelerators . Namely , can we match the model accuracy of 32-bit-precision algorithms while leveraging only 16-bit compute units ? To answer this question , we study pure 16-bit training algorithms , ones which use only 16-bit compute units and which store activations , gradients , model weights , and optimizer states all in a 16-bit precision . Specifically , we focus on training with the BFloat16 compute unit which is widely adopted in modern deep learning accelerators ( Jouppi et al. , 2017 ; Burgess et al. , 2019 ) . Such units take 16-bit inputs , perform computation , and then round the results to a 16- bit output . BFloat16 compute units can provide 3⇥ higher power efficiency , 1.5⇥ lower latency , and 1.5⇥ less chip area than 32-bit units ( Horowitz , 2014 ; Galal et al. , 2013 ) . In addition , pure 16-bit training algorithms can reduce the memory footprint and bandwidth consumption of model weights and optimizers by 2⇥ compared to mixed precision or 32-bit precision training , especially for large models with billions of weights ( Shoeybi et al. , 2019 ; Rajbhandari et al. , 2019 ) . Developing reliable pure 16-bit training algorithms will enable hardware designers to realize these advantages . The simplest approach to pure 16-bit training is to take a 32-bit baseline and “ make it low-precision ” by replacing all the 32-bit numbers with 16-bit numbers and replacing each 32-bit floating-point op- eration with its 16-bit analog , using nearest rounding1 to quantize as necessary : we call this approach the standard algorithm . Unfortunately , we show empirically that standard pure 16-bit training does not match 32-bit training on model accuracy across deep learning models . For example , the standard pure 16-bit training algorithm one would run on conventional hardware attains 16 % and 7 % lower training and validation accuracies than a 32-bit baseline . Motivated by this observation , we start by analyzing what factors limit the model accuracy of this standard pure 16-bit algorithm . The goal of our analysis is to inspire a clean , minimal set of simple techniques that allow pure 16-bit training to attain strong model accuracy for state-of-the-art deep learning models across application domains . Towards this end , we derive insights from a simple least-squares regression model in Section 3 . Using this least-squares regression model , we reveal that nearest rounding of compute unit outputs causes significant convergence degradation and consequent model accuracy loss . More concretely , we show a key theoretical insight hidden in existing work : when running stochastic gradient descent on a least-squares regression model , nearest rounding while updating model weights ignores small updates . This phenomenon significantly degrades the convergence of stochastic gradient descent when model updates become small relative to model weights , which is also what we observe when training deep learning models . In comparison , nearest rounding in the forward and backward pass of backpropagation has a negligible impact on convergence . These insights lead us to consider two simple existing techniques to achieve high-accuracy pure 16-bit training . First , we can use stochastic rounding instead of nearest rounding for the model weight updates . Here , the rounded weights become an unbiased estimate of the precise weights without rounding : thus , regardless of the magnitude of updates , the expectation of rounded weights converges at the same speed as the precise weights . Second , we can use the well-known Kahan summation algorithm ( Kahan , 1965 ) to accumulate model updates while still keeping nearest rounding for all operations . This method tracks and compensates weight rounding errors across iterations with auxiliary 16-bit values , which avoids catastrophic cancellation of many small model weight updates . Empirically , in Section 4 we first validate that , as suggested by our theory , nearest rounding for model weight updates is the sole bottleneck for convergence and model accuracy on several deep learning models . We then demonstrate that pure 16-bit training using stochastic rounding or Kahan summation on model weight updates can match 32-bit training in model accuracy across a wide range of applications ( He et al. , 2016 ; Amodei et al. , 2016 ; Devlin et al. , 2018 ; Naumov et al. , 2019 ) . To validate that nearest rounding for model weight updates is the cause of the accuracy degradation , we show that if we store model weights in 32-bit precision without rounding during weight updates , and we keep using 16-bits and nearest rounding for all other operations , then the attained model accuracy matches full 32-bit precision training . Next , we demonstrate that 16-bit training with stochastic rounding for weight updates attains model accuracy matching 32-bit training for five out of seven applications in our study . Note that while it works most of the time , this is not a silver bullet , as using stochastic rounding alone could not fully match 32-bit training on all models . To address this , we show that Kahan summation for model weight updates closes remaining gaps on all the models we consider ; this Kahan summation comes with a trade off , as it requires 2⇥ weight memory , but achieves up to 0.2 % higher validation accuracy than stochastic rounding . Our results suggest that deep learning accelerators using only 16-bit compute units are feasible if stochastic rounding and Kahan summation are supported respectively by the hardware and the software stack . 2 PRELIMINARY . In this section we establish the background and notation for our study and present the preliminary observations that motivate our work . We focus on the case of stochastic gradient descent ( SGD ) , which is the primary workhorse used to train deep learning models . SGD computes gradients from a subset of training samples , and uses them to update the model weights so as to decrease the loss in expectation . In the classic supervised learning setting , let ( X , y ) be a dataset where X = [ x1 , x2 , ... , xn ] 2 Rn⇥d and y = ( y1 , y2 , ... , yn ) 2 Rn . On this dataset , we use stochastic gradient descent to optimize a loss function f ( w ) = 1/n Pn i=1 fi ( w , xi , yi ) defined by the model . At the t-th iteration , we sample an index subset ( t ) ⇢ { 1 , 2 , .. , n } and compute a sample gradient rf ( t ) ( wt ) as an unbiased estimate of the full gradient rf ( w ) . In deep learning , model training can be described as a compute graph where the compute graph operators such as addition and ma- 1This nearest rounding is the standard rounding mode for compute unit output commonly supported across hardware platforms ( Intel , 2018 ; Nvidia , 2020 ) . trix multiplication are the nodes . For example , the model weight update operator is defined as the subtraction in the operation wt+1 = wt ↵rf ( t ) ( wt ) which updates the model weight w. 16-bit Compute Units On modern hardware , numerical operators in the compute graph are supported by fused multiply-and-accumulation ( FMAC ) compute units . These units work by computing a a + ( x ⇥ y ) , where x and y are input floating point numbers , and a is an accumulator that is part of the FMAC unit . Importantly , for a 16-bit FMAC unit , the accumulator a has higher-than-16bit precision . This higher precision accumulator is inexpensive compared to the multiply in terms of chip area and energy consumption in FMAC units , but is critical to the numerical accuracy of operations such as matrix multiplication and convolution . Thus 16-bit FMAC units with higher precision accumulator is standard for modern hardware including TPUs and GPUs ( Chao & Saeta , 2019 ; Markidis et al. , 2018 ; Stephens , 2019 ) ; this will likely continue to be standard in emerging accelerators . Because of the higher precision accumulator , the result in the accumulator then needs to be rounded to 16-bits before it is output from the FMAC unit ( e.g . before writing to memory ) . FMAC units use the same hardware implementation to support all operators from simple additions to computationally intensive convolutions , so this output-rounding step happens for all the operators in a compute graph . Nearest Rounding FMAC output rounding is widely implemented with nearest rounding as the standard mode , due to its efficient support across hardware platforms . “ Nearest rounding ” means rounding a higher precision floating point number to the closest low-precision representable value . Given that the add step already uses accurate higher preicision accumulators , this nearest rounding is the primary source of numerical errors for training using 16-bit FMAC units . In this context of 16 bit FMAC units and nearest rounding , we discuss the following training-precision approaches . • In 32-bit precision training , all the compute graph operators read and write memory using a 32- bit precision . These operators require 32-bit compute units , which constrains the compute and memory efficiency . • In mixed precision training , model weights are stored in 32-bit precision while activations and gradients use 16-bit precision . Thus , new accelerators customized to maximize efficiency for mixed precision training still require 32-bit compute units for operators involving 32-bit weights as the input ; this has lower efficiency in power , speed and chip area than only using 16-bit units . • In pure 16-bit training , activation , gradients and model weights are all stored in 16-bit precision . All operators use pure 16-bit input and write out 16-bit output after rounding . Thus , aside from just saving memory , pure 16-bit training can eliminate the requirement for 32-bit compute units . This opens the possibility for highly-efficient accelerators using only 16-bit compute units . In spite of this favorable efficiency , we now show that it can be surprisingly challenging for standard pure 16-bit training to match 32-bit training on model accuracy . Motivating Observations Although recent works have shown that certain models are robust to numerical error during training ( Wang et al. , 2018b ; De Sa et al. , 2015 ; Zhang et al. , 2017 ) , surprisingly , we observe that it is challenging for pure 16-bit training to attain the same accuracy as 32-bit precision training on several state-of-the-art deep learning models . To demonstrate this , we compare 32-bit precision training and standard pure 16-bit training ( using nearest rounding for all its operator outputs ) . For example , Figure 1 illustrates that for a BERT-Base model for natural language inference , the standard pure 16-bit training algorithm demonstrates 16 % and 7 % lower training and validation accuracies than 32-bit precision training2 . This gap suggests that nearest rounding is the primary source of numerical error in pure 16-bit algorithms , significantly degrading the convergence and model accuracy . To alleviate this problem , in Section 3 , we study how nearest rounding impacts convergence , and we expose insights which lead to simple techniques to improve the model accuracy in pure 16-bit training . 2We note that 32-bit and standard 16-bit training in Figure 1 start from the same initialization with the same model accuracy . The gap at the beginning of the two curves is due to curve smoothing for visualization clarity . We refer to Appendix D.1 for the unsmoothed curves which start from the same model accuracy .
This paper explores the possibilities of reducing the precision of the weight update operation (i.e. AXPY ops) from 32 bit to 16 bit in today’s BFloat16 training framework. To enable 16 bit update, the authors proposed two techniques, i.e. stochastic rounding and Kahan summation. The authors use a simple least-squares regression model to theoretically explain the model accuracy degradation due to nearest rounding, then experimentally demonstrate the effectiveness of two techniques on a range of deep learning models and dataset.
SP:eee5cfc44781aebad99973ffaaaa0a5c5acecef8
Revisiting BFfloat16 Training
State-of-the-art generic low-precision training algorithms use a mix of 16-bit and 32-bit precision , creating the folklore that 16-bit precision alone is not enough to maximize model accuracy . As a result , deep learning accelerators are forced to support both 16-bit and 32-bit compute units which is more costly than only using 16-bit units for hardware design . We ask can we do pure 16-bit training which requires only 16-bit compute units , while still matching the model accuracy attained by 32-bit training . Towards this end , we study pure 16-bit training algorithms on the widely adopted BFloat16 compute unit . While these units conventionally use nearest rounding to cast output to 16-bit precision , we show that nearest rounding for model weight updates can often cancel small updates , which degrades the convergence and model accuracy . Motivated by this , we identify two simple existing techniques , stochastic rounding and Kahan summation , to remedy the model accuracy degradation in pure 16-bit training . We empirically show that these two techniques can enable up to 7 % absolute validation accuracy gain in pure 16-bit training . This leads to 0.1 % lower to 0.2 % higher matching validation accuracy compared to 32-bit precision training across seven deep learning applications . 1 INTRODUCTION . Recently there has been an explosion in the compute resources required for training deep learning models ( Shoeybi et al. , 2019 ; Rajbhandari et al. , 2019 ; Real et al. , 2019 ) . As a result , there has been broad interest in leveraging low-precision ( < 32-bit ) training algorithms to reduce the required compute resources ( De Sa et al. , 2017 ; Hubara et al. , 2017 ; Gupta et al. , 2015 ) . Among these algorithms , mixed-precision training—in which model activations and gradients are stored using a 16-bit floating point format while model weights and optimizer states use 32-bit precision—is commonly used when training generic deep learning models ( Micikevicius et al. , 2017 ; Kalamkar et al. , 2019 ) . While there is a wide body of literature showing that low-precision training can minimally impact accuracy on specific models ( Wang et al. , 2018b ; De Sa et al. , 2015 ; Zhang et al. , 2017 ) , conventional wisdom suggests that at least some 32-bit computation is required as a fail-safe in generic deep learning training . As such , new accelerator architectures for deep learning are forced to support both 32-bit and 16-bit compute units . This is much more costly in terms of area , power , and speed when compared to hardware with only 16-bit compute units ( Horowitz , 2014 ; Galal et al. , 2013 ) . In this paper we question if 32-bit compute units are truly needed for new deep learning hardware accelerators . Namely , can we match the model accuracy of 32-bit-precision algorithms while leveraging only 16-bit compute units ? To answer this question , we study pure 16-bit training algorithms , ones which use only 16-bit compute units and which store activations , gradients , model weights , and optimizer states all in a 16-bit precision . Specifically , we focus on training with the BFloat16 compute unit which is widely adopted in modern deep learning accelerators ( Jouppi et al. , 2017 ; Burgess et al. , 2019 ) . Such units take 16-bit inputs , perform computation , and then round the results to a 16- bit output . BFloat16 compute units can provide 3⇥ higher power efficiency , 1.5⇥ lower latency , and 1.5⇥ less chip area than 32-bit units ( Horowitz , 2014 ; Galal et al. , 2013 ) . In addition , pure 16-bit training algorithms can reduce the memory footprint and bandwidth consumption of model weights and optimizers by 2⇥ compared to mixed precision or 32-bit precision training , especially for large models with billions of weights ( Shoeybi et al. , 2019 ; Rajbhandari et al. , 2019 ) . Developing reliable pure 16-bit training algorithms will enable hardware designers to realize these advantages . The simplest approach to pure 16-bit training is to take a 32-bit baseline and “ make it low-precision ” by replacing all the 32-bit numbers with 16-bit numbers and replacing each 32-bit floating-point op- eration with its 16-bit analog , using nearest rounding1 to quantize as necessary : we call this approach the standard algorithm . Unfortunately , we show empirically that standard pure 16-bit training does not match 32-bit training on model accuracy across deep learning models . For example , the standard pure 16-bit training algorithm one would run on conventional hardware attains 16 % and 7 % lower training and validation accuracies than a 32-bit baseline . Motivated by this observation , we start by analyzing what factors limit the model accuracy of this standard pure 16-bit algorithm . The goal of our analysis is to inspire a clean , minimal set of simple techniques that allow pure 16-bit training to attain strong model accuracy for state-of-the-art deep learning models across application domains . Towards this end , we derive insights from a simple least-squares regression model in Section 3 . Using this least-squares regression model , we reveal that nearest rounding of compute unit outputs causes significant convergence degradation and consequent model accuracy loss . More concretely , we show a key theoretical insight hidden in existing work : when running stochastic gradient descent on a least-squares regression model , nearest rounding while updating model weights ignores small updates . This phenomenon significantly degrades the convergence of stochastic gradient descent when model updates become small relative to model weights , which is also what we observe when training deep learning models . In comparison , nearest rounding in the forward and backward pass of backpropagation has a negligible impact on convergence . These insights lead us to consider two simple existing techniques to achieve high-accuracy pure 16-bit training . First , we can use stochastic rounding instead of nearest rounding for the model weight updates . Here , the rounded weights become an unbiased estimate of the precise weights without rounding : thus , regardless of the magnitude of updates , the expectation of rounded weights converges at the same speed as the precise weights . Second , we can use the well-known Kahan summation algorithm ( Kahan , 1965 ) to accumulate model updates while still keeping nearest rounding for all operations . This method tracks and compensates weight rounding errors across iterations with auxiliary 16-bit values , which avoids catastrophic cancellation of many small model weight updates . Empirically , in Section 4 we first validate that , as suggested by our theory , nearest rounding for model weight updates is the sole bottleneck for convergence and model accuracy on several deep learning models . We then demonstrate that pure 16-bit training using stochastic rounding or Kahan summation on model weight updates can match 32-bit training in model accuracy across a wide range of applications ( He et al. , 2016 ; Amodei et al. , 2016 ; Devlin et al. , 2018 ; Naumov et al. , 2019 ) . To validate that nearest rounding for model weight updates is the cause of the accuracy degradation , we show that if we store model weights in 32-bit precision without rounding during weight updates , and we keep using 16-bits and nearest rounding for all other operations , then the attained model accuracy matches full 32-bit precision training . Next , we demonstrate that 16-bit training with stochastic rounding for weight updates attains model accuracy matching 32-bit training for five out of seven applications in our study . Note that while it works most of the time , this is not a silver bullet , as using stochastic rounding alone could not fully match 32-bit training on all models . To address this , we show that Kahan summation for model weight updates closes remaining gaps on all the models we consider ; this Kahan summation comes with a trade off , as it requires 2⇥ weight memory , but achieves up to 0.2 % higher validation accuracy than stochastic rounding . Our results suggest that deep learning accelerators using only 16-bit compute units are feasible if stochastic rounding and Kahan summation are supported respectively by the hardware and the software stack . 2 PRELIMINARY . In this section we establish the background and notation for our study and present the preliminary observations that motivate our work . We focus on the case of stochastic gradient descent ( SGD ) , which is the primary workhorse used to train deep learning models . SGD computes gradients from a subset of training samples , and uses them to update the model weights so as to decrease the loss in expectation . In the classic supervised learning setting , let ( X , y ) be a dataset where X = [ x1 , x2 , ... , xn ] 2 Rn⇥d and y = ( y1 , y2 , ... , yn ) 2 Rn . On this dataset , we use stochastic gradient descent to optimize a loss function f ( w ) = 1/n Pn i=1 fi ( w , xi , yi ) defined by the model . At the t-th iteration , we sample an index subset ( t ) ⇢ { 1 , 2 , .. , n } and compute a sample gradient rf ( t ) ( wt ) as an unbiased estimate of the full gradient rf ( w ) . In deep learning , model training can be described as a compute graph where the compute graph operators such as addition and ma- 1This nearest rounding is the standard rounding mode for compute unit output commonly supported across hardware platforms ( Intel , 2018 ; Nvidia , 2020 ) . trix multiplication are the nodes . For example , the model weight update operator is defined as the subtraction in the operation wt+1 = wt ↵rf ( t ) ( wt ) which updates the model weight w. 16-bit Compute Units On modern hardware , numerical operators in the compute graph are supported by fused multiply-and-accumulation ( FMAC ) compute units . These units work by computing a a + ( x ⇥ y ) , where x and y are input floating point numbers , and a is an accumulator that is part of the FMAC unit . Importantly , for a 16-bit FMAC unit , the accumulator a has higher-than-16bit precision . This higher precision accumulator is inexpensive compared to the multiply in terms of chip area and energy consumption in FMAC units , but is critical to the numerical accuracy of operations such as matrix multiplication and convolution . Thus 16-bit FMAC units with higher precision accumulator is standard for modern hardware including TPUs and GPUs ( Chao & Saeta , 2019 ; Markidis et al. , 2018 ; Stephens , 2019 ) ; this will likely continue to be standard in emerging accelerators . Because of the higher precision accumulator , the result in the accumulator then needs to be rounded to 16-bits before it is output from the FMAC unit ( e.g . before writing to memory ) . FMAC units use the same hardware implementation to support all operators from simple additions to computationally intensive convolutions , so this output-rounding step happens for all the operators in a compute graph . Nearest Rounding FMAC output rounding is widely implemented with nearest rounding as the standard mode , due to its efficient support across hardware platforms . “ Nearest rounding ” means rounding a higher precision floating point number to the closest low-precision representable value . Given that the add step already uses accurate higher preicision accumulators , this nearest rounding is the primary source of numerical errors for training using 16-bit FMAC units . In this context of 16 bit FMAC units and nearest rounding , we discuss the following training-precision approaches . • In 32-bit precision training , all the compute graph operators read and write memory using a 32- bit precision . These operators require 32-bit compute units , which constrains the compute and memory efficiency . • In mixed precision training , model weights are stored in 32-bit precision while activations and gradients use 16-bit precision . Thus , new accelerators customized to maximize efficiency for mixed precision training still require 32-bit compute units for operators involving 32-bit weights as the input ; this has lower efficiency in power , speed and chip area than only using 16-bit units . • In pure 16-bit training , activation , gradients and model weights are all stored in 16-bit precision . All operators use pure 16-bit input and write out 16-bit output after rounding . Thus , aside from just saving memory , pure 16-bit training can eliminate the requirement for 32-bit compute units . This opens the possibility for highly-efficient accelerators using only 16-bit compute units . In spite of this favorable efficiency , we now show that it can be surprisingly challenging for standard pure 16-bit training to match 32-bit training on model accuracy . Motivating Observations Although recent works have shown that certain models are robust to numerical error during training ( Wang et al. , 2018b ; De Sa et al. , 2015 ; Zhang et al. , 2017 ) , surprisingly , we observe that it is challenging for pure 16-bit training to attain the same accuracy as 32-bit precision training on several state-of-the-art deep learning models . To demonstrate this , we compare 32-bit precision training and standard pure 16-bit training ( using nearest rounding for all its operator outputs ) . For example , Figure 1 illustrates that for a BERT-Base model for natural language inference , the standard pure 16-bit training algorithm demonstrates 16 % and 7 % lower training and validation accuracies than 32-bit precision training2 . This gap suggests that nearest rounding is the primary source of numerical error in pure 16-bit algorithms , significantly degrading the convergence and model accuracy . To alleviate this problem , in Section 3 , we study how nearest rounding impacts convergence , and we expose insights which lead to simple techniques to improve the model accuracy in pure 16-bit training . 2We note that 32-bit and standard 16-bit training in Figure 1 start from the same initialization with the same model accuracy . The gap at the beginning of the two curves is due to curve smoothing for visualization clarity . We refer to Appendix D.1 for the unsmoothed curves which start from the same model accuracy .
I think the use of QPyTorch for the experiments here invalidates the results since the intermediate matrix multiplies are done in single precision (FP32), and so are more optimistic than a pure 16-bit implementation. (This is both according to the authors Sec 4, experiment setup; and according to the QPyTorch paper arxiv:1910.04540, Sec 3 intro.) For these kinds of experiments to be meaningful, they have to be done on native 16-bit hardware which luckily is becoming more common, e.g., Google's TPUs or the newer NVIDIA GPUs.
SP:eee5cfc44781aebad99973ffaaaa0a5c5acecef8
Accurate and fast detection of copy number variations from short-read whole-genome sequencing with deep convolutional neural network
1 INTRODUCTION . A copy number variant ( CNV ) is a genetic mutation where a stretch of DNA is completely lost or repeated more than once compared to a reference genome . CNV sizes range from 50 bases to 3 million bases or more with two major types : duplication if the DNA sequence is repeated and deletion if a DNA sequence is missing . CNVs are spread along a genome , which account for 4.8 % to 9.5 % of human genome ( Zarrei et al. , 2015 ) . They are known to influence many complex diseases including autism ( Sebat et al. , 2007 ) , bipolar disorder ( Green et al. , 2016 ) , schizophrenia ( Stefansson et al. , 2008 ) , and Alzheimer ’ disease ( Cuccaro et al. , 2017 ) as well as gene expression ( Chiang et al. , 2017 ) . As CNVs may overlap with a large portion of a genome , such as one gene or even multiple genes , their effect on disease may be substantially larger than that of single nucleotide variants , and hence CNVs often play important roles in the genetic mechanisms of diseases and complex traits . With the advent of next-generation DNA sequencing technologies over the past decade , the resolution and scale of CNV detection has been greatly improved as large-scale sequencing studies become feasible . However , CNVs are still challenging to detect from short-read next-generation DNA sequencing techniques due to the significantly varying sizes of CNVs and their similarity with common DNA sequencing artifacts . Many computational methods have been developed for the discovery of CNVs from short-read DNA sequencing data , but their performance is often unsatisfactory due to low accuracy and high computational cost ( Kosugi et al. , 2019 ) . The main reason for this is that previous methods ( Rausch et al. , 2012 ; Abyzov et al. , 2011 ) mainly rely on the statistical analysis of the signals from read alignments ( a process that maps reads from DNA sequencing data to the reference genome ) , which often fail to employ all useful features of DNA sequencing data and require significant computational resources . Therefore , there is a need for a novel , sophisticated computational tool to improve CNV detection with higher accuracy and efficiency . Here , we present CNV-Net , a new approach to identify CNVs from DNA sequencing data using a six-layer deep convolutional neural network ( CNN ) . CNV-Net first encodes the reads and their related information from DNA sequencing data such as the type of base , base coverage ( the number of reads covering a position ) , and base quality of each position into the RGB channels of images . Then it uses a deep CNN to predict these images as deletions , duplications , or false positives ( not a CNV ) breakpoints . Note that a CNV is defined by two breakpoints , that is , its start and end positions . Although it has been shown that CNNs such as DeepVariant ( Poplin et al. , 2018 ) and Clairvoyante ( Luo et al. , 2019 ) can accurately detect single nucleotide variants from similarly encoded images or tensors , few CNNs have been designed for the identification of CNVs . The key advantage of CNVNet over other methods is the application of deep learning , which allows learning features with higher complexity from DNA sequencing data . We train the network with the Genome in a Bottle Consortium NA12878 dataset ( Pendleton et al. , 2015 ) , and demonstrate CNV-Net performance on a high-quality benchmarking dataset acquired from a well-studied cell line , HG002 ( Zook et al. , 2020 ) . We also compare its performance to that of previous methods . 2 METHODS . CNV-Net first encodes sequencing information into pileup images and classifies each image as a deletion , duplication , or false positive ( not a CNV ) . In this section , we describe how we generate pileup images , that is , the input to CNV-Net , as well as the design of the CNN . 2.1 PILEUP IMAGE GENERATION . We convert the information of mapped reads from DNA sequencing data ( provided in BAM file format ) and reference genome information to 201×55 pixel image representation of 201-base wide regions . Training data pileup images contain a CNV breakpoint ( start or end position ) centered in the image , capturing the 100 positions left and right each CNV breakpoint . Using the RGB channels of an image , this snapshot is able to capture features of the reads at specific locations in the reference genome . As shown in Figure 1 , the first five rows of the image capture the reference genome across a region of 201 base pairs by encoding the R channel of each pixel with an individual base in that position : A ’ s as 250 , G ’ s as 180 , T ’ s as 100 , C ’ s as 30 , and N ’ s as 0 . Under the five rows representing the reference genome are another five rows that capture the read depth ( coverage ) at that position . The R and G channels are encoded with an adjusted read depth value between 0 and 255 . The following 45 rows capture the mapped reads from DNA sequencing . The R channel encodes for the nucleotide , which is the same as the reference genome , and the G channel encodes for the base quality found in the BAM file , which is adjusted to be between 0 and 255 . Lastly , the B channel encodes for strand directionality : 70 if positive and 240 if negative . Each 201×55 pixel pileup image , thus , captures coverage and reads specific to the 201-base region of the reference genome such that the sequencing data may be re-created from a series of consecutive pileup images . If there are more than 45 reads mapping to a specific region , those reads are discarded ; we instead compensate by capturing this information through the rows that encodes coverage . If no reads map to the region , the image is left blank below the first five rows for the reference genome . 2.2 DESIGN OF CONVOLUTIONAL NEURAL NETWORK . As presented in Figure 2 , CNV-Net consists of four convolutional layers and two fully connected layers with a total of 5,110,979 parameters . Each of the four convolutional layers uses 3×3 kernels and the RELU activation function . Each convolutional layer is followed by batch normalization , average pooling , and 0.4 dropout . Arrays are flattened in between the four convolutional layers and two fully connected layers followed by softmax output to predictions for CNV breakpoint presence in the 201-base window : duplication , deletion , or false positive ( not a CNV ) . In training CNV-net , we use a standard Adam optimizer ( Kingma & Ba , 2014 ) with a sparse categorical cross-entropy loss function . We use a cyclical learning rate initialized at 1e-5 and maximal 1e-2 . To reduce overfitting , we train the model until the accuracy can not be improved in 15 epochs . The 201-base regions are centered around the CNV breakpoints , that is , the starts and ends of CNVs in the training set capturing the 100 positions directly before and after each CNV breakpoint . False positive images include random 201-base regions outside of CNVs . From the NA12878 dataset , a total of 52,243 pileup images are labeled as duplications , deletions , and false positives from the training set randomly split into 70 % , 20 % , 10 % categories for training set , validation set , and test set for the network , respectively . 3 RESULTS . In this study , we use two standard structural variation benchmarking datasets : NA12878 and HG002 . Both these benchmarking datasets are mapped to the GRCh37 reference genome . NA12878 is a well-studied genome provided by the Genome in a Bottle Consortium . It is whole-genome sequenced with 50× coverage and each read in the sequencing data is 101 bases long . From the NA12878 image dataset ( Pendleton et al. , 2015 ) , we generate images for 22,936 duplications , 18,614 deletions , and 10,693 false positives ( not CNVs ) breakpoints . The HG002 dataset ( Zook et al. , 2020 ) is another robust benchmarking dataset derived by the Genome in a Bottle Consortium , which is sequenced with 60× coverage . Reads in the HG002 dataset are all 148 bases long . As we only consider CNVs passing the quality control filter , this dataset contains 174 duplications , 10,668 deletions , and 5,205 false positives breakpoints post-filtering . We train the convolutional neural network on the NA12878 dataset and test the fitted model on the HG002 dataset . We also compare CNV-Net with popular existing tools for CNV detection , including BreakDancer ( Chen et al. , 2009 ) , CNVnator ( Abyzov et al. , 2011 ) , Delly ( Rausch et al. , 2012 ) , Lumpy ( Layer et al. , 2014 ) , and Manta ( Chen et al. , 2016 ) . It is important to note that CNVNet makes predictions using the pileup images of CNVs where their start and end positions are given , and hence we assume that candidate CNV positions are given as input to CNV-Net . However , other methods find the candidate CNV positions using the information on how reads are mapped to the reference genome and detect CNVs on those candidate CNV positions . The NA12878 dataset is preprocessed and converted into RGB images as described in the Methods section . We split the CNVs in NA12878 into 70 % , 20 % , 10 % for training set , validation set , and test set , respectively . We train the CNV-Net with the training set and report its performance metrics on the test set . As shown in Table 1 , CNV-Net identifies duplications with F1-score of 0.7833 , deletions with F1-score of 0.7473 , and false positives with F1-score of 0.7124 . This result shows that CNV-Net achieves high accuracy in the test set of the NA12878 dataset . Next , we evaluate our fitted CNV-Net on the HG002 dataset and compare it with five existing tools for CNV detection . This training scheme represents the real data analysis as we will train CNVNet with CNVs from known genomes and testing it on different genomes . As demonstrated in Table 2 , CNV-Net achieves the highest F1-score in CNV detection in the HG002 dataset among all six methods . It also has the highest recall and the second highest precision . This result shows that CNV-Net is more accurate in CNV detection than current methods . We then compare the time cost of applying different methods to the HG002 dataset . CNV-Net is significantly faster than other methods ( Table 3 ) . That is because a fitted convolutional neural network is efficient in making predictions , however , it may be time-consuming during model training . Run time is effectively front-loaded into model training instead of a concurrent statistical analysis . Another reason for this can be that CNV-Net makes predictions on candidate CNVs so it does not need to spend time searching for candidate CNVs in DNA sequencing data as if other methods do . 4 CONCLUSION . CNV-Net encodes DNA sequencing information into RGB images and applies a deep convolutional neural network to learn complex features from DNA sequencing data to discover CNVs . We demonstrate that CNV-Net can detect CNVs breakpoints from DNA sequencing data with significantly higher accuracy and efficiency than existing tools . To the best of our knowledge , CNV-Net is the first tool to use a CNN to detect CNVs from DNA sequencing data and achieve high performance on the standard benchmarks . It changes the problem of CNV detection from a process of statistical modeling requiring professional expertise into a process of optimizing a general deep learning model . Besides , although we benchmark CNV-Net using only human samples in this study , it can also be applied to DNA sequencing data of other species . One limitation of CNV-Net is its need to know candidate CNV positions , potential start and end positions of CNVs , before applying the CNN . This is because CNV-Net makes predictions on pileup images generated at the start and end positions of candidate CNVs . In our analysis , we used candidate CNV positions in human genomes , which were previously identified by the Genome in a Bottle Consortium using a suite of other algorithms . In genome sequencing datasets where CNVs have not been analyzed , these candidate CNV positions may not be available . One solution to this problem may be using candidate CNV positions detected by other CNV detection algorithms , especially algorithms with high recall , as CNV-Net can remove false positive CNVs from those CNV positions . Additionally , we may also develop a sensitive candidate CNV detection algorithm , which may have low precision but high recall . Our future research direction involves identifying candidate CNV positions from genome sequencing datasets and incorporating them with CNV-Net ; nevertheless , CNV-Net demonstrates potential as a valuable and effective tool for CNV detection .
The authors proposed CNV-Net, a deep learning-based approach for copy number variation identification. They encoded mapped DNA sequences into a pileup image that captures reference sequence, sequencing coverage, and mapped reads. Then, they used CNNs to classify it into deletions, duplications, or non-breakpoints. They benchmarked CNV-Net with two whole-genome sequencing datasets and claimed to obtain more accurate and efficient results than current tools.
SP:93cd389d63117a27a7f152c06bfb32a123e73377
Accurate and fast detection of copy number variations from short-read whole-genome sequencing with deep convolutional neural network
1 INTRODUCTION . A copy number variant ( CNV ) is a genetic mutation where a stretch of DNA is completely lost or repeated more than once compared to a reference genome . CNV sizes range from 50 bases to 3 million bases or more with two major types : duplication if the DNA sequence is repeated and deletion if a DNA sequence is missing . CNVs are spread along a genome , which account for 4.8 % to 9.5 % of human genome ( Zarrei et al. , 2015 ) . They are known to influence many complex diseases including autism ( Sebat et al. , 2007 ) , bipolar disorder ( Green et al. , 2016 ) , schizophrenia ( Stefansson et al. , 2008 ) , and Alzheimer ’ disease ( Cuccaro et al. , 2017 ) as well as gene expression ( Chiang et al. , 2017 ) . As CNVs may overlap with a large portion of a genome , such as one gene or even multiple genes , their effect on disease may be substantially larger than that of single nucleotide variants , and hence CNVs often play important roles in the genetic mechanisms of diseases and complex traits . With the advent of next-generation DNA sequencing technologies over the past decade , the resolution and scale of CNV detection has been greatly improved as large-scale sequencing studies become feasible . However , CNVs are still challenging to detect from short-read next-generation DNA sequencing techniques due to the significantly varying sizes of CNVs and their similarity with common DNA sequencing artifacts . Many computational methods have been developed for the discovery of CNVs from short-read DNA sequencing data , but their performance is often unsatisfactory due to low accuracy and high computational cost ( Kosugi et al. , 2019 ) . The main reason for this is that previous methods ( Rausch et al. , 2012 ; Abyzov et al. , 2011 ) mainly rely on the statistical analysis of the signals from read alignments ( a process that maps reads from DNA sequencing data to the reference genome ) , which often fail to employ all useful features of DNA sequencing data and require significant computational resources . Therefore , there is a need for a novel , sophisticated computational tool to improve CNV detection with higher accuracy and efficiency . Here , we present CNV-Net , a new approach to identify CNVs from DNA sequencing data using a six-layer deep convolutional neural network ( CNN ) . CNV-Net first encodes the reads and their related information from DNA sequencing data such as the type of base , base coverage ( the number of reads covering a position ) , and base quality of each position into the RGB channels of images . Then it uses a deep CNN to predict these images as deletions , duplications , or false positives ( not a CNV ) breakpoints . Note that a CNV is defined by two breakpoints , that is , its start and end positions . Although it has been shown that CNNs such as DeepVariant ( Poplin et al. , 2018 ) and Clairvoyante ( Luo et al. , 2019 ) can accurately detect single nucleotide variants from similarly encoded images or tensors , few CNNs have been designed for the identification of CNVs . The key advantage of CNVNet over other methods is the application of deep learning , which allows learning features with higher complexity from DNA sequencing data . We train the network with the Genome in a Bottle Consortium NA12878 dataset ( Pendleton et al. , 2015 ) , and demonstrate CNV-Net performance on a high-quality benchmarking dataset acquired from a well-studied cell line , HG002 ( Zook et al. , 2020 ) . We also compare its performance to that of previous methods . 2 METHODS . CNV-Net first encodes sequencing information into pileup images and classifies each image as a deletion , duplication , or false positive ( not a CNV ) . In this section , we describe how we generate pileup images , that is , the input to CNV-Net , as well as the design of the CNN . 2.1 PILEUP IMAGE GENERATION . We convert the information of mapped reads from DNA sequencing data ( provided in BAM file format ) and reference genome information to 201×55 pixel image representation of 201-base wide regions . Training data pileup images contain a CNV breakpoint ( start or end position ) centered in the image , capturing the 100 positions left and right each CNV breakpoint . Using the RGB channels of an image , this snapshot is able to capture features of the reads at specific locations in the reference genome . As shown in Figure 1 , the first five rows of the image capture the reference genome across a region of 201 base pairs by encoding the R channel of each pixel with an individual base in that position : A ’ s as 250 , G ’ s as 180 , T ’ s as 100 , C ’ s as 30 , and N ’ s as 0 . Under the five rows representing the reference genome are another five rows that capture the read depth ( coverage ) at that position . The R and G channels are encoded with an adjusted read depth value between 0 and 255 . The following 45 rows capture the mapped reads from DNA sequencing . The R channel encodes for the nucleotide , which is the same as the reference genome , and the G channel encodes for the base quality found in the BAM file , which is adjusted to be between 0 and 255 . Lastly , the B channel encodes for strand directionality : 70 if positive and 240 if negative . Each 201×55 pixel pileup image , thus , captures coverage and reads specific to the 201-base region of the reference genome such that the sequencing data may be re-created from a series of consecutive pileup images . If there are more than 45 reads mapping to a specific region , those reads are discarded ; we instead compensate by capturing this information through the rows that encodes coverage . If no reads map to the region , the image is left blank below the first five rows for the reference genome . 2.2 DESIGN OF CONVOLUTIONAL NEURAL NETWORK . As presented in Figure 2 , CNV-Net consists of four convolutional layers and two fully connected layers with a total of 5,110,979 parameters . Each of the four convolutional layers uses 3×3 kernels and the RELU activation function . Each convolutional layer is followed by batch normalization , average pooling , and 0.4 dropout . Arrays are flattened in between the four convolutional layers and two fully connected layers followed by softmax output to predictions for CNV breakpoint presence in the 201-base window : duplication , deletion , or false positive ( not a CNV ) . In training CNV-net , we use a standard Adam optimizer ( Kingma & Ba , 2014 ) with a sparse categorical cross-entropy loss function . We use a cyclical learning rate initialized at 1e-5 and maximal 1e-2 . To reduce overfitting , we train the model until the accuracy can not be improved in 15 epochs . The 201-base regions are centered around the CNV breakpoints , that is , the starts and ends of CNVs in the training set capturing the 100 positions directly before and after each CNV breakpoint . False positive images include random 201-base regions outside of CNVs . From the NA12878 dataset , a total of 52,243 pileup images are labeled as duplications , deletions , and false positives from the training set randomly split into 70 % , 20 % , 10 % categories for training set , validation set , and test set for the network , respectively . 3 RESULTS . In this study , we use two standard structural variation benchmarking datasets : NA12878 and HG002 . Both these benchmarking datasets are mapped to the GRCh37 reference genome . NA12878 is a well-studied genome provided by the Genome in a Bottle Consortium . It is whole-genome sequenced with 50× coverage and each read in the sequencing data is 101 bases long . From the NA12878 image dataset ( Pendleton et al. , 2015 ) , we generate images for 22,936 duplications , 18,614 deletions , and 10,693 false positives ( not CNVs ) breakpoints . The HG002 dataset ( Zook et al. , 2020 ) is another robust benchmarking dataset derived by the Genome in a Bottle Consortium , which is sequenced with 60× coverage . Reads in the HG002 dataset are all 148 bases long . As we only consider CNVs passing the quality control filter , this dataset contains 174 duplications , 10,668 deletions , and 5,205 false positives breakpoints post-filtering . We train the convolutional neural network on the NA12878 dataset and test the fitted model on the HG002 dataset . We also compare CNV-Net with popular existing tools for CNV detection , including BreakDancer ( Chen et al. , 2009 ) , CNVnator ( Abyzov et al. , 2011 ) , Delly ( Rausch et al. , 2012 ) , Lumpy ( Layer et al. , 2014 ) , and Manta ( Chen et al. , 2016 ) . It is important to note that CNVNet makes predictions using the pileup images of CNVs where their start and end positions are given , and hence we assume that candidate CNV positions are given as input to CNV-Net . However , other methods find the candidate CNV positions using the information on how reads are mapped to the reference genome and detect CNVs on those candidate CNV positions . The NA12878 dataset is preprocessed and converted into RGB images as described in the Methods section . We split the CNVs in NA12878 into 70 % , 20 % , 10 % for training set , validation set , and test set , respectively . We train the CNV-Net with the training set and report its performance metrics on the test set . As shown in Table 1 , CNV-Net identifies duplications with F1-score of 0.7833 , deletions with F1-score of 0.7473 , and false positives with F1-score of 0.7124 . This result shows that CNV-Net achieves high accuracy in the test set of the NA12878 dataset . Next , we evaluate our fitted CNV-Net on the HG002 dataset and compare it with five existing tools for CNV detection . This training scheme represents the real data analysis as we will train CNVNet with CNVs from known genomes and testing it on different genomes . As demonstrated in Table 2 , CNV-Net achieves the highest F1-score in CNV detection in the HG002 dataset among all six methods . It also has the highest recall and the second highest precision . This result shows that CNV-Net is more accurate in CNV detection than current methods . We then compare the time cost of applying different methods to the HG002 dataset . CNV-Net is significantly faster than other methods ( Table 3 ) . That is because a fitted convolutional neural network is efficient in making predictions , however , it may be time-consuming during model training . Run time is effectively front-loaded into model training instead of a concurrent statistical analysis . Another reason for this can be that CNV-Net makes predictions on candidate CNVs so it does not need to spend time searching for candidate CNVs in DNA sequencing data as if other methods do . 4 CONCLUSION . CNV-Net encodes DNA sequencing information into RGB images and applies a deep convolutional neural network to learn complex features from DNA sequencing data to discover CNVs . We demonstrate that CNV-Net can detect CNVs breakpoints from DNA sequencing data with significantly higher accuracy and efficiency than existing tools . To the best of our knowledge , CNV-Net is the first tool to use a CNN to detect CNVs from DNA sequencing data and achieve high performance on the standard benchmarks . It changes the problem of CNV detection from a process of statistical modeling requiring professional expertise into a process of optimizing a general deep learning model . Besides , although we benchmark CNV-Net using only human samples in this study , it can also be applied to DNA sequencing data of other species . One limitation of CNV-Net is its need to know candidate CNV positions , potential start and end positions of CNVs , before applying the CNN . This is because CNV-Net makes predictions on pileup images generated at the start and end positions of candidate CNVs . In our analysis , we used candidate CNV positions in human genomes , which were previously identified by the Genome in a Bottle Consortium using a suite of other algorithms . In genome sequencing datasets where CNVs have not been analyzed , these candidate CNV positions may not be available . One solution to this problem may be using candidate CNV positions detected by other CNV detection algorithms , especially algorithms with high recall , as CNV-Net can remove false positive CNVs from those CNV positions . Additionally , we may also develop a sensitive candidate CNV detection algorithm , which may have low precision but high recall . Our future research direction involves identifying candidate CNV positions from genome sequencing datasets and incorporating them with CNV-Net ; nevertheless , CNV-Net demonstrates potential as a valuable and effective tool for CNV detection .
They authors describe a method to detect structural variation from aligned sequencing reads in a genome browser view. Their model encodes this genome browser view into an RGB image and applies a deep convolutional neural network to classify variant type (or no variant). They make use of curated variant annotations to train and test their model.
SP:93cd389d63117a27a7f152c06bfb32a123e73377
Accurate and fast detection of copy number variations from short-read whole-genome sequencing with deep convolutional neural network
1 INTRODUCTION . A copy number variant ( CNV ) is a genetic mutation where a stretch of DNA is completely lost or repeated more than once compared to a reference genome . CNV sizes range from 50 bases to 3 million bases or more with two major types : duplication if the DNA sequence is repeated and deletion if a DNA sequence is missing . CNVs are spread along a genome , which account for 4.8 % to 9.5 % of human genome ( Zarrei et al. , 2015 ) . They are known to influence many complex diseases including autism ( Sebat et al. , 2007 ) , bipolar disorder ( Green et al. , 2016 ) , schizophrenia ( Stefansson et al. , 2008 ) , and Alzheimer ’ disease ( Cuccaro et al. , 2017 ) as well as gene expression ( Chiang et al. , 2017 ) . As CNVs may overlap with a large portion of a genome , such as one gene or even multiple genes , their effect on disease may be substantially larger than that of single nucleotide variants , and hence CNVs often play important roles in the genetic mechanisms of diseases and complex traits . With the advent of next-generation DNA sequencing technologies over the past decade , the resolution and scale of CNV detection has been greatly improved as large-scale sequencing studies become feasible . However , CNVs are still challenging to detect from short-read next-generation DNA sequencing techniques due to the significantly varying sizes of CNVs and their similarity with common DNA sequencing artifacts . Many computational methods have been developed for the discovery of CNVs from short-read DNA sequencing data , but their performance is often unsatisfactory due to low accuracy and high computational cost ( Kosugi et al. , 2019 ) . The main reason for this is that previous methods ( Rausch et al. , 2012 ; Abyzov et al. , 2011 ) mainly rely on the statistical analysis of the signals from read alignments ( a process that maps reads from DNA sequencing data to the reference genome ) , which often fail to employ all useful features of DNA sequencing data and require significant computational resources . Therefore , there is a need for a novel , sophisticated computational tool to improve CNV detection with higher accuracy and efficiency . Here , we present CNV-Net , a new approach to identify CNVs from DNA sequencing data using a six-layer deep convolutional neural network ( CNN ) . CNV-Net first encodes the reads and their related information from DNA sequencing data such as the type of base , base coverage ( the number of reads covering a position ) , and base quality of each position into the RGB channels of images . Then it uses a deep CNN to predict these images as deletions , duplications , or false positives ( not a CNV ) breakpoints . Note that a CNV is defined by two breakpoints , that is , its start and end positions . Although it has been shown that CNNs such as DeepVariant ( Poplin et al. , 2018 ) and Clairvoyante ( Luo et al. , 2019 ) can accurately detect single nucleotide variants from similarly encoded images or tensors , few CNNs have been designed for the identification of CNVs . The key advantage of CNVNet over other methods is the application of deep learning , which allows learning features with higher complexity from DNA sequencing data . We train the network with the Genome in a Bottle Consortium NA12878 dataset ( Pendleton et al. , 2015 ) , and demonstrate CNV-Net performance on a high-quality benchmarking dataset acquired from a well-studied cell line , HG002 ( Zook et al. , 2020 ) . We also compare its performance to that of previous methods . 2 METHODS . CNV-Net first encodes sequencing information into pileup images and classifies each image as a deletion , duplication , or false positive ( not a CNV ) . In this section , we describe how we generate pileup images , that is , the input to CNV-Net , as well as the design of the CNN . 2.1 PILEUP IMAGE GENERATION . We convert the information of mapped reads from DNA sequencing data ( provided in BAM file format ) and reference genome information to 201×55 pixel image representation of 201-base wide regions . Training data pileup images contain a CNV breakpoint ( start or end position ) centered in the image , capturing the 100 positions left and right each CNV breakpoint . Using the RGB channels of an image , this snapshot is able to capture features of the reads at specific locations in the reference genome . As shown in Figure 1 , the first five rows of the image capture the reference genome across a region of 201 base pairs by encoding the R channel of each pixel with an individual base in that position : A ’ s as 250 , G ’ s as 180 , T ’ s as 100 , C ’ s as 30 , and N ’ s as 0 . Under the five rows representing the reference genome are another five rows that capture the read depth ( coverage ) at that position . The R and G channels are encoded with an adjusted read depth value between 0 and 255 . The following 45 rows capture the mapped reads from DNA sequencing . The R channel encodes for the nucleotide , which is the same as the reference genome , and the G channel encodes for the base quality found in the BAM file , which is adjusted to be between 0 and 255 . Lastly , the B channel encodes for strand directionality : 70 if positive and 240 if negative . Each 201×55 pixel pileup image , thus , captures coverage and reads specific to the 201-base region of the reference genome such that the sequencing data may be re-created from a series of consecutive pileup images . If there are more than 45 reads mapping to a specific region , those reads are discarded ; we instead compensate by capturing this information through the rows that encodes coverage . If no reads map to the region , the image is left blank below the first five rows for the reference genome . 2.2 DESIGN OF CONVOLUTIONAL NEURAL NETWORK . As presented in Figure 2 , CNV-Net consists of four convolutional layers and two fully connected layers with a total of 5,110,979 parameters . Each of the four convolutional layers uses 3×3 kernels and the RELU activation function . Each convolutional layer is followed by batch normalization , average pooling , and 0.4 dropout . Arrays are flattened in between the four convolutional layers and two fully connected layers followed by softmax output to predictions for CNV breakpoint presence in the 201-base window : duplication , deletion , or false positive ( not a CNV ) . In training CNV-net , we use a standard Adam optimizer ( Kingma & Ba , 2014 ) with a sparse categorical cross-entropy loss function . We use a cyclical learning rate initialized at 1e-5 and maximal 1e-2 . To reduce overfitting , we train the model until the accuracy can not be improved in 15 epochs . The 201-base regions are centered around the CNV breakpoints , that is , the starts and ends of CNVs in the training set capturing the 100 positions directly before and after each CNV breakpoint . False positive images include random 201-base regions outside of CNVs . From the NA12878 dataset , a total of 52,243 pileup images are labeled as duplications , deletions , and false positives from the training set randomly split into 70 % , 20 % , 10 % categories for training set , validation set , and test set for the network , respectively . 3 RESULTS . In this study , we use two standard structural variation benchmarking datasets : NA12878 and HG002 . Both these benchmarking datasets are mapped to the GRCh37 reference genome . NA12878 is a well-studied genome provided by the Genome in a Bottle Consortium . It is whole-genome sequenced with 50× coverage and each read in the sequencing data is 101 bases long . From the NA12878 image dataset ( Pendleton et al. , 2015 ) , we generate images for 22,936 duplications , 18,614 deletions , and 10,693 false positives ( not CNVs ) breakpoints . The HG002 dataset ( Zook et al. , 2020 ) is another robust benchmarking dataset derived by the Genome in a Bottle Consortium , which is sequenced with 60× coverage . Reads in the HG002 dataset are all 148 bases long . As we only consider CNVs passing the quality control filter , this dataset contains 174 duplications , 10,668 deletions , and 5,205 false positives breakpoints post-filtering . We train the convolutional neural network on the NA12878 dataset and test the fitted model on the HG002 dataset . We also compare CNV-Net with popular existing tools for CNV detection , including BreakDancer ( Chen et al. , 2009 ) , CNVnator ( Abyzov et al. , 2011 ) , Delly ( Rausch et al. , 2012 ) , Lumpy ( Layer et al. , 2014 ) , and Manta ( Chen et al. , 2016 ) . It is important to note that CNVNet makes predictions using the pileup images of CNVs where their start and end positions are given , and hence we assume that candidate CNV positions are given as input to CNV-Net . However , other methods find the candidate CNV positions using the information on how reads are mapped to the reference genome and detect CNVs on those candidate CNV positions . The NA12878 dataset is preprocessed and converted into RGB images as described in the Methods section . We split the CNVs in NA12878 into 70 % , 20 % , 10 % for training set , validation set , and test set , respectively . We train the CNV-Net with the training set and report its performance metrics on the test set . As shown in Table 1 , CNV-Net identifies duplications with F1-score of 0.7833 , deletions with F1-score of 0.7473 , and false positives with F1-score of 0.7124 . This result shows that CNV-Net achieves high accuracy in the test set of the NA12878 dataset . Next , we evaluate our fitted CNV-Net on the HG002 dataset and compare it with five existing tools for CNV detection . This training scheme represents the real data analysis as we will train CNVNet with CNVs from known genomes and testing it on different genomes . As demonstrated in Table 2 , CNV-Net achieves the highest F1-score in CNV detection in the HG002 dataset among all six methods . It also has the highest recall and the second highest precision . This result shows that CNV-Net is more accurate in CNV detection than current methods . We then compare the time cost of applying different methods to the HG002 dataset . CNV-Net is significantly faster than other methods ( Table 3 ) . That is because a fitted convolutional neural network is efficient in making predictions , however , it may be time-consuming during model training . Run time is effectively front-loaded into model training instead of a concurrent statistical analysis . Another reason for this can be that CNV-Net makes predictions on candidate CNVs so it does not need to spend time searching for candidate CNVs in DNA sequencing data as if other methods do . 4 CONCLUSION . CNV-Net encodes DNA sequencing information into RGB images and applies a deep convolutional neural network to learn complex features from DNA sequencing data to discover CNVs . We demonstrate that CNV-Net can detect CNVs breakpoints from DNA sequencing data with significantly higher accuracy and efficiency than existing tools . To the best of our knowledge , CNV-Net is the first tool to use a CNN to detect CNVs from DNA sequencing data and achieve high performance on the standard benchmarks . It changes the problem of CNV detection from a process of statistical modeling requiring professional expertise into a process of optimizing a general deep learning model . Besides , although we benchmark CNV-Net using only human samples in this study , it can also be applied to DNA sequencing data of other species . One limitation of CNV-Net is its need to know candidate CNV positions , potential start and end positions of CNVs , before applying the CNN . This is because CNV-Net makes predictions on pileup images generated at the start and end positions of candidate CNVs . In our analysis , we used candidate CNV positions in human genomes , which were previously identified by the Genome in a Bottle Consortium using a suite of other algorithms . In genome sequencing datasets where CNVs have not been analyzed , these candidate CNV positions may not be available . One solution to this problem may be using candidate CNV positions detected by other CNV detection algorithms , especially algorithms with high recall , as CNV-Net can remove false positive CNVs from those CNV positions . Additionally , we may also develop a sensitive candidate CNV detection algorithm , which may have low precision but high recall . Our future research direction involves identifying candidate CNV positions from genome sequencing datasets and incorporating them with CNV-Net ; nevertheless , CNV-Net demonstrates potential as a valuable and effective tool for CNV detection .
The authors in the paper describe a deep learning approach to detect copy number variants (CNVs) from DNA sequencing data, CNV-Net. It described the approach by transforming the pileups into images and pass them through a CNN. This strategy has been proposed four or five years back to do SNPs and indels calling (DeepVariant). It is challenging for SVs and CNVs as they can be arbitrarily large. However, there are also several existing models for this task (e.g. DeepSV, RDBKE). In this work, the authors only consider "candidate CNV regions" which are 201-bp small genomic regions that centered at the breakpoints.
SP:93cd389d63117a27a7f152c06bfb32a123e73377
Contrastive Learning with Hard Negative Samples
1 INTRODUCTION . Owing to their empirical success , contrastive learning methods ( Chopra et al. , 2005 ; Hadsell et al. , 2006 ) have become one of the most popular self-supervised approaches for learning representations ( Oord et al. , 2018 ; Tian et al. , 2019 ; Chen et al. , 2020a ) . In computer vision , unsupervised contrastive learning methods have even outperformed supervised pre-training for object detection and segmentation tasks ( Misra & Maaten , 2020 ; He et al. , 2020 ) . Contrastive learning relies on two key ingredients : notions of similar ( positive ) ( x , x+ ) and dissimilar ( negative ) ( x , x− ) pairs of data points . The training objective , typically noise-contrastive estimation ( Gutmann & Hyvärinen , 2010 ) , guides the learned representation f to map positive pairs to nearby locations , and negative pairs farther apart ; other objectives have also been considered ( Chen et al. , 2020a ) . The success of the associated methods depends on the design of informative of the positive and negative pairs , which can not exploit true similarity information since there is no supervision . Much research effort has addressed sampling strategies for positive pairs , and has been a key driver of recent progress in multi-view and contrastive learning ( Blum & Mitchell , 1998 ; Xu et al. , 2013 ; Bachman et al. , 2019 ; Chen et al. , 2020a ; Tian et al. , 2020 ) . For image data , positive sampling strategies often apply transformations that preserve semantic content , e.g. , jittering , random cropping , separating color channels , etc . ( Chen et al. , 2020a ; c ; Tian et al. , 2019 ) . Such transformations have also been effective in learning control policies from raw pixel data ( Srinivas et al. , 2020 ) . Positive sampling techniques have also been proposed for sentence , audio , and video data ( Logeswaran & Lee , 2018 ; Oord et al. , 2018 ; Purushwalkam & Gupta , 2020 ; Sermanet et al. , 2018 ) . Surprisingly , the choice of negative pairs has drawn much less attention in contrastive learning . Often , given an “ anchor ” point x , a “ negative ” x− is simply sampled uniformly from the training data , independent of how informative it may be for the learned representation . In supervised and metric learning settings , “ hard ” ( true negative ) examples can help guide a learning method to correct its mistakes more quickly ( Schroff et al. , 2015 ; Song et al. , 2016 ) . For representation learning , informative negative examples are intuitively those pairs that are mapped nearby but should be far apart . This idea is successfully applied in metric learning , where true pairs of dissimilar points are available , as opposed to unsupervised contrastive learning . Code available at : https : //github.com/joshr17/HCL With this motivation , we address the challenge of selecting informative negatives for contrastive representation learning . In response , we propose a solution that builds a tunable sampling distribution that prefers negative pairs whose representations are currently very similar . This solution faces two challenges : ( 1 ) we do not have access to any true similarity or dissimilarity information ; ( 2 ) we need an efficient sampling strategy for this tunable distribution . We overcome ( 1 ) by building on ideas from positive-unlabeled learning ( Elkan & Noto , 2008 ; Du Plessis et al. , 2014 ) , and ( 2 ) by designing an efficient , easy to implement importance sampling technique that incurs no computational overhead . Our theoretical analysis shows that , as a function of the tuning parameter , the optimal representations for our new method place similar inputs in tight clusters , whilst spacing the clusters as far apart as possible . Empirically , our hard negative sampling strategy improves the downstream task performance for image , graph and text data , supporting that indeed , our negative examples are more informative . Contributions . In summary , we make the following contributions : 1 . We propose a simple distribution over hard negative pairs for contrastive representation learning , and derive a practical importance sampling strategy with zero computational overhead that takes into account the lack of true dissimilarity information ; 2 . We theoretically analyze the hard negatives objective and optimal representations , showing that they capture desirable generalization properties ; 3 . We empirically observe that the proposed sampling method improves the downstream task performance on image , graph and text data . Before moving onto the problem formulation and our results , we summarize related work below . 1.1 RELATED WORK . Contrastive Representation Learning . Various frameworks for contrastive learning of visual representations have been proposed , including SimCLR ( Chen et al. , 2020a ; b ) , which uses augmented views of other items in a minibatch as negative samples , and MoCo ( He et al. , 2020 ; Chen et al. , 2020c ) , which uses a momentum updated memory bank of old negative representations to enable the use of very large batches of negative samples . Most contrastive methods are unsupervised , however there exist some that use label information ( Sylvain et al. , 2020 ; Khosla et al. , 2020 ) . Many works study the role of positive pairs , and , e.g. , propose to apply large perturbations for images Chen et al . ( 2020a ; c ) , or argue to minimize the mutual information within positive pairs , apart from relevant information for the ultimate prediction task ( Tian et al. , 2020 ) . Beyond visual data , contrastive methods have been developed for sentence embeddings ( Logeswaran & Lee , 2018 ) , sequential data ( Oord et al. , 2018 ; Hénaff et al. , 2020 ) , graph ( Sun et al. , 2020 ; Hassani & Khasahmadi , 2020 ; Li et al. , 2019 ) and node representation learning ( Velickovic et al. , 2019 ) , and learning representations from raw images for off-policy control ( Srinivas et al. , 2020 ) . The role of negative pairs hase been much less studied . Chuang et al . ( 2020 ) propose a method for “ debiasing ” , i.e. , correcting for the fact that not all negative pairs may be true negatives . It does so by taking the viewpoint of Positive-Unlabeled learning , and exploits a decomposition of the true negative distribution . Kalantidis et al . ( 2020 ) consider applying Mixup ( Zhang et al. , 2018 ) to generate hard negatives in latent space , and Jin et al . ( 2018 ) exploit the specific temporal structure of video to generate negatives for object detection . Negative Mining in Deep Metric Learning . As opposed to the contrastive representation learning literature , selection strategies for negative samples have been thoroughly studied in ( deep ) metric learning ( Schroff et al. , 2015 ; Song et al. , 2016 ; Harwood et al. , 2017 ; Wu et al. , 2017 ; Ge , 2018 ; Suh et al. , 2019 ) . Most of these works observe that it is helpful to use negative samples that are difficult for the current embedding to discriminate . Schroff et al . ( 2015 ) qualify this , observing that some examples are simply too hard , and propose selecting “ semi-hard ” negative samples . The well known importance of negative samples in metric learning , where ( partial ) true dissimilarity information is available , raises the question of negative samples in contrastive learning , the subject of this paper . 2 CONTRASTIVE LEARNING SETUP . We begin with the setup and the idea of contrastive representation learning . We wish to learn an embedding f : X → Sd−1/t that maps an observation x to a point on a hypersphere Sd−1/t in Rd of radius 1/t , where t is the “ temperature ” scaling hyperparameter . Following the setup of Arora et al . ( 2019 ) , we assume an underlying set of discrete latent classes C that represent semantic content , so that similar pairs ( x , x+ ) have the same latent class . Denoting the distribution over latent classes by ρ ( c ) for c ∈ C , we define the joint distribution px , c ( x , c ) = p ( x|c ) ρ ( c ) whose marginal p ( x ) we refer to simply as p , and assume supp ( p ) = X . For simplicity , we assume ρ ( c ) = τ+ is uniform , and let τ− = 1 − τ+ be the probability of another class . Since the class-prior τ+ is unknown in practice , it must either be treated as a hyperparameter , or estimated ( Christoffel et al. , 2016 ; Jain et al. , 2016 ) . Let h : X → C be the true underlying hypothesis that assigns class labels to inputs . We write x ∼ x′ to denote the label equivalence relation h ( x ) = h ( x′ ) . We denote by p+x ( x ′ ) = p ( x′|h ( x′ ) = h ( x ) ) , the distribution over points with same label as x , and by p−x ( x ′ ) = p ( x′|h ( x′ ) 6= h ( x ) ) , the distribution over points with labels different from x . We drop the subscript x when the context is clear . Following the usual convention , we overload ‘ ∼ ’ and also write x ∼ p to denote a point sampled from p. For each data point x ∼ p , the noise-contrastive estimation ( NCE ) objective ( Gutmann & Hyvärinen , 2010 ) for learning the representation f uses a positive example x+ with the same label as x , and negative examples { x−i } Ni=1 with ( supposedly ) different labels , h ( x − i ) 6= h ( x ) , sampled from q : Ex∼p , x+∼p+x { x−i } N i=1∼q [ − log e f ( x ) T f ( x+ ) ef ( x ) T f ( x+ ) + QN ∑N i=1 e f ( x ) T f ( x−i ) ] . ( 1 ) The weighting parameter Q is introduced for the purpose of analysis . When N is finite we take Q = N , yielding the usual form of the contrastive objective . The negative sample distribution q is frequently chosen to be the marginal distribution p , or , in practice , an empirical approximation of it ( Tian et al. , 2019 ; Chen et al. , 2020a ; c ; He et al. , 2020 ; Chen et al. , 2020c ; Oord et al. , 2018 ; Hénaff et al. , 2020 ) . In this paper we ask : is there a better way to choose q ? 3 HARD NEGATIVE SAMPLING . In this section we describe our approach for hard negative sampling . We begin by asking what makes a good negative sample ? To answer this question we adopt the following two guiding principles : Principle 1. q should only sample “ true negatives ” x−i whose labels differ from that of the anchor x . Principle 2 . The most useful negative samples are ones that the embedding currently believes to be similar to the anchor . In short , negative samples that have different label from the anchor , but that are embedded nearby are likely to be most useful and provide significant gradient information during training . In metric learning there is access to true negative pairs , automatically fulfilling the first principle . In unsupervised contrastive learning there is no supervision , so upholding Principle 1 is impossible to do exactly . In this paper we propose a method that upholds Principle 1 approximately , and simultaneously combines this idea with the key additional conceptual ingredient of “ hardness ” ( encapsulated in Principle 2 ) . The level of “ hardness ” in our method can be smoothly adjusted , allowing the user to select the hardness that best trades-off between an improved learning signal from hard negatives , and the harm due to the correction of false negatives being only approximate . This important since the hardest points are those closest to the anchor , and are expected to have a high propensity to have the same label . Therefore the damage from the approximation not removing all false negatives becomes larger for harder samples , creating the trade-off . As a special case our our method , when the hardness level is tuned fully down , we obtain the method proposed in ( Chuang et al. , 2020 ) that only upholds Principle 1 ( approximately ) but not Principle 2 . Finally , beyond Principles 1 and 2 , we wish to design an efficient sampling method that does not add additional computational overhead during training .
This paper investigated how to sample informative/hard negative examples for self-supervised contrastive learning without label information. To tackle this challenge, this paper proposed an efficient tunable sampling distribution to select negative samples that are similar to the query when the true label or similarity information is not accessible. Positive-unlabeled learning is used to address the challenge of no label, while the importance sampling technique is used for efficient sampling.
SP:e79a01ae3e15c0ac52ca8c603c9d131ad14bda52
Contrastive Learning with Hard Negative Samples
1 INTRODUCTION . Owing to their empirical success , contrastive learning methods ( Chopra et al. , 2005 ; Hadsell et al. , 2006 ) have become one of the most popular self-supervised approaches for learning representations ( Oord et al. , 2018 ; Tian et al. , 2019 ; Chen et al. , 2020a ) . In computer vision , unsupervised contrastive learning methods have even outperformed supervised pre-training for object detection and segmentation tasks ( Misra & Maaten , 2020 ; He et al. , 2020 ) . Contrastive learning relies on two key ingredients : notions of similar ( positive ) ( x , x+ ) and dissimilar ( negative ) ( x , x− ) pairs of data points . The training objective , typically noise-contrastive estimation ( Gutmann & Hyvärinen , 2010 ) , guides the learned representation f to map positive pairs to nearby locations , and negative pairs farther apart ; other objectives have also been considered ( Chen et al. , 2020a ) . The success of the associated methods depends on the design of informative of the positive and negative pairs , which can not exploit true similarity information since there is no supervision . Much research effort has addressed sampling strategies for positive pairs , and has been a key driver of recent progress in multi-view and contrastive learning ( Blum & Mitchell , 1998 ; Xu et al. , 2013 ; Bachman et al. , 2019 ; Chen et al. , 2020a ; Tian et al. , 2020 ) . For image data , positive sampling strategies often apply transformations that preserve semantic content , e.g. , jittering , random cropping , separating color channels , etc . ( Chen et al. , 2020a ; c ; Tian et al. , 2019 ) . Such transformations have also been effective in learning control policies from raw pixel data ( Srinivas et al. , 2020 ) . Positive sampling techniques have also been proposed for sentence , audio , and video data ( Logeswaran & Lee , 2018 ; Oord et al. , 2018 ; Purushwalkam & Gupta , 2020 ; Sermanet et al. , 2018 ) . Surprisingly , the choice of negative pairs has drawn much less attention in contrastive learning . Often , given an “ anchor ” point x , a “ negative ” x− is simply sampled uniformly from the training data , independent of how informative it may be for the learned representation . In supervised and metric learning settings , “ hard ” ( true negative ) examples can help guide a learning method to correct its mistakes more quickly ( Schroff et al. , 2015 ; Song et al. , 2016 ) . For representation learning , informative negative examples are intuitively those pairs that are mapped nearby but should be far apart . This idea is successfully applied in metric learning , where true pairs of dissimilar points are available , as opposed to unsupervised contrastive learning . Code available at : https : //github.com/joshr17/HCL With this motivation , we address the challenge of selecting informative negatives for contrastive representation learning . In response , we propose a solution that builds a tunable sampling distribution that prefers negative pairs whose representations are currently very similar . This solution faces two challenges : ( 1 ) we do not have access to any true similarity or dissimilarity information ; ( 2 ) we need an efficient sampling strategy for this tunable distribution . We overcome ( 1 ) by building on ideas from positive-unlabeled learning ( Elkan & Noto , 2008 ; Du Plessis et al. , 2014 ) , and ( 2 ) by designing an efficient , easy to implement importance sampling technique that incurs no computational overhead . Our theoretical analysis shows that , as a function of the tuning parameter , the optimal representations for our new method place similar inputs in tight clusters , whilst spacing the clusters as far apart as possible . Empirically , our hard negative sampling strategy improves the downstream task performance for image , graph and text data , supporting that indeed , our negative examples are more informative . Contributions . In summary , we make the following contributions : 1 . We propose a simple distribution over hard negative pairs for contrastive representation learning , and derive a practical importance sampling strategy with zero computational overhead that takes into account the lack of true dissimilarity information ; 2 . We theoretically analyze the hard negatives objective and optimal representations , showing that they capture desirable generalization properties ; 3 . We empirically observe that the proposed sampling method improves the downstream task performance on image , graph and text data . Before moving onto the problem formulation and our results , we summarize related work below . 1.1 RELATED WORK . Contrastive Representation Learning . Various frameworks for contrastive learning of visual representations have been proposed , including SimCLR ( Chen et al. , 2020a ; b ) , which uses augmented views of other items in a minibatch as negative samples , and MoCo ( He et al. , 2020 ; Chen et al. , 2020c ) , which uses a momentum updated memory bank of old negative representations to enable the use of very large batches of negative samples . Most contrastive methods are unsupervised , however there exist some that use label information ( Sylvain et al. , 2020 ; Khosla et al. , 2020 ) . Many works study the role of positive pairs , and , e.g. , propose to apply large perturbations for images Chen et al . ( 2020a ; c ) , or argue to minimize the mutual information within positive pairs , apart from relevant information for the ultimate prediction task ( Tian et al. , 2020 ) . Beyond visual data , contrastive methods have been developed for sentence embeddings ( Logeswaran & Lee , 2018 ) , sequential data ( Oord et al. , 2018 ; Hénaff et al. , 2020 ) , graph ( Sun et al. , 2020 ; Hassani & Khasahmadi , 2020 ; Li et al. , 2019 ) and node representation learning ( Velickovic et al. , 2019 ) , and learning representations from raw images for off-policy control ( Srinivas et al. , 2020 ) . The role of negative pairs hase been much less studied . Chuang et al . ( 2020 ) propose a method for “ debiasing ” , i.e. , correcting for the fact that not all negative pairs may be true negatives . It does so by taking the viewpoint of Positive-Unlabeled learning , and exploits a decomposition of the true negative distribution . Kalantidis et al . ( 2020 ) consider applying Mixup ( Zhang et al. , 2018 ) to generate hard negatives in latent space , and Jin et al . ( 2018 ) exploit the specific temporal structure of video to generate negatives for object detection . Negative Mining in Deep Metric Learning . As opposed to the contrastive representation learning literature , selection strategies for negative samples have been thoroughly studied in ( deep ) metric learning ( Schroff et al. , 2015 ; Song et al. , 2016 ; Harwood et al. , 2017 ; Wu et al. , 2017 ; Ge , 2018 ; Suh et al. , 2019 ) . Most of these works observe that it is helpful to use negative samples that are difficult for the current embedding to discriminate . Schroff et al . ( 2015 ) qualify this , observing that some examples are simply too hard , and propose selecting “ semi-hard ” negative samples . The well known importance of negative samples in metric learning , where ( partial ) true dissimilarity information is available , raises the question of negative samples in contrastive learning , the subject of this paper . 2 CONTRASTIVE LEARNING SETUP . We begin with the setup and the idea of contrastive representation learning . We wish to learn an embedding f : X → Sd−1/t that maps an observation x to a point on a hypersphere Sd−1/t in Rd of radius 1/t , where t is the “ temperature ” scaling hyperparameter . Following the setup of Arora et al . ( 2019 ) , we assume an underlying set of discrete latent classes C that represent semantic content , so that similar pairs ( x , x+ ) have the same latent class . Denoting the distribution over latent classes by ρ ( c ) for c ∈ C , we define the joint distribution px , c ( x , c ) = p ( x|c ) ρ ( c ) whose marginal p ( x ) we refer to simply as p , and assume supp ( p ) = X . For simplicity , we assume ρ ( c ) = τ+ is uniform , and let τ− = 1 − τ+ be the probability of another class . Since the class-prior τ+ is unknown in practice , it must either be treated as a hyperparameter , or estimated ( Christoffel et al. , 2016 ; Jain et al. , 2016 ) . Let h : X → C be the true underlying hypothesis that assigns class labels to inputs . We write x ∼ x′ to denote the label equivalence relation h ( x ) = h ( x′ ) . We denote by p+x ( x ′ ) = p ( x′|h ( x′ ) = h ( x ) ) , the distribution over points with same label as x , and by p−x ( x ′ ) = p ( x′|h ( x′ ) 6= h ( x ) ) , the distribution over points with labels different from x . We drop the subscript x when the context is clear . Following the usual convention , we overload ‘ ∼ ’ and also write x ∼ p to denote a point sampled from p. For each data point x ∼ p , the noise-contrastive estimation ( NCE ) objective ( Gutmann & Hyvärinen , 2010 ) for learning the representation f uses a positive example x+ with the same label as x , and negative examples { x−i } Ni=1 with ( supposedly ) different labels , h ( x − i ) 6= h ( x ) , sampled from q : Ex∼p , x+∼p+x { x−i } N i=1∼q [ − log e f ( x ) T f ( x+ ) ef ( x ) T f ( x+ ) + QN ∑N i=1 e f ( x ) T f ( x−i ) ] . ( 1 ) The weighting parameter Q is introduced for the purpose of analysis . When N is finite we take Q = N , yielding the usual form of the contrastive objective . The negative sample distribution q is frequently chosen to be the marginal distribution p , or , in practice , an empirical approximation of it ( Tian et al. , 2019 ; Chen et al. , 2020a ; c ; He et al. , 2020 ; Chen et al. , 2020c ; Oord et al. , 2018 ; Hénaff et al. , 2020 ) . In this paper we ask : is there a better way to choose q ? 3 HARD NEGATIVE SAMPLING . In this section we describe our approach for hard negative sampling . We begin by asking what makes a good negative sample ? To answer this question we adopt the following two guiding principles : Principle 1. q should only sample “ true negatives ” x−i whose labels differ from that of the anchor x . Principle 2 . The most useful negative samples are ones that the embedding currently believes to be similar to the anchor . In short , negative samples that have different label from the anchor , but that are embedded nearby are likely to be most useful and provide significant gradient information during training . In metric learning there is access to true negative pairs , automatically fulfilling the first principle . In unsupervised contrastive learning there is no supervision , so upholding Principle 1 is impossible to do exactly . In this paper we propose a method that upholds Principle 1 approximately , and simultaneously combines this idea with the key additional conceptual ingredient of “ hardness ” ( encapsulated in Principle 2 ) . The level of “ hardness ” in our method can be smoothly adjusted , allowing the user to select the hardness that best trades-off between an improved learning signal from hard negatives , and the harm due to the correction of false negatives being only approximate . This important since the hardest points are those closest to the anchor , and are expected to have a high propensity to have the same label . Therefore the damage from the approximation not removing all false negatives becomes larger for harder samples , creating the trade-off . As a special case our our method , when the hardness level is tuned fully down , we obtain the method proposed in ( Chuang et al. , 2020 ) that only upholds Principle 1 ( approximately ) but not Principle 2 . Finally , beyond Principles 1 and 2 , we wish to design an efficient sampling method that does not add additional computational overhead during training .
The paper proposes a novel noise contrastive estimation (NCE) objective that incorporates hard-negative samples without similarity supervision, e.g., assuming unsupervised learning. To this end, it modifies the denominator of the original NCE by (a) re-weighting the negative samples based on the euclidean distance from the anchor point, and (b) considering a de-biasing of the effect of positive samples (that should be near to the anchor). Experimental results show that the proposed objective outperforms the pure SimCLR and its de-biased-only variants in many but not all cases in image, graph and text domains.
SP:e79a01ae3e15c0ac52ca8c603c9d131ad14bda52
Contrastive Learning with Hard Negative Samples
1 INTRODUCTION . Owing to their empirical success , contrastive learning methods ( Chopra et al. , 2005 ; Hadsell et al. , 2006 ) have become one of the most popular self-supervised approaches for learning representations ( Oord et al. , 2018 ; Tian et al. , 2019 ; Chen et al. , 2020a ) . In computer vision , unsupervised contrastive learning methods have even outperformed supervised pre-training for object detection and segmentation tasks ( Misra & Maaten , 2020 ; He et al. , 2020 ) . Contrastive learning relies on two key ingredients : notions of similar ( positive ) ( x , x+ ) and dissimilar ( negative ) ( x , x− ) pairs of data points . The training objective , typically noise-contrastive estimation ( Gutmann & Hyvärinen , 2010 ) , guides the learned representation f to map positive pairs to nearby locations , and negative pairs farther apart ; other objectives have also been considered ( Chen et al. , 2020a ) . The success of the associated methods depends on the design of informative of the positive and negative pairs , which can not exploit true similarity information since there is no supervision . Much research effort has addressed sampling strategies for positive pairs , and has been a key driver of recent progress in multi-view and contrastive learning ( Blum & Mitchell , 1998 ; Xu et al. , 2013 ; Bachman et al. , 2019 ; Chen et al. , 2020a ; Tian et al. , 2020 ) . For image data , positive sampling strategies often apply transformations that preserve semantic content , e.g. , jittering , random cropping , separating color channels , etc . ( Chen et al. , 2020a ; c ; Tian et al. , 2019 ) . Such transformations have also been effective in learning control policies from raw pixel data ( Srinivas et al. , 2020 ) . Positive sampling techniques have also been proposed for sentence , audio , and video data ( Logeswaran & Lee , 2018 ; Oord et al. , 2018 ; Purushwalkam & Gupta , 2020 ; Sermanet et al. , 2018 ) . Surprisingly , the choice of negative pairs has drawn much less attention in contrastive learning . Often , given an “ anchor ” point x , a “ negative ” x− is simply sampled uniformly from the training data , independent of how informative it may be for the learned representation . In supervised and metric learning settings , “ hard ” ( true negative ) examples can help guide a learning method to correct its mistakes more quickly ( Schroff et al. , 2015 ; Song et al. , 2016 ) . For representation learning , informative negative examples are intuitively those pairs that are mapped nearby but should be far apart . This idea is successfully applied in metric learning , where true pairs of dissimilar points are available , as opposed to unsupervised contrastive learning . Code available at : https : //github.com/joshr17/HCL With this motivation , we address the challenge of selecting informative negatives for contrastive representation learning . In response , we propose a solution that builds a tunable sampling distribution that prefers negative pairs whose representations are currently very similar . This solution faces two challenges : ( 1 ) we do not have access to any true similarity or dissimilarity information ; ( 2 ) we need an efficient sampling strategy for this tunable distribution . We overcome ( 1 ) by building on ideas from positive-unlabeled learning ( Elkan & Noto , 2008 ; Du Plessis et al. , 2014 ) , and ( 2 ) by designing an efficient , easy to implement importance sampling technique that incurs no computational overhead . Our theoretical analysis shows that , as a function of the tuning parameter , the optimal representations for our new method place similar inputs in tight clusters , whilst spacing the clusters as far apart as possible . Empirically , our hard negative sampling strategy improves the downstream task performance for image , graph and text data , supporting that indeed , our negative examples are more informative . Contributions . In summary , we make the following contributions : 1 . We propose a simple distribution over hard negative pairs for contrastive representation learning , and derive a practical importance sampling strategy with zero computational overhead that takes into account the lack of true dissimilarity information ; 2 . We theoretically analyze the hard negatives objective and optimal representations , showing that they capture desirable generalization properties ; 3 . We empirically observe that the proposed sampling method improves the downstream task performance on image , graph and text data . Before moving onto the problem formulation and our results , we summarize related work below . 1.1 RELATED WORK . Contrastive Representation Learning . Various frameworks for contrastive learning of visual representations have been proposed , including SimCLR ( Chen et al. , 2020a ; b ) , which uses augmented views of other items in a minibatch as negative samples , and MoCo ( He et al. , 2020 ; Chen et al. , 2020c ) , which uses a momentum updated memory bank of old negative representations to enable the use of very large batches of negative samples . Most contrastive methods are unsupervised , however there exist some that use label information ( Sylvain et al. , 2020 ; Khosla et al. , 2020 ) . Many works study the role of positive pairs , and , e.g. , propose to apply large perturbations for images Chen et al . ( 2020a ; c ) , or argue to minimize the mutual information within positive pairs , apart from relevant information for the ultimate prediction task ( Tian et al. , 2020 ) . Beyond visual data , contrastive methods have been developed for sentence embeddings ( Logeswaran & Lee , 2018 ) , sequential data ( Oord et al. , 2018 ; Hénaff et al. , 2020 ) , graph ( Sun et al. , 2020 ; Hassani & Khasahmadi , 2020 ; Li et al. , 2019 ) and node representation learning ( Velickovic et al. , 2019 ) , and learning representations from raw images for off-policy control ( Srinivas et al. , 2020 ) . The role of negative pairs hase been much less studied . Chuang et al . ( 2020 ) propose a method for “ debiasing ” , i.e. , correcting for the fact that not all negative pairs may be true negatives . It does so by taking the viewpoint of Positive-Unlabeled learning , and exploits a decomposition of the true negative distribution . Kalantidis et al . ( 2020 ) consider applying Mixup ( Zhang et al. , 2018 ) to generate hard negatives in latent space , and Jin et al . ( 2018 ) exploit the specific temporal structure of video to generate negatives for object detection . Negative Mining in Deep Metric Learning . As opposed to the contrastive representation learning literature , selection strategies for negative samples have been thoroughly studied in ( deep ) metric learning ( Schroff et al. , 2015 ; Song et al. , 2016 ; Harwood et al. , 2017 ; Wu et al. , 2017 ; Ge , 2018 ; Suh et al. , 2019 ) . Most of these works observe that it is helpful to use negative samples that are difficult for the current embedding to discriminate . Schroff et al . ( 2015 ) qualify this , observing that some examples are simply too hard , and propose selecting “ semi-hard ” negative samples . The well known importance of negative samples in metric learning , where ( partial ) true dissimilarity information is available , raises the question of negative samples in contrastive learning , the subject of this paper . 2 CONTRASTIVE LEARNING SETUP . We begin with the setup and the idea of contrastive representation learning . We wish to learn an embedding f : X → Sd−1/t that maps an observation x to a point on a hypersphere Sd−1/t in Rd of radius 1/t , where t is the “ temperature ” scaling hyperparameter . Following the setup of Arora et al . ( 2019 ) , we assume an underlying set of discrete latent classes C that represent semantic content , so that similar pairs ( x , x+ ) have the same latent class . Denoting the distribution over latent classes by ρ ( c ) for c ∈ C , we define the joint distribution px , c ( x , c ) = p ( x|c ) ρ ( c ) whose marginal p ( x ) we refer to simply as p , and assume supp ( p ) = X . For simplicity , we assume ρ ( c ) = τ+ is uniform , and let τ− = 1 − τ+ be the probability of another class . Since the class-prior τ+ is unknown in practice , it must either be treated as a hyperparameter , or estimated ( Christoffel et al. , 2016 ; Jain et al. , 2016 ) . Let h : X → C be the true underlying hypothesis that assigns class labels to inputs . We write x ∼ x′ to denote the label equivalence relation h ( x ) = h ( x′ ) . We denote by p+x ( x ′ ) = p ( x′|h ( x′ ) = h ( x ) ) , the distribution over points with same label as x , and by p−x ( x ′ ) = p ( x′|h ( x′ ) 6= h ( x ) ) , the distribution over points with labels different from x . We drop the subscript x when the context is clear . Following the usual convention , we overload ‘ ∼ ’ and also write x ∼ p to denote a point sampled from p. For each data point x ∼ p , the noise-contrastive estimation ( NCE ) objective ( Gutmann & Hyvärinen , 2010 ) for learning the representation f uses a positive example x+ with the same label as x , and negative examples { x−i } Ni=1 with ( supposedly ) different labels , h ( x − i ) 6= h ( x ) , sampled from q : Ex∼p , x+∼p+x { x−i } N i=1∼q [ − log e f ( x ) T f ( x+ ) ef ( x ) T f ( x+ ) + QN ∑N i=1 e f ( x ) T f ( x−i ) ] . ( 1 ) The weighting parameter Q is introduced for the purpose of analysis . When N is finite we take Q = N , yielding the usual form of the contrastive objective . The negative sample distribution q is frequently chosen to be the marginal distribution p , or , in practice , an empirical approximation of it ( Tian et al. , 2019 ; Chen et al. , 2020a ; c ; He et al. , 2020 ; Chen et al. , 2020c ; Oord et al. , 2018 ; Hénaff et al. , 2020 ) . In this paper we ask : is there a better way to choose q ? 3 HARD NEGATIVE SAMPLING . In this section we describe our approach for hard negative sampling . We begin by asking what makes a good negative sample ? To answer this question we adopt the following two guiding principles : Principle 1. q should only sample “ true negatives ” x−i whose labels differ from that of the anchor x . Principle 2 . The most useful negative samples are ones that the embedding currently believes to be similar to the anchor . In short , negative samples that have different label from the anchor , but that are embedded nearby are likely to be most useful and provide significant gradient information during training . In metric learning there is access to true negative pairs , automatically fulfilling the first principle . In unsupervised contrastive learning there is no supervision , so upholding Principle 1 is impossible to do exactly . In this paper we propose a method that upholds Principle 1 approximately , and simultaneously combines this idea with the key additional conceptual ingredient of “ hardness ” ( encapsulated in Principle 2 ) . The level of “ hardness ” in our method can be smoothly adjusted , allowing the user to select the hardness that best trades-off between an improved learning signal from hard negatives , and the harm due to the correction of false negatives being only approximate . This important since the hardest points are those closest to the anchor , and are expected to have a high propensity to have the same label . Therefore the damage from the approximation not removing all false negatives becomes larger for harder samples , creating the trade-off . As a special case our our method , when the hardness level is tuned fully down , we obtain the method proposed in ( Chuang et al. , 2020 ) that only upholds Principle 1 ( approximately ) but not Principle 2 . Finally , beyond Principles 1 and 2 , we wish to design an efficient sampling method that does not add additional computational overhead during training .
In this paper, the authors mainly study how to sample good/informative negative examples for contrastive learning. The key challenge is the unsupervision in contrastive methods. They propose a new unsupervised method to select the hard-negative samples with user control. The experimental results on three modalities (images, graph and sentences) show the effectiveness of their method.
SP:e79a01ae3e15c0ac52ca8c603c9d131ad14bda52
Direction Matters: On the Implicit Bias of Stochastic Gradient Descent with Moderate Learning Rate
1 INTRODUCTION . Stochastic gradient descent ( SGD ) and its variants play a key role in training deep learning models . From the optimization perspective , SGD is favorable in many aspects , e.g. , scalability for large-scale models ( He et al. , 2016 ) , parallelizability with big training data ( Goyal et al. , 2017 ) , and rich theory for its convergence ( Ghadimi & Lan , 2013 ; Gower et al. , 2019 ) . From the learning perspective , more surprisingly , overparameterized deep nets trained by SGD usually generalize well , even in the absence of explicit regularizers ( Zhang et al. , 2016 ; Keskar et al. , 2016 ) . This suggests that SGD favors certain “ good ” solutions among the numerous global optima of the overparameterized model . Such phenomenon is attributed to the implicit bias of SGD . It remains one of the key theoretical challenges to characterize the algorithmic bias of SGD , especially with moderate and annealing learning rate as typically used in practice ( He et al. , 2016 ; Keskar et al. , 2016 ) . In the small learning rate regime , the regularization effect of SGD is relatively well understood , thanks to the recent advances on the implicit bias of gradient descent ( GD ) ( Gunasekar et al. , 2017 ; 2018a ; b ; Soudry et al. , 2018 ; Ma et al. , 2018 ; Li et al. , 2018 ; Ji & Telgarsky , 2019b ; a ; Ji et al. , 2020 ; Nacson et al. , 2019a ; Ali et al. , 2019 ; Arora et al. , 2019 ; Moroshko et al. , 2020 ; Chizat & Bach , 2020 ) . According to classical stochastic approximation theory ( Kushner & Yin , 2003 ) , with a sufficiently small learning rate , the randomness in SGD is negligible ( which scales with learning rate ) , and as a consequence SGD will behave highly similar to its deterministic counterpart , i.e. , GD . Based on this fact , the regularization effect of SGD with small learning rate can be understood through that of GD . Take linear models for example , GD has been shown to be biased towards maxmargin/minimum-norm solutions depending on the problem setups ( Soudry et al. , 2018 ; Gunasekar et al. , 2018a ; Ali et al. , 2019 ) ; correspondingly , follow-ups show that SGD with small learning rate has the same bias ( up to certain small uncertainty governed by the learning rate ) ( Nacson et al. , 2019b ; Gunasekar et al. , 2018a ; Ali et al. , 2020 ) . The analogy between SGD and GD in the small learning rate regime is also demonstrated in Figures 1 ( a ) and 3 . However , the regularization theory for SGD with small learning rate can not explain the benefits of SGD in the moderate learning rate regime , where the initial learning rate is moderate and followed by annealing ( Li et al. , 2019 ; Nakkiran , 2020 ; Leclerc & Madry , 2020 ; Jastrzebski et al. , 2019 ) . In particular , empirical studies show that , in the moderate learning rate regime , ( small batch ) SGD generalizes much better than GD/large batch SGD ( Keskar et al. , 2016 ; Jastrzębski et al. , 2017 ; Zhu et al. , 2019 ; Wu et al. , 2020 ) ( see Figure 3 ) . This observation implies that , instead of imitating the bias of GD as in the small learning rate regime , SGD in the moderate learning rate regime admits superior bias than GD — it requires a dedicated characterization for the implicit regularization effect of SGD with moderate learning rate . In this paper , we reveal a particular regularization effect of SGD with moderate learning rate that involves convergence direction . In specific , we consider an overparameterized linear regression model learned by SGD/GD . In this setting , SGD and GD are known to converge to the unique minimumnorm solution ( Zhang et al. , 2016 ; Gunasekar et al. , 2018a ) ( see also Section 2.1 ) . However , with a moderate and annealing learning rate , we show that SGD and GD favor different convergence directions : SGD converges along the large eigenvalue directions of the data matrix ; in contrast , GD goes after the small eigenvalue directions . The phenomenon is illustrated in Figure 1 ( b ) . To sum up , we make the following contributions in this work : 1 . For an overparameterized linear regression model , we show that SGD with moderate learning rate converges along the large eigenvalue directions of the data matrix , while GD goes after the small eigenvalue directions . To our knowledge , this result initiates the regularization theory for SGD in the moderate learning rate regime , and complements existing results for the small learning rate . 2 . Furthermore , we show the particular directional bias of SGD with moderate learning rate benefits generalization when early stopping is used . This is because converging along the large eigenvalue directions ( SGD ) leads to nearly optimal solutions , while converging along the small eigenvalue directions ( GD ) can only give suboptimal solutions . 3 . Finally , our results explain several folk arts for tuning SGD hyperparameters , such as ( 1 ) linearly scaling the initial learning rate with batch size ( Goyal et al. , 2017 ) ; and ( 2 ) overrunning SGD with high learning rate even when the loss stops decreasing ( He et al. , 2016 ) . 2 PRELIMINARY . Let ( x , y ) ∈ Rd×R be a pair of d-dimensional feature vector and 1-dimensional label . We consider a linear regression problem with square loss defined as ` ( x , y ; w ) : = ( w > x− y ) 2 , where w ∈ Rd is the model parameter . LetD be the population distribution over ( x , y ) , then the test loss is LD ( w ) : = E ( x , y ) ∼D [ ` ( x , y ; w ) ] . Let S : = { ( xi , yi ) } ni=1 be a training set of n data points drawn i.i.d . from the population distributionD . Then the training/empirical loss is defined as the average of the individual loss over all training data points , LS ( w ) : = 1 n n∑ i=1 ` i ( w ) , where ` i ( w ) : = ` ( xi , yi ; w ) = ( w > xi − yi ) 2 . We use { ηk } to denote a learning rate scheme ( LR ) . Then gradient descent ( GD ) iteratively performs the following update : wk+1 = wk − ηk∇LS ( wk ) = wk − 2ηk n n∑ i=1 xi ( x > i wk − yi ) . ( GD ) Next we introduce mini-batch stochastic gradient descent ( SGD ) .1 Let b be the batch size . For simplicity suppose n = mb for an integer m ( number of mini-batches ) . Then at each epoch , SGD first randomly partitions the training set into m disjoint mini-batches with size b , and then sequentially performs m updates using the stochastic gradients calculated over the m mini-batches . Specifically , at the k-th epoch , let the mini-batch index sets be Bk1 , Bk2 , . . . , Bkm , where |Bkj | = b and⋃m j=1 Bkj = { 1 , 2 , . . . , n } , then SGD takes m updates as follows wk , j+1 = wk , j− ηk b ∑ i∈Bkj ∇ ` i ( wk , j ) = wk , j− 2ηk b ∑ i∈Bkj xi ( x > i wk , j−yi ) , j = 1 , . . . , m. ( SGD ) We also write wk+1 = wk , m+1 and wk = wk,1 to be consistent with notations in ( GD ) . 2.1 THE MINIMUM-NORM BIAS . Before presenting our results on the directional bias , let us first recap the well-known minimumnorm bias for SGD/GD optimizing linear regression problem ( Zhang et al. , 2016 ; Gunasekar et al. , 2018a ; Belkin et al. , 2019 ; Bartlett et al. , 2020 ) . We rewrite the training loss as LS ( w ) = 1 n ∥∥X > w − Y ∥∥2 2 , where X = ( x1 , . . . , xn ) ∈ Rd×n and Y = ( y1 , . . . , yn ) > ∈ Rn . Then its global minima are given byW∗ : = { w ∈ Rd : Pw = w∗ , w∗ : = X ( X > X ) −1Y } , where P is the projection operator onto the data manifold , i.e. , the column space of X . We focus on overparameterized cases whereW∗ contains multiple elements . Notice that every gradient∇ ` i ( w ) = 2xi ( x > i w−yi ) is spanned in the data manifold , thus ( GD ) and ( SGD ) can never move along the direction that is orthogonal to the data manifold . In other words , ( GD ) and ( SGD ) implicitly admit the following hypothesis class : HS = { w ∈ Rd : P⊥w = P⊥w0 } , ( 1 ) where w0 is the initialization and P⊥ = I − P is the projection operator onto the orthogonal complement to the column space of X . Putting things together , for any global optimum w ∈ W∗ ( hence Pw = w∗ ) , we have ‖w − w0‖22 = ‖Pw − Pw0‖ 2 2 + ‖P⊥w − P⊥w0‖ 2 2 = ‖w∗ − Pw0‖ 2 2 + ‖P⊥w − P⊥w0‖ 2 2 , where the right hand side is minimized when P⊥w = P⊥w0 , i.e. , w ∈ HS , thus w is the solution found by SGD/GD in the non-degenerated cases ( when the learning rate is set properly so that the algorithms can find a global optimum ) . In sum , SGD/GD is biased to find the global optimum that is closest to the initialization , which is referred as the “ minimum-norm ” bias in literature since the initialization is usually set to be zero . 1In this paper we focus on SGD without replacement , nonetheless our results and techniques are ready to be extended to SGD with replacement as well . 3 WARMING UP : A 2-DIMENSIONAL CASE STUDY . In this section we conduct a 2-dimensional case study to motivate our understanding on the directional bias of SGD in the moderate learning rate regime . Let us consider a training set consisting of two orthogonal points , S = { ( x1 , y1 = 0 ) , ( x2 , y2 = 0 ) } where x1 = √ κ · e1 = ( √ κ , 0 ) > , x2 = e2 = ( 0 , 1 ) > , κ > 2 . Clearly w∗ = 0 is the unique minimum of LS ( w ) . The Hessian of the empirical loss is∇2 LS ( w ) = x1x > 1 + x2x > 2 = diag ( κ , 1 ) , which has two eigenvalues : the smaller one 1 is contributed by data x2 , and the larger one κ contributed by data x1 . Hence LS ( w ) is κ-smooth . Similarly the Hessian of the individual losses are∇2 ` 1 ( w ) = 2x1x > 1 = diag ( 2κ , 0 ) and∇2 ` 2 ( w ) = 2x2x > 2 = diag ( 0 , 2 ) . Thus ` 2 ( w ) is 2-smooth , but ` 1 ( w ) , the individual loss for data x1 , is only 2κ-smooth , which is more ill-conditioned compared to LS ( w ) and ` 2 ( w ) . Next we consider a moderate initial learning rate η ∈ ( 1 κ , 2 1+κ ) . According to convex optimization theory ( Boyd et al. , 2004 ) , gradient step with such learning rate is convergent for LS ( w ) and ` 2 ( w ) , but oscillating for ` 1 ( w ) . In other words , ( GD ) is convergent ; and ( SGD ) is convergent along direction x2 ( or e2 ) , but oscillating along direction x1 ( or e1 ) . We also see this by analytically solving ( GD ) and ( SGD ) for this example : wgdk = ( ( 1− ηκ ) k ( 1− η ) k ) w0 , w sgd k = ( ( 1− 2ηκ ) k ( 1− 2η ) k ) w0 , ( 2 ) where |1− ηκ| < |1− η| < 1 and |1− 2η| < 1 < |1− 2ηκ| . By Eq . ( 2 ) , with moderate learning rate GD is convergent for both directions e1 and e2 . Moreover , GD fits e1 faster since the contraction parameter is smaller , i.e. , |1− ηκ| < |1− η| < 1 . Thus observing the entire optimization path , GD approaches the minimum w∗ = 0 along e2 , which corresponds to the smaller eigenvalue direction of ∇2 LS ( w ) . This is verified by the blue dots in Figure 1 ( b ) . We note this directional bias for GD also holds in the small learning rate regime , as shown in Figure 1 ( a ) . As for SGD in the initial phase where the learning rate is moderate , Eq . ( 2 ) shows it converges along e2 but oscillates along e1 since |1− 2η| < 1 < |1− 2ηκ| . In other words , SGD can not fit e1 before the learning rate decays ; however when this happens , e2 is already well fitted . Overall , SGD fits e2 first then fits e1 , i.e. , SGD converges to the minimum w∗ = 0 along e1 , which corresponds to the larger eigenvalue direction of∇2 LS ( w ) . This is verified by the red dots in Figure 1 ( b ) . We note this particular directional bias for SGD is dedicated to the moderate learning rate regime ; in the small learning rate regime , as discussed before , SGD behaves similar to GD thus goes after the smaller eigenvalue direction , which is illustrated in Figure 1 ( a ) . The above idea can be carried over to more general cases : the training loss usually has relatively smooth curvature because of the empirical averaging ; yet some individual losses can possess bad smoothness condition , corresponding to the data points that contribute to the large eigenvalues of the Hessian/data matrix . Then with a moderate learning rate , while GD is convergent , SGD is convergent for the smooth individual losses but oscillating for the ill-conditioned individual losses . Thus SGD can only fit the latter losses after the learning rate anneals . Therefore , in the moderate learning rate regime , SGD tends to converge along the large eigenvalue directions while GD tends to go after the small eigenvalue directions . We will rigorously justify the above intuitions in the following section .
In this paper, an implicit bias of SGD and GD in terms of the direction of convergence points is studied. This study shows that, in a setting of linear regression, SGD and GD converge to different directions, which are determined by the largest/smallest eigenvectors of a data matrix when the learning rate is moderately large. Experiments using synthetic data and Fashion MNIST support the theoretical results.
SP:b953f98385a35b4d1a1c7bd73f9eb64c470a4b80
Direction Matters: On the Implicit Bias of Stochastic Gradient Descent with Moderate Learning Rate
1 INTRODUCTION . Stochastic gradient descent ( SGD ) and its variants play a key role in training deep learning models . From the optimization perspective , SGD is favorable in many aspects , e.g. , scalability for large-scale models ( He et al. , 2016 ) , parallelizability with big training data ( Goyal et al. , 2017 ) , and rich theory for its convergence ( Ghadimi & Lan , 2013 ; Gower et al. , 2019 ) . From the learning perspective , more surprisingly , overparameterized deep nets trained by SGD usually generalize well , even in the absence of explicit regularizers ( Zhang et al. , 2016 ; Keskar et al. , 2016 ) . This suggests that SGD favors certain “ good ” solutions among the numerous global optima of the overparameterized model . Such phenomenon is attributed to the implicit bias of SGD . It remains one of the key theoretical challenges to characterize the algorithmic bias of SGD , especially with moderate and annealing learning rate as typically used in practice ( He et al. , 2016 ; Keskar et al. , 2016 ) . In the small learning rate regime , the regularization effect of SGD is relatively well understood , thanks to the recent advances on the implicit bias of gradient descent ( GD ) ( Gunasekar et al. , 2017 ; 2018a ; b ; Soudry et al. , 2018 ; Ma et al. , 2018 ; Li et al. , 2018 ; Ji & Telgarsky , 2019b ; a ; Ji et al. , 2020 ; Nacson et al. , 2019a ; Ali et al. , 2019 ; Arora et al. , 2019 ; Moroshko et al. , 2020 ; Chizat & Bach , 2020 ) . According to classical stochastic approximation theory ( Kushner & Yin , 2003 ) , with a sufficiently small learning rate , the randomness in SGD is negligible ( which scales with learning rate ) , and as a consequence SGD will behave highly similar to its deterministic counterpart , i.e. , GD . Based on this fact , the regularization effect of SGD with small learning rate can be understood through that of GD . Take linear models for example , GD has been shown to be biased towards maxmargin/minimum-norm solutions depending on the problem setups ( Soudry et al. , 2018 ; Gunasekar et al. , 2018a ; Ali et al. , 2019 ) ; correspondingly , follow-ups show that SGD with small learning rate has the same bias ( up to certain small uncertainty governed by the learning rate ) ( Nacson et al. , 2019b ; Gunasekar et al. , 2018a ; Ali et al. , 2020 ) . The analogy between SGD and GD in the small learning rate regime is also demonstrated in Figures 1 ( a ) and 3 . However , the regularization theory for SGD with small learning rate can not explain the benefits of SGD in the moderate learning rate regime , where the initial learning rate is moderate and followed by annealing ( Li et al. , 2019 ; Nakkiran , 2020 ; Leclerc & Madry , 2020 ; Jastrzebski et al. , 2019 ) . In particular , empirical studies show that , in the moderate learning rate regime , ( small batch ) SGD generalizes much better than GD/large batch SGD ( Keskar et al. , 2016 ; Jastrzębski et al. , 2017 ; Zhu et al. , 2019 ; Wu et al. , 2020 ) ( see Figure 3 ) . This observation implies that , instead of imitating the bias of GD as in the small learning rate regime , SGD in the moderate learning rate regime admits superior bias than GD — it requires a dedicated characterization for the implicit regularization effect of SGD with moderate learning rate . In this paper , we reveal a particular regularization effect of SGD with moderate learning rate that involves convergence direction . In specific , we consider an overparameterized linear regression model learned by SGD/GD . In this setting , SGD and GD are known to converge to the unique minimumnorm solution ( Zhang et al. , 2016 ; Gunasekar et al. , 2018a ) ( see also Section 2.1 ) . However , with a moderate and annealing learning rate , we show that SGD and GD favor different convergence directions : SGD converges along the large eigenvalue directions of the data matrix ; in contrast , GD goes after the small eigenvalue directions . The phenomenon is illustrated in Figure 1 ( b ) . To sum up , we make the following contributions in this work : 1 . For an overparameterized linear regression model , we show that SGD with moderate learning rate converges along the large eigenvalue directions of the data matrix , while GD goes after the small eigenvalue directions . To our knowledge , this result initiates the regularization theory for SGD in the moderate learning rate regime , and complements existing results for the small learning rate . 2 . Furthermore , we show the particular directional bias of SGD with moderate learning rate benefits generalization when early stopping is used . This is because converging along the large eigenvalue directions ( SGD ) leads to nearly optimal solutions , while converging along the small eigenvalue directions ( GD ) can only give suboptimal solutions . 3 . Finally , our results explain several folk arts for tuning SGD hyperparameters , such as ( 1 ) linearly scaling the initial learning rate with batch size ( Goyal et al. , 2017 ) ; and ( 2 ) overrunning SGD with high learning rate even when the loss stops decreasing ( He et al. , 2016 ) . 2 PRELIMINARY . Let ( x , y ) ∈ Rd×R be a pair of d-dimensional feature vector and 1-dimensional label . We consider a linear regression problem with square loss defined as ` ( x , y ; w ) : = ( w > x− y ) 2 , where w ∈ Rd is the model parameter . LetD be the population distribution over ( x , y ) , then the test loss is LD ( w ) : = E ( x , y ) ∼D [ ` ( x , y ; w ) ] . Let S : = { ( xi , yi ) } ni=1 be a training set of n data points drawn i.i.d . from the population distributionD . Then the training/empirical loss is defined as the average of the individual loss over all training data points , LS ( w ) : = 1 n n∑ i=1 ` i ( w ) , where ` i ( w ) : = ` ( xi , yi ; w ) = ( w > xi − yi ) 2 . We use { ηk } to denote a learning rate scheme ( LR ) . Then gradient descent ( GD ) iteratively performs the following update : wk+1 = wk − ηk∇LS ( wk ) = wk − 2ηk n n∑ i=1 xi ( x > i wk − yi ) . ( GD ) Next we introduce mini-batch stochastic gradient descent ( SGD ) .1 Let b be the batch size . For simplicity suppose n = mb for an integer m ( number of mini-batches ) . Then at each epoch , SGD first randomly partitions the training set into m disjoint mini-batches with size b , and then sequentially performs m updates using the stochastic gradients calculated over the m mini-batches . Specifically , at the k-th epoch , let the mini-batch index sets be Bk1 , Bk2 , . . . , Bkm , where |Bkj | = b and⋃m j=1 Bkj = { 1 , 2 , . . . , n } , then SGD takes m updates as follows wk , j+1 = wk , j− ηk b ∑ i∈Bkj ∇ ` i ( wk , j ) = wk , j− 2ηk b ∑ i∈Bkj xi ( x > i wk , j−yi ) , j = 1 , . . . , m. ( SGD ) We also write wk+1 = wk , m+1 and wk = wk,1 to be consistent with notations in ( GD ) . 2.1 THE MINIMUM-NORM BIAS . Before presenting our results on the directional bias , let us first recap the well-known minimumnorm bias for SGD/GD optimizing linear regression problem ( Zhang et al. , 2016 ; Gunasekar et al. , 2018a ; Belkin et al. , 2019 ; Bartlett et al. , 2020 ) . We rewrite the training loss as LS ( w ) = 1 n ∥∥X > w − Y ∥∥2 2 , where X = ( x1 , . . . , xn ) ∈ Rd×n and Y = ( y1 , . . . , yn ) > ∈ Rn . Then its global minima are given byW∗ : = { w ∈ Rd : Pw = w∗ , w∗ : = X ( X > X ) −1Y } , where P is the projection operator onto the data manifold , i.e. , the column space of X . We focus on overparameterized cases whereW∗ contains multiple elements . Notice that every gradient∇ ` i ( w ) = 2xi ( x > i w−yi ) is spanned in the data manifold , thus ( GD ) and ( SGD ) can never move along the direction that is orthogonal to the data manifold . In other words , ( GD ) and ( SGD ) implicitly admit the following hypothesis class : HS = { w ∈ Rd : P⊥w = P⊥w0 } , ( 1 ) where w0 is the initialization and P⊥ = I − P is the projection operator onto the orthogonal complement to the column space of X . Putting things together , for any global optimum w ∈ W∗ ( hence Pw = w∗ ) , we have ‖w − w0‖22 = ‖Pw − Pw0‖ 2 2 + ‖P⊥w − P⊥w0‖ 2 2 = ‖w∗ − Pw0‖ 2 2 + ‖P⊥w − P⊥w0‖ 2 2 , where the right hand side is minimized when P⊥w = P⊥w0 , i.e. , w ∈ HS , thus w is the solution found by SGD/GD in the non-degenerated cases ( when the learning rate is set properly so that the algorithms can find a global optimum ) . In sum , SGD/GD is biased to find the global optimum that is closest to the initialization , which is referred as the “ minimum-norm ” bias in literature since the initialization is usually set to be zero . 1In this paper we focus on SGD without replacement , nonetheless our results and techniques are ready to be extended to SGD with replacement as well . 3 WARMING UP : A 2-DIMENSIONAL CASE STUDY . In this section we conduct a 2-dimensional case study to motivate our understanding on the directional bias of SGD in the moderate learning rate regime . Let us consider a training set consisting of two orthogonal points , S = { ( x1 , y1 = 0 ) , ( x2 , y2 = 0 ) } where x1 = √ κ · e1 = ( √ κ , 0 ) > , x2 = e2 = ( 0 , 1 ) > , κ > 2 . Clearly w∗ = 0 is the unique minimum of LS ( w ) . The Hessian of the empirical loss is∇2 LS ( w ) = x1x > 1 + x2x > 2 = diag ( κ , 1 ) , which has two eigenvalues : the smaller one 1 is contributed by data x2 , and the larger one κ contributed by data x1 . Hence LS ( w ) is κ-smooth . Similarly the Hessian of the individual losses are∇2 ` 1 ( w ) = 2x1x > 1 = diag ( 2κ , 0 ) and∇2 ` 2 ( w ) = 2x2x > 2 = diag ( 0 , 2 ) . Thus ` 2 ( w ) is 2-smooth , but ` 1 ( w ) , the individual loss for data x1 , is only 2κ-smooth , which is more ill-conditioned compared to LS ( w ) and ` 2 ( w ) . Next we consider a moderate initial learning rate η ∈ ( 1 κ , 2 1+κ ) . According to convex optimization theory ( Boyd et al. , 2004 ) , gradient step with such learning rate is convergent for LS ( w ) and ` 2 ( w ) , but oscillating for ` 1 ( w ) . In other words , ( GD ) is convergent ; and ( SGD ) is convergent along direction x2 ( or e2 ) , but oscillating along direction x1 ( or e1 ) . We also see this by analytically solving ( GD ) and ( SGD ) for this example : wgdk = ( ( 1− ηκ ) k ( 1− η ) k ) w0 , w sgd k = ( ( 1− 2ηκ ) k ( 1− 2η ) k ) w0 , ( 2 ) where |1− ηκ| < |1− η| < 1 and |1− 2η| < 1 < |1− 2ηκ| . By Eq . ( 2 ) , with moderate learning rate GD is convergent for both directions e1 and e2 . Moreover , GD fits e1 faster since the contraction parameter is smaller , i.e. , |1− ηκ| < |1− η| < 1 . Thus observing the entire optimization path , GD approaches the minimum w∗ = 0 along e2 , which corresponds to the smaller eigenvalue direction of ∇2 LS ( w ) . This is verified by the blue dots in Figure 1 ( b ) . We note this directional bias for GD also holds in the small learning rate regime , as shown in Figure 1 ( a ) . As for SGD in the initial phase where the learning rate is moderate , Eq . ( 2 ) shows it converges along e2 but oscillates along e1 since |1− 2η| < 1 < |1− 2ηκ| . In other words , SGD can not fit e1 before the learning rate decays ; however when this happens , e2 is already well fitted . Overall , SGD fits e2 first then fits e1 , i.e. , SGD converges to the minimum w∗ = 0 along e1 , which corresponds to the larger eigenvalue direction of∇2 LS ( w ) . This is verified by the red dots in Figure 1 ( b ) . We note this particular directional bias for SGD is dedicated to the moderate learning rate regime ; in the small learning rate regime , as discussed before , SGD behaves similar to GD thus goes after the smaller eigenvalue direction , which is illustrated in Figure 1 ( a ) . The above idea can be carried over to more general cases : the training loss usually has relatively smooth curvature because of the empirical averaging ; yet some individual losses can possess bad smoothness condition , corresponding to the data points that contribute to the large eigenvalues of the Hessian/data matrix . Then with a moderate learning rate , while GD is convergent , SGD is convergent for the smooth individual losses but oscillating for the ill-conditioned individual losses . Thus SGD can only fit the latter losses after the learning rate anneals . Therefore , in the moderate learning rate regime , SGD tends to converge along the large eigenvalue directions while GD tends to go after the small eigenvalue directions . We will rigorously justify the above intuitions in the following section .
In the paper the authors analyzed the convergence dynamics toward a minimum of gradient descent (GD) and stochastic gradient descent (SGD). The algorithms are considered to start in the basin of attraction of a minimum, and using discrete steps they approach the bottom. The main result of the paper concerns the fact that, with moderate learning rate, SGD approaches the minimum along the steepest direction, contrary to GD.
SP:b953f98385a35b4d1a1c7bd73f9eb64c470a4b80
Direction Matters: On the Implicit Bias of Stochastic Gradient Descent with Moderate Learning Rate
1 INTRODUCTION . Stochastic gradient descent ( SGD ) and its variants play a key role in training deep learning models . From the optimization perspective , SGD is favorable in many aspects , e.g. , scalability for large-scale models ( He et al. , 2016 ) , parallelizability with big training data ( Goyal et al. , 2017 ) , and rich theory for its convergence ( Ghadimi & Lan , 2013 ; Gower et al. , 2019 ) . From the learning perspective , more surprisingly , overparameterized deep nets trained by SGD usually generalize well , even in the absence of explicit regularizers ( Zhang et al. , 2016 ; Keskar et al. , 2016 ) . This suggests that SGD favors certain “ good ” solutions among the numerous global optima of the overparameterized model . Such phenomenon is attributed to the implicit bias of SGD . It remains one of the key theoretical challenges to characterize the algorithmic bias of SGD , especially with moderate and annealing learning rate as typically used in practice ( He et al. , 2016 ; Keskar et al. , 2016 ) . In the small learning rate regime , the regularization effect of SGD is relatively well understood , thanks to the recent advances on the implicit bias of gradient descent ( GD ) ( Gunasekar et al. , 2017 ; 2018a ; b ; Soudry et al. , 2018 ; Ma et al. , 2018 ; Li et al. , 2018 ; Ji & Telgarsky , 2019b ; a ; Ji et al. , 2020 ; Nacson et al. , 2019a ; Ali et al. , 2019 ; Arora et al. , 2019 ; Moroshko et al. , 2020 ; Chizat & Bach , 2020 ) . According to classical stochastic approximation theory ( Kushner & Yin , 2003 ) , with a sufficiently small learning rate , the randomness in SGD is negligible ( which scales with learning rate ) , and as a consequence SGD will behave highly similar to its deterministic counterpart , i.e. , GD . Based on this fact , the regularization effect of SGD with small learning rate can be understood through that of GD . Take linear models for example , GD has been shown to be biased towards maxmargin/minimum-norm solutions depending on the problem setups ( Soudry et al. , 2018 ; Gunasekar et al. , 2018a ; Ali et al. , 2019 ) ; correspondingly , follow-ups show that SGD with small learning rate has the same bias ( up to certain small uncertainty governed by the learning rate ) ( Nacson et al. , 2019b ; Gunasekar et al. , 2018a ; Ali et al. , 2020 ) . The analogy between SGD and GD in the small learning rate regime is also demonstrated in Figures 1 ( a ) and 3 . However , the regularization theory for SGD with small learning rate can not explain the benefits of SGD in the moderate learning rate regime , where the initial learning rate is moderate and followed by annealing ( Li et al. , 2019 ; Nakkiran , 2020 ; Leclerc & Madry , 2020 ; Jastrzebski et al. , 2019 ) . In particular , empirical studies show that , in the moderate learning rate regime , ( small batch ) SGD generalizes much better than GD/large batch SGD ( Keskar et al. , 2016 ; Jastrzębski et al. , 2017 ; Zhu et al. , 2019 ; Wu et al. , 2020 ) ( see Figure 3 ) . This observation implies that , instead of imitating the bias of GD as in the small learning rate regime , SGD in the moderate learning rate regime admits superior bias than GD — it requires a dedicated characterization for the implicit regularization effect of SGD with moderate learning rate . In this paper , we reveal a particular regularization effect of SGD with moderate learning rate that involves convergence direction . In specific , we consider an overparameterized linear regression model learned by SGD/GD . In this setting , SGD and GD are known to converge to the unique minimumnorm solution ( Zhang et al. , 2016 ; Gunasekar et al. , 2018a ) ( see also Section 2.1 ) . However , with a moderate and annealing learning rate , we show that SGD and GD favor different convergence directions : SGD converges along the large eigenvalue directions of the data matrix ; in contrast , GD goes after the small eigenvalue directions . The phenomenon is illustrated in Figure 1 ( b ) . To sum up , we make the following contributions in this work : 1 . For an overparameterized linear regression model , we show that SGD with moderate learning rate converges along the large eigenvalue directions of the data matrix , while GD goes after the small eigenvalue directions . To our knowledge , this result initiates the regularization theory for SGD in the moderate learning rate regime , and complements existing results for the small learning rate . 2 . Furthermore , we show the particular directional bias of SGD with moderate learning rate benefits generalization when early stopping is used . This is because converging along the large eigenvalue directions ( SGD ) leads to nearly optimal solutions , while converging along the small eigenvalue directions ( GD ) can only give suboptimal solutions . 3 . Finally , our results explain several folk arts for tuning SGD hyperparameters , such as ( 1 ) linearly scaling the initial learning rate with batch size ( Goyal et al. , 2017 ) ; and ( 2 ) overrunning SGD with high learning rate even when the loss stops decreasing ( He et al. , 2016 ) . 2 PRELIMINARY . Let ( x , y ) ∈ Rd×R be a pair of d-dimensional feature vector and 1-dimensional label . We consider a linear regression problem with square loss defined as ` ( x , y ; w ) : = ( w > x− y ) 2 , where w ∈ Rd is the model parameter . LetD be the population distribution over ( x , y ) , then the test loss is LD ( w ) : = E ( x , y ) ∼D [ ` ( x , y ; w ) ] . Let S : = { ( xi , yi ) } ni=1 be a training set of n data points drawn i.i.d . from the population distributionD . Then the training/empirical loss is defined as the average of the individual loss over all training data points , LS ( w ) : = 1 n n∑ i=1 ` i ( w ) , where ` i ( w ) : = ` ( xi , yi ; w ) = ( w > xi − yi ) 2 . We use { ηk } to denote a learning rate scheme ( LR ) . Then gradient descent ( GD ) iteratively performs the following update : wk+1 = wk − ηk∇LS ( wk ) = wk − 2ηk n n∑ i=1 xi ( x > i wk − yi ) . ( GD ) Next we introduce mini-batch stochastic gradient descent ( SGD ) .1 Let b be the batch size . For simplicity suppose n = mb for an integer m ( number of mini-batches ) . Then at each epoch , SGD first randomly partitions the training set into m disjoint mini-batches with size b , and then sequentially performs m updates using the stochastic gradients calculated over the m mini-batches . Specifically , at the k-th epoch , let the mini-batch index sets be Bk1 , Bk2 , . . . , Bkm , where |Bkj | = b and⋃m j=1 Bkj = { 1 , 2 , . . . , n } , then SGD takes m updates as follows wk , j+1 = wk , j− ηk b ∑ i∈Bkj ∇ ` i ( wk , j ) = wk , j− 2ηk b ∑ i∈Bkj xi ( x > i wk , j−yi ) , j = 1 , . . . , m. ( SGD ) We also write wk+1 = wk , m+1 and wk = wk,1 to be consistent with notations in ( GD ) . 2.1 THE MINIMUM-NORM BIAS . Before presenting our results on the directional bias , let us first recap the well-known minimumnorm bias for SGD/GD optimizing linear regression problem ( Zhang et al. , 2016 ; Gunasekar et al. , 2018a ; Belkin et al. , 2019 ; Bartlett et al. , 2020 ) . We rewrite the training loss as LS ( w ) = 1 n ∥∥X > w − Y ∥∥2 2 , where X = ( x1 , . . . , xn ) ∈ Rd×n and Y = ( y1 , . . . , yn ) > ∈ Rn . Then its global minima are given byW∗ : = { w ∈ Rd : Pw = w∗ , w∗ : = X ( X > X ) −1Y } , where P is the projection operator onto the data manifold , i.e. , the column space of X . We focus on overparameterized cases whereW∗ contains multiple elements . Notice that every gradient∇ ` i ( w ) = 2xi ( x > i w−yi ) is spanned in the data manifold , thus ( GD ) and ( SGD ) can never move along the direction that is orthogonal to the data manifold . In other words , ( GD ) and ( SGD ) implicitly admit the following hypothesis class : HS = { w ∈ Rd : P⊥w = P⊥w0 } , ( 1 ) where w0 is the initialization and P⊥ = I − P is the projection operator onto the orthogonal complement to the column space of X . Putting things together , for any global optimum w ∈ W∗ ( hence Pw = w∗ ) , we have ‖w − w0‖22 = ‖Pw − Pw0‖ 2 2 + ‖P⊥w − P⊥w0‖ 2 2 = ‖w∗ − Pw0‖ 2 2 + ‖P⊥w − P⊥w0‖ 2 2 , where the right hand side is minimized when P⊥w = P⊥w0 , i.e. , w ∈ HS , thus w is the solution found by SGD/GD in the non-degenerated cases ( when the learning rate is set properly so that the algorithms can find a global optimum ) . In sum , SGD/GD is biased to find the global optimum that is closest to the initialization , which is referred as the “ minimum-norm ” bias in literature since the initialization is usually set to be zero . 1In this paper we focus on SGD without replacement , nonetheless our results and techniques are ready to be extended to SGD with replacement as well . 3 WARMING UP : A 2-DIMENSIONAL CASE STUDY . In this section we conduct a 2-dimensional case study to motivate our understanding on the directional bias of SGD in the moderate learning rate regime . Let us consider a training set consisting of two orthogonal points , S = { ( x1 , y1 = 0 ) , ( x2 , y2 = 0 ) } where x1 = √ κ · e1 = ( √ κ , 0 ) > , x2 = e2 = ( 0 , 1 ) > , κ > 2 . Clearly w∗ = 0 is the unique minimum of LS ( w ) . The Hessian of the empirical loss is∇2 LS ( w ) = x1x > 1 + x2x > 2 = diag ( κ , 1 ) , which has two eigenvalues : the smaller one 1 is contributed by data x2 , and the larger one κ contributed by data x1 . Hence LS ( w ) is κ-smooth . Similarly the Hessian of the individual losses are∇2 ` 1 ( w ) = 2x1x > 1 = diag ( 2κ , 0 ) and∇2 ` 2 ( w ) = 2x2x > 2 = diag ( 0 , 2 ) . Thus ` 2 ( w ) is 2-smooth , but ` 1 ( w ) , the individual loss for data x1 , is only 2κ-smooth , which is more ill-conditioned compared to LS ( w ) and ` 2 ( w ) . Next we consider a moderate initial learning rate η ∈ ( 1 κ , 2 1+κ ) . According to convex optimization theory ( Boyd et al. , 2004 ) , gradient step with such learning rate is convergent for LS ( w ) and ` 2 ( w ) , but oscillating for ` 1 ( w ) . In other words , ( GD ) is convergent ; and ( SGD ) is convergent along direction x2 ( or e2 ) , but oscillating along direction x1 ( or e1 ) . We also see this by analytically solving ( GD ) and ( SGD ) for this example : wgdk = ( ( 1− ηκ ) k ( 1− η ) k ) w0 , w sgd k = ( ( 1− 2ηκ ) k ( 1− 2η ) k ) w0 , ( 2 ) where |1− ηκ| < |1− η| < 1 and |1− 2η| < 1 < |1− 2ηκ| . By Eq . ( 2 ) , with moderate learning rate GD is convergent for both directions e1 and e2 . Moreover , GD fits e1 faster since the contraction parameter is smaller , i.e. , |1− ηκ| < |1− η| < 1 . Thus observing the entire optimization path , GD approaches the minimum w∗ = 0 along e2 , which corresponds to the smaller eigenvalue direction of ∇2 LS ( w ) . This is verified by the blue dots in Figure 1 ( b ) . We note this directional bias for GD also holds in the small learning rate regime , as shown in Figure 1 ( a ) . As for SGD in the initial phase where the learning rate is moderate , Eq . ( 2 ) shows it converges along e2 but oscillates along e1 since |1− 2η| < 1 < |1− 2ηκ| . In other words , SGD can not fit e1 before the learning rate decays ; however when this happens , e2 is already well fitted . Overall , SGD fits e2 first then fits e1 , i.e. , SGD converges to the minimum w∗ = 0 along e1 , which corresponds to the larger eigenvalue direction of∇2 LS ( w ) . This is verified by the red dots in Figure 1 ( b ) . We note this particular directional bias for SGD is dedicated to the moderate learning rate regime ; in the small learning rate regime , as discussed before , SGD behaves similar to GD thus goes after the smaller eigenvalue direction , which is illustrated in Figure 1 ( a ) . The above idea can be carried over to more general cases : the training loss usually has relatively smooth curvature because of the empirical averaging ; yet some individual losses can possess bad smoothness condition , corresponding to the data points that contribute to the large eigenvalues of the Hessian/data matrix . Then with a moderate learning rate , while GD is convergent , SGD is convergent for the smooth individual losses but oscillating for the ill-conditioned individual losses . Thus SGD can only fit the latter losses after the learning rate anneals . Therefore , in the moderate learning rate regime , SGD tends to converge along the large eigenvalue directions while GD tends to go after the small eigenvalue directions . We will rigorously justify the above intuitions in the following section .
This paper analyzes the differences in the convergence of SGD and GD when using "small" and "moderate" learning rates to shed light on why SGD with "moderate" and annealing learning rates perform well in practice. Focusing on an overparametrized linear regression problem, the paper claims that SGD with a "moderate" learning converges differently (along the large eigenvalue directions) compared to SGD/GD with a "small" learning rate (along the small eigenvalue directions). They further show analytically for this problem that there exists a learning rate schedule (with moderate learning rates) such that SGD will perform + generalize well, while there exist small learning rate schedules such that GD will perform + generalize poorly.
SP:b953f98385a35b4d1a1c7bd73f9eb64c470a4b80
Ask Your Humans: Using Human Instructions to Improve Generalization in Reinforcement Learning
1 INTRODUCTION . One of the most remarkable aspects of human intelligence is the ability to quickly adapt to new tasks and environments . From a young age , children are able to acquire new skills and solve new tasks through imitation and instruction ( Council et al. , 2000 ; Meltzoff , 1988 ; Hunt , 1965 ) . The key is our ability to use language to learn abstract concepts and then reapply them in new settings . Inspired by this , one of the long term goals in AI is to build agents that can learn to accomplish new tasks and goals in an open-world setting using just a few examples or few instructions from humans . For example , if we had a health-care assistant robot , we might want to teach it how to bring us our favorite drink or make us a meal in just the way we like it , perhaps by showing it how to do this a few times and explaining the steps involved . However , the ability to adapt to new environments and tasks remains a distant dream . Previous work have considered using language as a high-level representation for RL ( Andreas et al. , 2017 ; Jiang et al. , 2019 ) . However , these approaches typically use language generated from templates that are hard-coded into the simulators the agents are tested in , allowing the agents to receive virtually unlimited training data to learn language abstractions . But both ideally and practically , instructions are a limited resource . If we want to build agents that can quickly adapt in open-world settings , they need to be able to learn from limited , real instruction data ( Luketina et al. , 2019 ) . And unlike the clean ontologies generated in these previous approaches , human language is noisy and diverse ; there are many ways to say the same thing . Approaches that aim to learn new tasks from humans must be able to use human-generated instructions . In this work , we take a step towards agents that can learn from limited human instruction and demonstration by collecting a new dataset with natural language annotated tasks and corresponding gameplay . The environment and dataset is designed to directly test multi-task and sub-task learning , as it consists of nearly 50 diverse crafting tasks.1 Crafts are designed to share similar features and 1Our dataset , environment , and code can be found at : https : //github.com/valeriechen/ask-your-humans . sub-steps so we would be able to test whether the method is able to learn these shared features and reuse existing knowledge to solve new , but related tasks more efficiently . Our dataset is collected in a crafting-based environment and contains over 6,000 game traces on 14 unique crafting tasks which serve as the training set . The other 35 crafting tasks will act as zero-shot tasks . The goal is for an agent to be able to learn one policy that is able to solve both tasks it was trained on as well as a variety of unseen tasks which contain similar sub-tasks as the training tasks . To do this , we train a neural network system to generate natural language instructions as a highlevel representation of the sub-task , and then a policy to achieve the goal condition given these instructions . Figure 1 shows how our agent takes in the given state of the environment and a goal ( Iron Ore ) , generates a language representation of the next instruction , and then uses the policy to select an action conditioned on the language representation - in this case to grab the key . We incorporate both imitation learning ( IL ) using both the language and human demonstrations and Reinforcement Learning ( RL ) rewards to train our agent to solve complicated multi-step tasks . Our approach which learns from human demonstrations and language outperforms or matches baseline methods in the standard RL setting . We demonstrate that language can be used to better generalize to new tasks without reward signals and outperforms baselines on average over 35 zero-shot crafting tasks . Our method uses language as a high-level task to help decompose a larger , complex task into sub-tasks and identify correct sub-tasks to utilize in a zero-shot task setting . We also show that the agent can learn few-shot tasks with only a few additional demos and instructions . Finally , training with human-generated instructions gives us an interpretable explanation of the agent ’ s behavior in cases of success and failure . Generalization is further demonstrated in the agent ’ s ability to explain how the task is decomposed in both train and evaluation settings , in a way that reflects the actual recipes that describe the crafting task . With our dataset collection procedure and languageconditioned method , we demonstrate that using natural human language can be practically applied to solving difficult RL problems and begin solving the generalization problem in RL . We hope that this will inspire future work that incorporates human annotation , specifically language annotation , to solve more difficult and diverse tasks . 2 RELATED WORK . Previous works on language descriptions of tasks and sub-tasks have generally relied on what Andreas et al . ( 2017 ) calls “ sketches. ” A sketch specifies the necessary sub-tasks for a final task and is manually constructed for every task . The agent then relies on reward signals from the sketches in order to learn these predefined sub-tasks . However , in our setup , we want to infer such “ sketches ” from a limited number of instructions given by human demonstrations . This setting is not only more difficult but also more realistic for practical applications of RL where we might not have a predefined ontology and simulator , just a limited number of human-generated instructions . In addition , at test time , their true zero-shot task requires the sketch , whereas our method is able to generate the “ sketches ” in the form of high-level language with no additional training and supervision . Similarly , other works have used synthetically generated sub-goals and descriptions to train their methods and suffer from similar problems of impracticality . Shu et al . ( 2018 ) introduces a Stochastic Temporal Grammar to enable interpretable multi-task RL in the Minecraft environment . Similarly , the BabyAI platform Chevalier-Boisvert et al . ( 2019a ) presents a synthetic language which models commands inside a grid-based environment . They utilize curriculum training to approach learning complex skills and demonstrate through experimentation in their environment that existing approaches of pure IL or pure RL are extremely sample inefficient . Cideron et al . ( 2019 ) extend Hindsight Experience Replay ( HER ) to language goals in the BabyAI platform to solve a single instruction generated from a hand-crafted language . The BabyAI environment is extended by Cao et al . ( 2020 ) to include descriptive texts of the environment to improve the generalization of RL agents . Jiang et al . ( 2019 ) also uses procedural generated language using the MuJoCo physics engine and the CLEVR engine to learn a hierarchical representation for multi-task RL . Oh et al . ( 2017 ) also tackles zero-shot generalizations , but like the others considers only procedurally-generated instructions , learning to use analogies to learn correspondences between similar sub-tasks . The main work that also investigates using a limited number of human-generated instructions in RL environments is Hu et al . ( 2019 ) . This paper also uses natural language instructions in hierarchical decision making to play a real-time strategy game involving moving troop units across long time scales . This work uses only behavioral cloning with natural language instructions , whereas we use a mixture of RL and imitation learning . They also do not investigate the benefits of language in zero-shot or few-shot settings and do not demonstrate cross-task generalization as we do . Hierarchical approaches as a way of learning abstractions is well studied in the Hierarchical Reinforcement Learning ( HRL ) literature ( Dayan & Hinton , 1993 ; Parr & Russell , 1998 ; Stolle & Precup , 2002 ) . This is typically done by predefining the low-level policies by hand , by using some proxy reward to learn a diverse set of useful low-level policies ( Heess et al. , 2016 ; Florensa et al. , 2017 ; Eysenbach et al. , 2018 ; Hausman et al. , 2018 ; Marino et al. , 2019 ) , or more generally learning options ( Sutton et al. , 1999 ) . Our approach differs in that unlike in options and other frameworks , we generate language as a high-level state which conditions the agent ’ s policy rather than handing control over to low-level policies directly . Other works have shown the effectiveness of using a combination of reinforcement learning and imitation learning . Le et al . ( 2018 ) presents a hybrid hierarchical reinforcement learning and imitation learning algorithm for the game Montezuma ’ s revenge by leveraging IL for the high-level controller and RL for the low-level controller demonstrating the potential for combining IL and RL to achieve the benefits of both algorithms . By learning meta-actions , the agent is able to learn to solve the complex game . However , their meta-actions were also hand specified . Others have utilized natural language for other tasks , including Williams et al . ( 2018 ) , Co-Reyes et al . ( 2018 ) , and Andreas et al . ( 2018 ) but not focused on the multi-task learning setting . Matthews et al . ( 2019 ) demonstrates the use of word embeddings to inform robotic motor control as evidence of particular promise for exploiting the relationship between language and control . Narasimhan et al . ( 2018 ) uses language descriptions of the environment to aid domain transfer . The sub-field of language and vision navigation specifically has investigated how to train agents to navigate to a particular location in an environment given templated or natural language ( Chaplot et al. , 2018 ; Anderson et al. , 2018 ; Tellex et al. , 2011 ; Mei et al. , 2016 ; Chen & Mooney , 2011 ; Yu et al. , 2018 ) or to navigate to a particular location to answer a question Das et al . ( 2018 ) . Similarly to this work , Nguyen et al . ( 2019 ) uses human-generated language to find objects in a simulated environment , Zhong et al . ( 2020 ) and Branavan et al . ( 2012 ) reads a document ( i.e . a players manual ) to play a variety of games , and Lynch & Sermanet ( 2020 ) trains agents to follow both image and languagebased goals . All of these works require the agent to read some text at both train and test time and follow those instructions to achieve some goal . In contrast , at test time , our agent only receives a high-level goal , which is what item to craft . Our agent must take the high-level goal as input and generates its own instructions to solve the task . In other words , our task is both instruction following and instruction generation . Related to instruction generation , some work have explored more generally intrinsic motivation for goal generation ( Florensa et al. , 2018 ; Forestier et al. , 2017 ) . In our work , however , we learn the goals via the human language instructions . 3 HUMAN ANNOTATION COLLECTION . The first step of our approach requires human demonstrations and instructions . To that requirement , we built an interface to collect human-annotated data to guide the learning model . Crafting Task : The goal of the agent in our world is to complete crafts . By design , a crafting-based world allows for complexity and hierarchy in how the agent interacts with items in the gridworld . To craft an item , the agent must generally first pick up a tool , go to a resource , mine the resource , and then go to a table to craft the item . To make an iron ore , the agent must use the pickaxe at the Iron Ore Vein to mine Iron Ore to complete the task . The Iron Ore recipe is an example of a 1-step task because it creates one item . A 5-step task , like Diamond Pickaxe , involves the mining and/or crafting of 5 items . We capped the tasks at a maximum length of 5 recipe steps to limit the amount of time a worker would have to spend on the task . Note that each recipe step requires multiple time-steps to complete . Crafts are designed to share similar features and sub-steps to test whether the agent is able to learn these shared features and reuse existing knowledge to solve new , but related tasks more efficiently ( these relations between tasks are detailed in Table 3 and in Figure 10 ) . While the task may seem simple to human annotators to solve , such compositional tasks still pose difficulties for sparse-reward RL . We further increase the difficulty of this task by restricting the agent to a limited number of steps ( 100 ) to complete the task , leaving little room to make unrecoverable mistakes such as spending time collecting or using unnecessary resources . Data Collection Process : Figure 2 shows our interface . Given the goal craft , relevant recipes , and the initial board configuration , the worker provides step-by-step instructions accompanied by execution on the actual game board of each instruction . The workflow would be to type one instruction , execute the instruction , then type the next instruction , and execute until the goal was completed . The data collection interface and a corresponding example set of natural language instructions provided by a Turker is illustrated on the rightmost side of Figure 2 . This is but one way that a Turker might choose to break down the 5-step crafting task . The appendix has more details on the collection process in Section A.1 . We will release the environment and dataset . Dataset Analysis : Between the 14 crafts , we collected 6,322 games on AMT . In total , this dataset contains 195,405 state-action pairs and 35,901 total instructions . In the supplementary material we present relevant summary statistics about the data , including the number of instructions provided for each n-step task . The number of instructions , and consequently , actions required increases with the number steps as shown in Table 4 .
In this paper, the authors present a system that exploits both natural-language instructions, and demonstrations, to learn how to perform multi-subtask tasks in a Minecraft-like environment. The system has two objectives: First, given a state and objective, learn to generate a natural language description of the high-level subtasks to perform (based on training from human instructions and demonstrations); and second, learn a policy to actually perform the steps. The policy network accepts both the state description and the final state of the natural language generation network as input at every step. The system's zero-shot performance is evaluated on previously-unseen tasks with neither demonstrations nor natural-language descriptions provided.
SP:f2ba107be2c91442139b0e67d5612571a330c901
Ask Your Humans: Using Human Instructions to Improve Generalization in Reinforcement Learning
1 INTRODUCTION . One of the most remarkable aspects of human intelligence is the ability to quickly adapt to new tasks and environments . From a young age , children are able to acquire new skills and solve new tasks through imitation and instruction ( Council et al. , 2000 ; Meltzoff , 1988 ; Hunt , 1965 ) . The key is our ability to use language to learn abstract concepts and then reapply them in new settings . Inspired by this , one of the long term goals in AI is to build agents that can learn to accomplish new tasks and goals in an open-world setting using just a few examples or few instructions from humans . For example , if we had a health-care assistant robot , we might want to teach it how to bring us our favorite drink or make us a meal in just the way we like it , perhaps by showing it how to do this a few times and explaining the steps involved . However , the ability to adapt to new environments and tasks remains a distant dream . Previous work have considered using language as a high-level representation for RL ( Andreas et al. , 2017 ; Jiang et al. , 2019 ) . However , these approaches typically use language generated from templates that are hard-coded into the simulators the agents are tested in , allowing the agents to receive virtually unlimited training data to learn language abstractions . But both ideally and practically , instructions are a limited resource . If we want to build agents that can quickly adapt in open-world settings , they need to be able to learn from limited , real instruction data ( Luketina et al. , 2019 ) . And unlike the clean ontologies generated in these previous approaches , human language is noisy and diverse ; there are many ways to say the same thing . Approaches that aim to learn new tasks from humans must be able to use human-generated instructions . In this work , we take a step towards agents that can learn from limited human instruction and demonstration by collecting a new dataset with natural language annotated tasks and corresponding gameplay . The environment and dataset is designed to directly test multi-task and sub-task learning , as it consists of nearly 50 diverse crafting tasks.1 Crafts are designed to share similar features and 1Our dataset , environment , and code can be found at : https : //github.com/valeriechen/ask-your-humans . sub-steps so we would be able to test whether the method is able to learn these shared features and reuse existing knowledge to solve new , but related tasks more efficiently . Our dataset is collected in a crafting-based environment and contains over 6,000 game traces on 14 unique crafting tasks which serve as the training set . The other 35 crafting tasks will act as zero-shot tasks . The goal is for an agent to be able to learn one policy that is able to solve both tasks it was trained on as well as a variety of unseen tasks which contain similar sub-tasks as the training tasks . To do this , we train a neural network system to generate natural language instructions as a highlevel representation of the sub-task , and then a policy to achieve the goal condition given these instructions . Figure 1 shows how our agent takes in the given state of the environment and a goal ( Iron Ore ) , generates a language representation of the next instruction , and then uses the policy to select an action conditioned on the language representation - in this case to grab the key . We incorporate both imitation learning ( IL ) using both the language and human demonstrations and Reinforcement Learning ( RL ) rewards to train our agent to solve complicated multi-step tasks . Our approach which learns from human demonstrations and language outperforms or matches baseline methods in the standard RL setting . We demonstrate that language can be used to better generalize to new tasks without reward signals and outperforms baselines on average over 35 zero-shot crafting tasks . Our method uses language as a high-level task to help decompose a larger , complex task into sub-tasks and identify correct sub-tasks to utilize in a zero-shot task setting . We also show that the agent can learn few-shot tasks with only a few additional demos and instructions . Finally , training with human-generated instructions gives us an interpretable explanation of the agent ’ s behavior in cases of success and failure . Generalization is further demonstrated in the agent ’ s ability to explain how the task is decomposed in both train and evaluation settings , in a way that reflects the actual recipes that describe the crafting task . With our dataset collection procedure and languageconditioned method , we demonstrate that using natural human language can be practically applied to solving difficult RL problems and begin solving the generalization problem in RL . We hope that this will inspire future work that incorporates human annotation , specifically language annotation , to solve more difficult and diverse tasks . 2 RELATED WORK . Previous works on language descriptions of tasks and sub-tasks have generally relied on what Andreas et al . ( 2017 ) calls “ sketches. ” A sketch specifies the necessary sub-tasks for a final task and is manually constructed for every task . The agent then relies on reward signals from the sketches in order to learn these predefined sub-tasks . However , in our setup , we want to infer such “ sketches ” from a limited number of instructions given by human demonstrations . This setting is not only more difficult but also more realistic for practical applications of RL where we might not have a predefined ontology and simulator , just a limited number of human-generated instructions . In addition , at test time , their true zero-shot task requires the sketch , whereas our method is able to generate the “ sketches ” in the form of high-level language with no additional training and supervision . Similarly , other works have used synthetically generated sub-goals and descriptions to train their methods and suffer from similar problems of impracticality . Shu et al . ( 2018 ) introduces a Stochastic Temporal Grammar to enable interpretable multi-task RL in the Minecraft environment . Similarly , the BabyAI platform Chevalier-Boisvert et al . ( 2019a ) presents a synthetic language which models commands inside a grid-based environment . They utilize curriculum training to approach learning complex skills and demonstrate through experimentation in their environment that existing approaches of pure IL or pure RL are extremely sample inefficient . Cideron et al . ( 2019 ) extend Hindsight Experience Replay ( HER ) to language goals in the BabyAI platform to solve a single instruction generated from a hand-crafted language . The BabyAI environment is extended by Cao et al . ( 2020 ) to include descriptive texts of the environment to improve the generalization of RL agents . Jiang et al . ( 2019 ) also uses procedural generated language using the MuJoCo physics engine and the CLEVR engine to learn a hierarchical representation for multi-task RL . Oh et al . ( 2017 ) also tackles zero-shot generalizations , but like the others considers only procedurally-generated instructions , learning to use analogies to learn correspondences between similar sub-tasks . The main work that also investigates using a limited number of human-generated instructions in RL environments is Hu et al . ( 2019 ) . This paper also uses natural language instructions in hierarchical decision making to play a real-time strategy game involving moving troop units across long time scales . This work uses only behavioral cloning with natural language instructions , whereas we use a mixture of RL and imitation learning . They also do not investigate the benefits of language in zero-shot or few-shot settings and do not demonstrate cross-task generalization as we do . Hierarchical approaches as a way of learning abstractions is well studied in the Hierarchical Reinforcement Learning ( HRL ) literature ( Dayan & Hinton , 1993 ; Parr & Russell , 1998 ; Stolle & Precup , 2002 ) . This is typically done by predefining the low-level policies by hand , by using some proxy reward to learn a diverse set of useful low-level policies ( Heess et al. , 2016 ; Florensa et al. , 2017 ; Eysenbach et al. , 2018 ; Hausman et al. , 2018 ; Marino et al. , 2019 ) , or more generally learning options ( Sutton et al. , 1999 ) . Our approach differs in that unlike in options and other frameworks , we generate language as a high-level state which conditions the agent ’ s policy rather than handing control over to low-level policies directly . Other works have shown the effectiveness of using a combination of reinforcement learning and imitation learning . Le et al . ( 2018 ) presents a hybrid hierarchical reinforcement learning and imitation learning algorithm for the game Montezuma ’ s revenge by leveraging IL for the high-level controller and RL for the low-level controller demonstrating the potential for combining IL and RL to achieve the benefits of both algorithms . By learning meta-actions , the agent is able to learn to solve the complex game . However , their meta-actions were also hand specified . Others have utilized natural language for other tasks , including Williams et al . ( 2018 ) , Co-Reyes et al . ( 2018 ) , and Andreas et al . ( 2018 ) but not focused on the multi-task learning setting . Matthews et al . ( 2019 ) demonstrates the use of word embeddings to inform robotic motor control as evidence of particular promise for exploiting the relationship between language and control . Narasimhan et al . ( 2018 ) uses language descriptions of the environment to aid domain transfer . The sub-field of language and vision navigation specifically has investigated how to train agents to navigate to a particular location in an environment given templated or natural language ( Chaplot et al. , 2018 ; Anderson et al. , 2018 ; Tellex et al. , 2011 ; Mei et al. , 2016 ; Chen & Mooney , 2011 ; Yu et al. , 2018 ) or to navigate to a particular location to answer a question Das et al . ( 2018 ) . Similarly to this work , Nguyen et al . ( 2019 ) uses human-generated language to find objects in a simulated environment , Zhong et al . ( 2020 ) and Branavan et al . ( 2012 ) reads a document ( i.e . a players manual ) to play a variety of games , and Lynch & Sermanet ( 2020 ) trains agents to follow both image and languagebased goals . All of these works require the agent to read some text at both train and test time and follow those instructions to achieve some goal . In contrast , at test time , our agent only receives a high-level goal , which is what item to craft . Our agent must take the high-level goal as input and generates its own instructions to solve the task . In other words , our task is both instruction following and instruction generation . Related to instruction generation , some work have explored more generally intrinsic motivation for goal generation ( Florensa et al. , 2018 ; Forestier et al. , 2017 ) . In our work , however , we learn the goals via the human language instructions . 3 HUMAN ANNOTATION COLLECTION . The first step of our approach requires human demonstrations and instructions . To that requirement , we built an interface to collect human-annotated data to guide the learning model . Crafting Task : The goal of the agent in our world is to complete crafts . By design , a crafting-based world allows for complexity and hierarchy in how the agent interacts with items in the gridworld . To craft an item , the agent must generally first pick up a tool , go to a resource , mine the resource , and then go to a table to craft the item . To make an iron ore , the agent must use the pickaxe at the Iron Ore Vein to mine Iron Ore to complete the task . The Iron Ore recipe is an example of a 1-step task because it creates one item . A 5-step task , like Diamond Pickaxe , involves the mining and/or crafting of 5 items . We capped the tasks at a maximum length of 5 recipe steps to limit the amount of time a worker would have to spend on the task . Note that each recipe step requires multiple time-steps to complete . Crafts are designed to share similar features and sub-steps to test whether the agent is able to learn these shared features and reuse existing knowledge to solve new , but related tasks more efficiently ( these relations between tasks are detailed in Table 3 and in Figure 10 ) . While the task may seem simple to human annotators to solve , such compositional tasks still pose difficulties for sparse-reward RL . We further increase the difficulty of this task by restricting the agent to a limited number of steps ( 100 ) to complete the task , leaving little room to make unrecoverable mistakes such as spending time collecting or using unnecessary resources . Data Collection Process : Figure 2 shows our interface . Given the goal craft , relevant recipes , and the initial board configuration , the worker provides step-by-step instructions accompanied by execution on the actual game board of each instruction . The workflow would be to type one instruction , execute the instruction , then type the next instruction , and execute until the goal was completed . The data collection interface and a corresponding example set of natural language instructions provided by a Turker is illustrated on the rightmost side of Figure 2 . This is but one way that a Turker might choose to break down the 5-step crafting task . The appendix has more details on the collection process in Section A.1 . We will release the environment and dataset . Dataset Analysis : Between the 14 crafts , we collected 6,322 games on AMT . In total , this dataset contains 195,405 state-action pairs and 35,901 total instructions . In the supplementary material we present relevant summary statistics about the data , including the number of instructions provided for each n-step task . The number of instructions , and consequently , actions required increases with the number steps as shown in Table 4 .
This paper proposes to use natural language to aid reinforcement learning by generating instructions for sub-goals that allow the agent to complete tasks with delayed rewards. The authors first design a multi-task crafting environment and collect step-by-step human demonstrations along with sub-goal instructions using crowdsourced workers. The proposed method then involves a model architecture that includes a recurrent neural network for generating instructions, and a policy network that produces actions conditioned on the state and the instruction. The model is trained using a combination of imitation learning and reinforcement learning. Experiments reveal that the proposed method outperforms several baselines and also generalizes well to zero-shot unseen tasks (where the goal is to craft new combinations of seen components).
SP:f2ba107be2c91442139b0e67d5612571a330c901
Ask Your Humans: Using Human Instructions to Improve Generalization in Reinforcement Learning
1 INTRODUCTION . One of the most remarkable aspects of human intelligence is the ability to quickly adapt to new tasks and environments . From a young age , children are able to acquire new skills and solve new tasks through imitation and instruction ( Council et al. , 2000 ; Meltzoff , 1988 ; Hunt , 1965 ) . The key is our ability to use language to learn abstract concepts and then reapply them in new settings . Inspired by this , one of the long term goals in AI is to build agents that can learn to accomplish new tasks and goals in an open-world setting using just a few examples or few instructions from humans . For example , if we had a health-care assistant robot , we might want to teach it how to bring us our favorite drink or make us a meal in just the way we like it , perhaps by showing it how to do this a few times and explaining the steps involved . However , the ability to adapt to new environments and tasks remains a distant dream . Previous work have considered using language as a high-level representation for RL ( Andreas et al. , 2017 ; Jiang et al. , 2019 ) . However , these approaches typically use language generated from templates that are hard-coded into the simulators the agents are tested in , allowing the agents to receive virtually unlimited training data to learn language abstractions . But both ideally and practically , instructions are a limited resource . If we want to build agents that can quickly adapt in open-world settings , they need to be able to learn from limited , real instruction data ( Luketina et al. , 2019 ) . And unlike the clean ontologies generated in these previous approaches , human language is noisy and diverse ; there are many ways to say the same thing . Approaches that aim to learn new tasks from humans must be able to use human-generated instructions . In this work , we take a step towards agents that can learn from limited human instruction and demonstration by collecting a new dataset with natural language annotated tasks and corresponding gameplay . The environment and dataset is designed to directly test multi-task and sub-task learning , as it consists of nearly 50 diverse crafting tasks.1 Crafts are designed to share similar features and 1Our dataset , environment , and code can be found at : https : //github.com/valeriechen/ask-your-humans . sub-steps so we would be able to test whether the method is able to learn these shared features and reuse existing knowledge to solve new , but related tasks more efficiently . Our dataset is collected in a crafting-based environment and contains over 6,000 game traces on 14 unique crafting tasks which serve as the training set . The other 35 crafting tasks will act as zero-shot tasks . The goal is for an agent to be able to learn one policy that is able to solve both tasks it was trained on as well as a variety of unseen tasks which contain similar sub-tasks as the training tasks . To do this , we train a neural network system to generate natural language instructions as a highlevel representation of the sub-task , and then a policy to achieve the goal condition given these instructions . Figure 1 shows how our agent takes in the given state of the environment and a goal ( Iron Ore ) , generates a language representation of the next instruction , and then uses the policy to select an action conditioned on the language representation - in this case to grab the key . We incorporate both imitation learning ( IL ) using both the language and human demonstrations and Reinforcement Learning ( RL ) rewards to train our agent to solve complicated multi-step tasks . Our approach which learns from human demonstrations and language outperforms or matches baseline methods in the standard RL setting . We demonstrate that language can be used to better generalize to new tasks without reward signals and outperforms baselines on average over 35 zero-shot crafting tasks . Our method uses language as a high-level task to help decompose a larger , complex task into sub-tasks and identify correct sub-tasks to utilize in a zero-shot task setting . We also show that the agent can learn few-shot tasks with only a few additional demos and instructions . Finally , training with human-generated instructions gives us an interpretable explanation of the agent ’ s behavior in cases of success and failure . Generalization is further demonstrated in the agent ’ s ability to explain how the task is decomposed in both train and evaluation settings , in a way that reflects the actual recipes that describe the crafting task . With our dataset collection procedure and languageconditioned method , we demonstrate that using natural human language can be practically applied to solving difficult RL problems and begin solving the generalization problem in RL . We hope that this will inspire future work that incorporates human annotation , specifically language annotation , to solve more difficult and diverse tasks . 2 RELATED WORK . Previous works on language descriptions of tasks and sub-tasks have generally relied on what Andreas et al . ( 2017 ) calls “ sketches. ” A sketch specifies the necessary sub-tasks for a final task and is manually constructed for every task . The agent then relies on reward signals from the sketches in order to learn these predefined sub-tasks . However , in our setup , we want to infer such “ sketches ” from a limited number of instructions given by human demonstrations . This setting is not only more difficult but also more realistic for practical applications of RL where we might not have a predefined ontology and simulator , just a limited number of human-generated instructions . In addition , at test time , their true zero-shot task requires the sketch , whereas our method is able to generate the “ sketches ” in the form of high-level language with no additional training and supervision . Similarly , other works have used synthetically generated sub-goals and descriptions to train their methods and suffer from similar problems of impracticality . Shu et al . ( 2018 ) introduces a Stochastic Temporal Grammar to enable interpretable multi-task RL in the Minecraft environment . Similarly , the BabyAI platform Chevalier-Boisvert et al . ( 2019a ) presents a synthetic language which models commands inside a grid-based environment . They utilize curriculum training to approach learning complex skills and demonstrate through experimentation in their environment that existing approaches of pure IL or pure RL are extremely sample inefficient . Cideron et al . ( 2019 ) extend Hindsight Experience Replay ( HER ) to language goals in the BabyAI platform to solve a single instruction generated from a hand-crafted language . The BabyAI environment is extended by Cao et al . ( 2020 ) to include descriptive texts of the environment to improve the generalization of RL agents . Jiang et al . ( 2019 ) also uses procedural generated language using the MuJoCo physics engine and the CLEVR engine to learn a hierarchical representation for multi-task RL . Oh et al . ( 2017 ) also tackles zero-shot generalizations , but like the others considers only procedurally-generated instructions , learning to use analogies to learn correspondences between similar sub-tasks . The main work that also investigates using a limited number of human-generated instructions in RL environments is Hu et al . ( 2019 ) . This paper also uses natural language instructions in hierarchical decision making to play a real-time strategy game involving moving troop units across long time scales . This work uses only behavioral cloning with natural language instructions , whereas we use a mixture of RL and imitation learning . They also do not investigate the benefits of language in zero-shot or few-shot settings and do not demonstrate cross-task generalization as we do . Hierarchical approaches as a way of learning abstractions is well studied in the Hierarchical Reinforcement Learning ( HRL ) literature ( Dayan & Hinton , 1993 ; Parr & Russell , 1998 ; Stolle & Precup , 2002 ) . This is typically done by predefining the low-level policies by hand , by using some proxy reward to learn a diverse set of useful low-level policies ( Heess et al. , 2016 ; Florensa et al. , 2017 ; Eysenbach et al. , 2018 ; Hausman et al. , 2018 ; Marino et al. , 2019 ) , or more generally learning options ( Sutton et al. , 1999 ) . Our approach differs in that unlike in options and other frameworks , we generate language as a high-level state which conditions the agent ’ s policy rather than handing control over to low-level policies directly . Other works have shown the effectiveness of using a combination of reinforcement learning and imitation learning . Le et al . ( 2018 ) presents a hybrid hierarchical reinforcement learning and imitation learning algorithm for the game Montezuma ’ s revenge by leveraging IL for the high-level controller and RL for the low-level controller demonstrating the potential for combining IL and RL to achieve the benefits of both algorithms . By learning meta-actions , the agent is able to learn to solve the complex game . However , their meta-actions were also hand specified . Others have utilized natural language for other tasks , including Williams et al . ( 2018 ) , Co-Reyes et al . ( 2018 ) , and Andreas et al . ( 2018 ) but not focused on the multi-task learning setting . Matthews et al . ( 2019 ) demonstrates the use of word embeddings to inform robotic motor control as evidence of particular promise for exploiting the relationship between language and control . Narasimhan et al . ( 2018 ) uses language descriptions of the environment to aid domain transfer . The sub-field of language and vision navigation specifically has investigated how to train agents to navigate to a particular location in an environment given templated or natural language ( Chaplot et al. , 2018 ; Anderson et al. , 2018 ; Tellex et al. , 2011 ; Mei et al. , 2016 ; Chen & Mooney , 2011 ; Yu et al. , 2018 ) or to navigate to a particular location to answer a question Das et al . ( 2018 ) . Similarly to this work , Nguyen et al . ( 2019 ) uses human-generated language to find objects in a simulated environment , Zhong et al . ( 2020 ) and Branavan et al . ( 2012 ) reads a document ( i.e . a players manual ) to play a variety of games , and Lynch & Sermanet ( 2020 ) trains agents to follow both image and languagebased goals . All of these works require the agent to read some text at both train and test time and follow those instructions to achieve some goal . In contrast , at test time , our agent only receives a high-level goal , which is what item to craft . Our agent must take the high-level goal as input and generates its own instructions to solve the task . In other words , our task is both instruction following and instruction generation . Related to instruction generation , some work have explored more generally intrinsic motivation for goal generation ( Florensa et al. , 2018 ; Forestier et al. , 2017 ) . In our work , however , we learn the goals via the human language instructions . 3 HUMAN ANNOTATION COLLECTION . The first step of our approach requires human demonstrations and instructions . To that requirement , we built an interface to collect human-annotated data to guide the learning model . Crafting Task : The goal of the agent in our world is to complete crafts . By design , a crafting-based world allows for complexity and hierarchy in how the agent interacts with items in the gridworld . To craft an item , the agent must generally first pick up a tool , go to a resource , mine the resource , and then go to a table to craft the item . To make an iron ore , the agent must use the pickaxe at the Iron Ore Vein to mine Iron Ore to complete the task . The Iron Ore recipe is an example of a 1-step task because it creates one item . A 5-step task , like Diamond Pickaxe , involves the mining and/or crafting of 5 items . We capped the tasks at a maximum length of 5 recipe steps to limit the amount of time a worker would have to spend on the task . Note that each recipe step requires multiple time-steps to complete . Crafts are designed to share similar features and sub-steps to test whether the agent is able to learn these shared features and reuse existing knowledge to solve new , but related tasks more efficiently ( these relations between tasks are detailed in Table 3 and in Figure 10 ) . While the task may seem simple to human annotators to solve , such compositional tasks still pose difficulties for sparse-reward RL . We further increase the difficulty of this task by restricting the agent to a limited number of steps ( 100 ) to complete the task , leaving little room to make unrecoverable mistakes such as spending time collecting or using unnecessary resources . Data Collection Process : Figure 2 shows our interface . Given the goal craft , relevant recipes , and the initial board configuration , the worker provides step-by-step instructions accompanied by execution on the actual game board of each instruction . The workflow would be to type one instruction , execute the instruction , then type the next instruction , and execute until the goal was completed . The data collection interface and a corresponding example set of natural language instructions provided by a Turker is illustrated on the rightmost side of Figure 2 . This is but one way that a Turker might choose to break down the 5-step crafting task . The appendix has more details on the collection process in Section A.1 . We will release the environment and dataset . Dataset Analysis : Between the 14 crafts , we collected 6,322 games on AMT . In total , this dataset contains 195,405 state-action pairs and 35,901 total instructions . In the supplementary material we present relevant summary statistics about the data , including the number of instructions provided for each n-step task . The number of instructions , and consequently , actions required increases with the number steps as shown in Table 4 .
This paper studies the problem of generating natural language instructions to guide a policy to generalize to new environments where reward function is not given but a small set of demonstrations can be provided. A natural language generation (NLG) LSTM network and an initial policy network is trained from a labeled data collected from human workers. Environment state is encoded into a state encoding and LSTM is initialized with this vector to decode the correct sequence of instruction tokens. Policy network consumes both the state encoding and LSTM hidden state to output the correct action. This model is fine-tuned via reinforcement learning (RL) where the NLG component (assuming only the LSTM) is fixed and only policy network is updated (assuming state encoder is also updated from policy network). During testing, the instruction is not given but sampled from the NLG module. Experimental results show that language improves the performance, especially in zero-shot learning setting, compared to baselines where language is not incorporated or used naively in a discriminator network.
SP:f2ba107be2c91442139b0e67d5612571a330c901
Gradient-based tuning of Hamiltonian Monte Carlo hyperparameters
1 INTRODUCTION . Hamiltonian Monte Carlo ( HMC ) is a popular sampling based method for performing accurate inference on complex distributions that we may only know up to a normalization constant ( Neal , 2011 ) . Unfortunately , HMC can be slow to run in practice as we need to allow time for the simulation to ‘ burn-in ’ and also to sufficiently explore the full extent of the target distribution . Tuning the HMC hyperparameters can help alleviate these issues but this requires domain expertise and must be repeated for every problem HMC is applied to . There have been many attempts to provide an automatic method of tuning the hyperparameters . Some methods use a proxy for the mixing speed of the chain , i.e . the speed at which the Markov chain marginal distribution approaches the target . For example , Levy et al . ( 2018 ) use a variation on the expected squared jumped distance to tune parameters in order to encourage the chain to make large moves within the sample space . Other methods draw upon ideas from Variational Inference ( VI ) . VI ( Jordan et al. , 1999 ) is an optimization based method that is often contrasted to Markov Chain Monte Carlo methods such as HMC . In VI , we approximate the target using a parametric distribution , reducing the approximation bias through optimizing the distribution parameters . The optimization procedure maximises a lower bound on the normalization constant of the target which is equivalent to minimising the KL-divergence between the approximation and the target . To apply this idea to HMC , Salimans et al . ( 2015 ) ; Wolf et al . ( 2016 ) consider the marginal distribution of the final state in a finite length HMC chain as an implicit variational distribution with the intention of tuning the HMC parameters using the VI approach . However , the implicit distribution makes the usual variational lower bound intractable . To restore tractability , they make the bound looser by introducing an auxiliary inference distribution approximating the reverse dynamics of the chain . The looseness of the bound depends on the KL-divergence between the auxiliary inference distribution and the true reverse dynamics . As the chain length increases , the dimensionality of these distributions increases , tending to increase the looseness of the bound . This causes issues during optimization because the increasing magnitude of this extra KL-divergence term encourages the model to fit to the imperfect auxiliary inference distribution as opposed to the target as desired . Indeed , Salimans et al . ( 2015 ) only consider very short HMC chains using their method . In this work , we further investigate the combined VI-HMC approach as this has the potential to provide a direct measure of the chain ’ s convergence without the need to rely on proxies for per- formance . When applied to an implicit HMC marginal distribution , the variational objective can be broken down into the tractable expectation of the log target density and the intractable entropy of the variational approximation . This entropy term prevents a fully flexible variational distribution from collapsing to a point mass maximizing the log target density . Since HMC , by construction , can not collapse to such a point mass , we argue that the entropy term can be dropped provided the initial distribution of the chain has enough coverage of the target . We evaluate our proposed method on a variety of tasks . We first consider a range of synthetic 2D distributions before moving on to higher dimensional problems . In particular , we use our method to train deep latent variable models on the MNIST and FashionMNIST datasets . We also evaluate on a popular statistical mechanics benchmark : sampling molecular configurations from the Boltzmann distribution of a 22 atom molecule , Alanine Dipeptide . Our results show that this method is competitive with or can improve upon alternative tuning methods for HMC on all problems we consider . 2 BACKGROUND . 2.1 HAMILTONIAN MONTE CARLO . HMC is a Markov Chain Monte Carlo method ( Neal , 1993 ) which aims to draw samples from the n-dimensional target distribution p ( x ) = 1Z p ∗ ( x ) where Z is the ( usually unknown ) normalization constant . It introduces an auxiliary variable ν ∈ Rn , referred to as the momentum , which is distributed according to N ( ν ; 0 , diag ( m ) ) , with the resulting method sampling on the extended space ζ = ( x , ν ) . HMC progresses by first sampling an initial state from some initial distribution and then iteratively proposing new states and accepting/rejecting them according to an acceptance probability . To propose a new state , first , a new value for the momentum is drawn from N ( ν ; 0 , diag ( m ) ) , then , we simulate Hamiltonian Dynamics with Hamiltonian , H ( x , ν ) = −log p∗ ( x ) + 12ν T diag ( m ) −1ν arriving at new state ( x′ , ν′ ) . This new state is ac- cepted with probability min [ 1 , exp ( −H ( x′ , ν′ ) +H ( x , ν ) ) ] otherwise we reject the proposed state and remain at the starting state . The Hamiltonian Dynamics are simulated using a numerical integrator , the leapfrog integrator ( Hairer et al. , 2003 ) being a popular choice . To propose the new state , L leapfrog updates are taken , each update consisting of the following equations : νk+ 12 = νk + 1 2 ∇xk log p∗ ( xk ) xk+1 = xk + νk+ 12 1 m νk+1 = νk+ 12 + 1 2 ∇xk+1 log p∗ ( xk+1 ) where 1m = ( 1 m1 , . . . , 1mn ) and denotes element wise multiplication . The step size , , and the mass , m , are hyperparameters that need to be tuned for each problem the method is applied to . We note that in the usual definition of HMC , a single scalar valued is used . Our use of a vector implies a different step size in each dimension which , with proper tuning , can improve performance by taking into account the different scales in each dimension . The use of does mean the procedure can no longer be interpreted as simulating Hamiltonian Dynamics , however , it can still be used as a valid HMC proposal ( Neal , 2011 ) . We do not consider the problem of choosing L in this work . 2.2 VARIATIONAL INFERENCE . VI approximates the target p ( x ) with a tractable distribution qφ ( x ) parameterized by φ . We choose φ as to minimise the Kullback-Leibler divergence with the target , DKL ( qφ ( x ) ||p ( x ) ) . As we only know p ( x ) up to a normalization constant , we can equivalently choose φ as to maximise the tractable Evidence Lower-Bound ( ELBO ) : ELBO = logZ −DKL ( qφ ( x ) ||p ( x ) ) = Eqφ ( x ) [ log p∗ ( x ) − log qφ ( x ) ] . 3 HYPERPARAMETER TUNING THROUGH THE EXPECTED LOG-TARGET . VI tunes the parameters of an approximate distribution to make it closer to the target . We would like to use this idea to tune the hyperparameters of HMC . We can run multiple parallel HMC chains and treat the final states as independent samples from an implicit variational distribution . If each chain starts at initial distribution q ( 0 ) ( x ) and then runs T accept/reject cycles , we can denote this implicit distribution as q ( T ) φ ( x ) , where φ now represents the HMC hyperparameters . Ideally , we would then choose φ as to maximise the ELBO : φ∗ = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) − log q ( T ) φ ( x ) ] = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) ] +H ( q ( T ) φ ( x ) ) . Whilst the first term in this expression can be estimated directly via Monte Carlo , the entropy term , H ( q ( T ) φ ( x ) ) , is intractable . To get around this , we should consider the purpose of the two terms during optimization . Maximizing the first term encourages q ( T ) φ ( x ) to produce samples that are in the high probability regions of the target , i.e. , ensuring that q ( T ) φ ( x ) is high where log p ∗ ( x ) is high . The entropy term acts as a regularizer preventing q ( T ) φ ( x ) from simply collapsing to a delta function at the mode of p ( x ) . The key observation of our method is that HMC already fulfills this regularization role because the implicit distribution it defines is not fully flexible . If q ( T ) φ ( x ) were to collapse to a delta function , this would require the hyperparameters to be such that the HMC scheme guides samples to the same point in space no matter their starting position , as sampled from q ( 0 ) ( x ) , which is unreasonable for practical problems . Therefore , we propose tuning φ simply by maximizing the expected log target density under the final state of the chain : φ∗ = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) ] . ( 1 ) Although HMC does have a regularization effect , removing the entropy term does have some implications that we need to consider . Namely , if the initial distribution , q ( 0 ) ( x ) , is concentrated in a very high probability region of the target , p ( x ) , then optimizing objective ( 1 ) will not encourage HMC to explore the full target . Conversely , it would encourage the chains to remain in this region of high probability , close to their initial sampling point , which is undesirable behaviour . The key to avoiding this problem is to choose an initial distribution that has a sufficiently wide coverage of the target , we will discuss methods for doing this in Section 4 . We perform the optimization in ( 1 ) using stochastic gradient ascent with gradients being obtained using the standard reparameterization trick ( Rezende et al. , 2014 ; Kingma & Welling , 2014 ) . Samples from q ( T ) φ ( x ) can be obtained through a deterministic function of primitive random variables : x0 ∼ q ( 0 ) ( x ) for the initial distribution , γ0 : T−1 , γt ∼ N ( 0 , I ) for the momentum variables and a0 : T−1 , at ∼ U [ 0 , 1 ] for the accept/reject decisions . We denote this function as fφ ( x0 , γ0 : T−1 , a0 : T−1 ) . For minibatches of size N , the gradient is then estimated by 1 N N∑ n=1 ∇φlog p∗ ( fφ ( x ( n ) 0 , γ ( n ) 0 : T−1 , a ( n ) 0 : T−1 ) ) . ( 2 ) Each gradient value can be calculated using automatic differentiation tools . For ( 2 ) to be strictly unbiased , fφ must obey certain smoothness constraints to allow differentiation under the integral sign ( Border , 2016 ) . This does not hold in this case due to the accept/reject step . Other works have found success in making this approximation ( Levy et al. , 2018 ; Thin et al. , 2020 ) and as Thin et al . ( 2020 ) point out , this same issue is encountered when using the very popular ReLU activation function . Our empirical results confirm that ( 2 ) enables effective optimization of ( 1 ) . We also make another approximation when using automatic differentiation . For the leapfrog updates , we stop the backpropagation of the gradient through xk in∇xk log p∗ ( xk ) to prevent the calculation of secondorder gradients . We find this has little impact on the convergence of the algorithm and can lead to 5× speedups in execution time .
This paper proposes a variational inference based framework to tune some of the hyper-parameters of HMC algorithms automatically. The authors drop the entropy term from regular ELBO formulation, which facilitates a gradient-based approach. However, dropping this term requires extra care for which authors offer an automated-method. Finally, the authors demonstrate empirical validation on several problems.
SP:8a2a34d242071dfbb207d394fec3c87517f19cc2
Gradient-based tuning of Hamiltonian Monte Carlo hyperparameters
1 INTRODUCTION . Hamiltonian Monte Carlo ( HMC ) is a popular sampling based method for performing accurate inference on complex distributions that we may only know up to a normalization constant ( Neal , 2011 ) . Unfortunately , HMC can be slow to run in practice as we need to allow time for the simulation to ‘ burn-in ’ and also to sufficiently explore the full extent of the target distribution . Tuning the HMC hyperparameters can help alleviate these issues but this requires domain expertise and must be repeated for every problem HMC is applied to . There have been many attempts to provide an automatic method of tuning the hyperparameters . Some methods use a proxy for the mixing speed of the chain , i.e . the speed at which the Markov chain marginal distribution approaches the target . For example , Levy et al . ( 2018 ) use a variation on the expected squared jumped distance to tune parameters in order to encourage the chain to make large moves within the sample space . Other methods draw upon ideas from Variational Inference ( VI ) . VI ( Jordan et al. , 1999 ) is an optimization based method that is often contrasted to Markov Chain Monte Carlo methods such as HMC . In VI , we approximate the target using a parametric distribution , reducing the approximation bias through optimizing the distribution parameters . The optimization procedure maximises a lower bound on the normalization constant of the target which is equivalent to minimising the KL-divergence between the approximation and the target . To apply this idea to HMC , Salimans et al . ( 2015 ) ; Wolf et al . ( 2016 ) consider the marginal distribution of the final state in a finite length HMC chain as an implicit variational distribution with the intention of tuning the HMC parameters using the VI approach . However , the implicit distribution makes the usual variational lower bound intractable . To restore tractability , they make the bound looser by introducing an auxiliary inference distribution approximating the reverse dynamics of the chain . The looseness of the bound depends on the KL-divergence between the auxiliary inference distribution and the true reverse dynamics . As the chain length increases , the dimensionality of these distributions increases , tending to increase the looseness of the bound . This causes issues during optimization because the increasing magnitude of this extra KL-divergence term encourages the model to fit to the imperfect auxiliary inference distribution as opposed to the target as desired . Indeed , Salimans et al . ( 2015 ) only consider very short HMC chains using their method . In this work , we further investigate the combined VI-HMC approach as this has the potential to provide a direct measure of the chain ’ s convergence without the need to rely on proxies for per- formance . When applied to an implicit HMC marginal distribution , the variational objective can be broken down into the tractable expectation of the log target density and the intractable entropy of the variational approximation . This entropy term prevents a fully flexible variational distribution from collapsing to a point mass maximizing the log target density . Since HMC , by construction , can not collapse to such a point mass , we argue that the entropy term can be dropped provided the initial distribution of the chain has enough coverage of the target . We evaluate our proposed method on a variety of tasks . We first consider a range of synthetic 2D distributions before moving on to higher dimensional problems . In particular , we use our method to train deep latent variable models on the MNIST and FashionMNIST datasets . We also evaluate on a popular statistical mechanics benchmark : sampling molecular configurations from the Boltzmann distribution of a 22 atom molecule , Alanine Dipeptide . Our results show that this method is competitive with or can improve upon alternative tuning methods for HMC on all problems we consider . 2 BACKGROUND . 2.1 HAMILTONIAN MONTE CARLO . HMC is a Markov Chain Monte Carlo method ( Neal , 1993 ) which aims to draw samples from the n-dimensional target distribution p ( x ) = 1Z p ∗ ( x ) where Z is the ( usually unknown ) normalization constant . It introduces an auxiliary variable ν ∈ Rn , referred to as the momentum , which is distributed according to N ( ν ; 0 , diag ( m ) ) , with the resulting method sampling on the extended space ζ = ( x , ν ) . HMC progresses by first sampling an initial state from some initial distribution and then iteratively proposing new states and accepting/rejecting them according to an acceptance probability . To propose a new state , first , a new value for the momentum is drawn from N ( ν ; 0 , diag ( m ) ) , then , we simulate Hamiltonian Dynamics with Hamiltonian , H ( x , ν ) = −log p∗ ( x ) + 12ν T diag ( m ) −1ν arriving at new state ( x′ , ν′ ) . This new state is ac- cepted with probability min [ 1 , exp ( −H ( x′ , ν′ ) +H ( x , ν ) ) ] otherwise we reject the proposed state and remain at the starting state . The Hamiltonian Dynamics are simulated using a numerical integrator , the leapfrog integrator ( Hairer et al. , 2003 ) being a popular choice . To propose the new state , L leapfrog updates are taken , each update consisting of the following equations : νk+ 12 = νk + 1 2 ∇xk log p∗ ( xk ) xk+1 = xk + νk+ 12 1 m νk+1 = νk+ 12 + 1 2 ∇xk+1 log p∗ ( xk+1 ) where 1m = ( 1 m1 , . . . , 1mn ) and denotes element wise multiplication . The step size , , and the mass , m , are hyperparameters that need to be tuned for each problem the method is applied to . We note that in the usual definition of HMC , a single scalar valued is used . Our use of a vector implies a different step size in each dimension which , with proper tuning , can improve performance by taking into account the different scales in each dimension . The use of does mean the procedure can no longer be interpreted as simulating Hamiltonian Dynamics , however , it can still be used as a valid HMC proposal ( Neal , 2011 ) . We do not consider the problem of choosing L in this work . 2.2 VARIATIONAL INFERENCE . VI approximates the target p ( x ) with a tractable distribution qφ ( x ) parameterized by φ . We choose φ as to minimise the Kullback-Leibler divergence with the target , DKL ( qφ ( x ) ||p ( x ) ) . As we only know p ( x ) up to a normalization constant , we can equivalently choose φ as to maximise the tractable Evidence Lower-Bound ( ELBO ) : ELBO = logZ −DKL ( qφ ( x ) ||p ( x ) ) = Eqφ ( x ) [ log p∗ ( x ) − log qφ ( x ) ] . 3 HYPERPARAMETER TUNING THROUGH THE EXPECTED LOG-TARGET . VI tunes the parameters of an approximate distribution to make it closer to the target . We would like to use this idea to tune the hyperparameters of HMC . We can run multiple parallel HMC chains and treat the final states as independent samples from an implicit variational distribution . If each chain starts at initial distribution q ( 0 ) ( x ) and then runs T accept/reject cycles , we can denote this implicit distribution as q ( T ) φ ( x ) , where φ now represents the HMC hyperparameters . Ideally , we would then choose φ as to maximise the ELBO : φ∗ = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) − log q ( T ) φ ( x ) ] = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) ] +H ( q ( T ) φ ( x ) ) . Whilst the first term in this expression can be estimated directly via Monte Carlo , the entropy term , H ( q ( T ) φ ( x ) ) , is intractable . To get around this , we should consider the purpose of the two terms during optimization . Maximizing the first term encourages q ( T ) φ ( x ) to produce samples that are in the high probability regions of the target , i.e. , ensuring that q ( T ) φ ( x ) is high where log p ∗ ( x ) is high . The entropy term acts as a regularizer preventing q ( T ) φ ( x ) from simply collapsing to a delta function at the mode of p ( x ) . The key observation of our method is that HMC already fulfills this regularization role because the implicit distribution it defines is not fully flexible . If q ( T ) φ ( x ) were to collapse to a delta function , this would require the hyperparameters to be such that the HMC scheme guides samples to the same point in space no matter their starting position , as sampled from q ( 0 ) ( x ) , which is unreasonable for practical problems . Therefore , we propose tuning φ simply by maximizing the expected log target density under the final state of the chain : φ∗ = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) ] . ( 1 ) Although HMC does have a regularization effect , removing the entropy term does have some implications that we need to consider . Namely , if the initial distribution , q ( 0 ) ( x ) , is concentrated in a very high probability region of the target , p ( x ) , then optimizing objective ( 1 ) will not encourage HMC to explore the full target . Conversely , it would encourage the chains to remain in this region of high probability , close to their initial sampling point , which is undesirable behaviour . The key to avoiding this problem is to choose an initial distribution that has a sufficiently wide coverage of the target , we will discuss methods for doing this in Section 4 . We perform the optimization in ( 1 ) using stochastic gradient ascent with gradients being obtained using the standard reparameterization trick ( Rezende et al. , 2014 ; Kingma & Welling , 2014 ) . Samples from q ( T ) φ ( x ) can be obtained through a deterministic function of primitive random variables : x0 ∼ q ( 0 ) ( x ) for the initial distribution , γ0 : T−1 , γt ∼ N ( 0 , I ) for the momentum variables and a0 : T−1 , at ∼ U [ 0 , 1 ] for the accept/reject decisions . We denote this function as fφ ( x0 , γ0 : T−1 , a0 : T−1 ) . For minibatches of size N , the gradient is then estimated by 1 N N∑ n=1 ∇φlog p∗ ( fφ ( x ( n ) 0 , γ ( n ) 0 : T−1 , a ( n ) 0 : T−1 ) ) . ( 2 ) Each gradient value can be calculated using automatic differentiation tools . For ( 2 ) to be strictly unbiased , fφ must obey certain smoothness constraints to allow differentiation under the integral sign ( Border , 2016 ) . This does not hold in this case due to the accept/reject step . Other works have found success in making this approximation ( Levy et al. , 2018 ; Thin et al. , 2020 ) and as Thin et al . ( 2020 ) point out , this same issue is encountered when using the very popular ReLU activation function . Our empirical results confirm that ( 2 ) enables effective optimization of ( 1 ) . We also make another approximation when using automatic differentiation . For the leapfrog updates , we stop the backpropagation of the gradient through xk in∇xk log p∗ ( xk ) to prevent the calculation of secondorder gradients . We find this has little impact on the convergence of the algorithm and can lead to 5× speedups in execution time .
The paper introduces a gradient-based approach for tuning the step-size and the diagonal mass matrix of HMC together with the parameters of an initial distribution for the Markov chain. They suggest different objectives amenable for SGD: maximize the expected target log-density of the final state of the chain, but also an objective to ensure a somewhat ‘wide’ initial distribution. The approach is illustrated on 2-d toy models, deep latent Gaussian models on (Fashion) MNIST and molecular configurations.
SP:8a2a34d242071dfbb207d394fec3c87517f19cc2
Gradient-based tuning of Hamiltonian Monte Carlo hyperparameters
1 INTRODUCTION . Hamiltonian Monte Carlo ( HMC ) is a popular sampling based method for performing accurate inference on complex distributions that we may only know up to a normalization constant ( Neal , 2011 ) . Unfortunately , HMC can be slow to run in practice as we need to allow time for the simulation to ‘ burn-in ’ and also to sufficiently explore the full extent of the target distribution . Tuning the HMC hyperparameters can help alleviate these issues but this requires domain expertise and must be repeated for every problem HMC is applied to . There have been many attempts to provide an automatic method of tuning the hyperparameters . Some methods use a proxy for the mixing speed of the chain , i.e . the speed at which the Markov chain marginal distribution approaches the target . For example , Levy et al . ( 2018 ) use a variation on the expected squared jumped distance to tune parameters in order to encourage the chain to make large moves within the sample space . Other methods draw upon ideas from Variational Inference ( VI ) . VI ( Jordan et al. , 1999 ) is an optimization based method that is often contrasted to Markov Chain Monte Carlo methods such as HMC . In VI , we approximate the target using a parametric distribution , reducing the approximation bias through optimizing the distribution parameters . The optimization procedure maximises a lower bound on the normalization constant of the target which is equivalent to minimising the KL-divergence between the approximation and the target . To apply this idea to HMC , Salimans et al . ( 2015 ) ; Wolf et al . ( 2016 ) consider the marginal distribution of the final state in a finite length HMC chain as an implicit variational distribution with the intention of tuning the HMC parameters using the VI approach . However , the implicit distribution makes the usual variational lower bound intractable . To restore tractability , they make the bound looser by introducing an auxiliary inference distribution approximating the reverse dynamics of the chain . The looseness of the bound depends on the KL-divergence between the auxiliary inference distribution and the true reverse dynamics . As the chain length increases , the dimensionality of these distributions increases , tending to increase the looseness of the bound . This causes issues during optimization because the increasing magnitude of this extra KL-divergence term encourages the model to fit to the imperfect auxiliary inference distribution as opposed to the target as desired . Indeed , Salimans et al . ( 2015 ) only consider very short HMC chains using their method . In this work , we further investigate the combined VI-HMC approach as this has the potential to provide a direct measure of the chain ’ s convergence without the need to rely on proxies for per- formance . When applied to an implicit HMC marginal distribution , the variational objective can be broken down into the tractable expectation of the log target density and the intractable entropy of the variational approximation . This entropy term prevents a fully flexible variational distribution from collapsing to a point mass maximizing the log target density . Since HMC , by construction , can not collapse to such a point mass , we argue that the entropy term can be dropped provided the initial distribution of the chain has enough coverage of the target . We evaluate our proposed method on a variety of tasks . We first consider a range of synthetic 2D distributions before moving on to higher dimensional problems . In particular , we use our method to train deep latent variable models on the MNIST and FashionMNIST datasets . We also evaluate on a popular statistical mechanics benchmark : sampling molecular configurations from the Boltzmann distribution of a 22 atom molecule , Alanine Dipeptide . Our results show that this method is competitive with or can improve upon alternative tuning methods for HMC on all problems we consider . 2 BACKGROUND . 2.1 HAMILTONIAN MONTE CARLO . HMC is a Markov Chain Monte Carlo method ( Neal , 1993 ) which aims to draw samples from the n-dimensional target distribution p ( x ) = 1Z p ∗ ( x ) where Z is the ( usually unknown ) normalization constant . It introduces an auxiliary variable ν ∈ Rn , referred to as the momentum , which is distributed according to N ( ν ; 0 , diag ( m ) ) , with the resulting method sampling on the extended space ζ = ( x , ν ) . HMC progresses by first sampling an initial state from some initial distribution and then iteratively proposing new states and accepting/rejecting them according to an acceptance probability . To propose a new state , first , a new value for the momentum is drawn from N ( ν ; 0 , diag ( m ) ) , then , we simulate Hamiltonian Dynamics with Hamiltonian , H ( x , ν ) = −log p∗ ( x ) + 12ν T diag ( m ) −1ν arriving at new state ( x′ , ν′ ) . This new state is ac- cepted with probability min [ 1 , exp ( −H ( x′ , ν′ ) +H ( x , ν ) ) ] otherwise we reject the proposed state and remain at the starting state . The Hamiltonian Dynamics are simulated using a numerical integrator , the leapfrog integrator ( Hairer et al. , 2003 ) being a popular choice . To propose the new state , L leapfrog updates are taken , each update consisting of the following equations : νk+ 12 = νk + 1 2 ∇xk log p∗ ( xk ) xk+1 = xk + νk+ 12 1 m νk+1 = νk+ 12 + 1 2 ∇xk+1 log p∗ ( xk+1 ) where 1m = ( 1 m1 , . . . , 1mn ) and denotes element wise multiplication . The step size , , and the mass , m , are hyperparameters that need to be tuned for each problem the method is applied to . We note that in the usual definition of HMC , a single scalar valued is used . Our use of a vector implies a different step size in each dimension which , with proper tuning , can improve performance by taking into account the different scales in each dimension . The use of does mean the procedure can no longer be interpreted as simulating Hamiltonian Dynamics , however , it can still be used as a valid HMC proposal ( Neal , 2011 ) . We do not consider the problem of choosing L in this work . 2.2 VARIATIONAL INFERENCE . VI approximates the target p ( x ) with a tractable distribution qφ ( x ) parameterized by φ . We choose φ as to minimise the Kullback-Leibler divergence with the target , DKL ( qφ ( x ) ||p ( x ) ) . As we only know p ( x ) up to a normalization constant , we can equivalently choose φ as to maximise the tractable Evidence Lower-Bound ( ELBO ) : ELBO = logZ −DKL ( qφ ( x ) ||p ( x ) ) = Eqφ ( x ) [ log p∗ ( x ) − log qφ ( x ) ] . 3 HYPERPARAMETER TUNING THROUGH THE EXPECTED LOG-TARGET . VI tunes the parameters of an approximate distribution to make it closer to the target . We would like to use this idea to tune the hyperparameters of HMC . We can run multiple parallel HMC chains and treat the final states as independent samples from an implicit variational distribution . If each chain starts at initial distribution q ( 0 ) ( x ) and then runs T accept/reject cycles , we can denote this implicit distribution as q ( T ) φ ( x ) , where φ now represents the HMC hyperparameters . Ideally , we would then choose φ as to maximise the ELBO : φ∗ = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) − log q ( T ) φ ( x ) ] = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) ] +H ( q ( T ) φ ( x ) ) . Whilst the first term in this expression can be estimated directly via Monte Carlo , the entropy term , H ( q ( T ) φ ( x ) ) , is intractable . To get around this , we should consider the purpose of the two terms during optimization . Maximizing the first term encourages q ( T ) φ ( x ) to produce samples that are in the high probability regions of the target , i.e. , ensuring that q ( T ) φ ( x ) is high where log p ∗ ( x ) is high . The entropy term acts as a regularizer preventing q ( T ) φ ( x ) from simply collapsing to a delta function at the mode of p ( x ) . The key observation of our method is that HMC already fulfills this regularization role because the implicit distribution it defines is not fully flexible . If q ( T ) φ ( x ) were to collapse to a delta function , this would require the hyperparameters to be such that the HMC scheme guides samples to the same point in space no matter their starting position , as sampled from q ( 0 ) ( x ) , which is unreasonable for practical problems . Therefore , we propose tuning φ simply by maximizing the expected log target density under the final state of the chain : φ∗ = argmax φ E q ( T ) φ ( x ) [ log p∗ ( x ) ] . ( 1 ) Although HMC does have a regularization effect , removing the entropy term does have some implications that we need to consider . Namely , if the initial distribution , q ( 0 ) ( x ) , is concentrated in a very high probability region of the target , p ( x ) , then optimizing objective ( 1 ) will not encourage HMC to explore the full target . Conversely , it would encourage the chains to remain in this region of high probability , close to their initial sampling point , which is undesirable behaviour . The key to avoiding this problem is to choose an initial distribution that has a sufficiently wide coverage of the target , we will discuss methods for doing this in Section 4 . We perform the optimization in ( 1 ) using stochastic gradient ascent with gradients being obtained using the standard reparameterization trick ( Rezende et al. , 2014 ; Kingma & Welling , 2014 ) . Samples from q ( T ) φ ( x ) can be obtained through a deterministic function of primitive random variables : x0 ∼ q ( 0 ) ( x ) for the initial distribution , γ0 : T−1 , γt ∼ N ( 0 , I ) for the momentum variables and a0 : T−1 , at ∼ U [ 0 , 1 ] for the accept/reject decisions . We denote this function as fφ ( x0 , γ0 : T−1 , a0 : T−1 ) . For minibatches of size N , the gradient is then estimated by 1 N N∑ n=1 ∇φlog p∗ ( fφ ( x ( n ) 0 , γ ( n ) 0 : T−1 , a ( n ) 0 : T−1 ) ) . ( 2 ) Each gradient value can be calculated using automatic differentiation tools . For ( 2 ) to be strictly unbiased , fφ must obey certain smoothness constraints to allow differentiation under the integral sign ( Border , 2016 ) . This does not hold in this case due to the accept/reject step . Other works have found success in making this approximation ( Levy et al. , 2018 ; Thin et al. , 2020 ) and as Thin et al . ( 2020 ) point out , this same issue is encountered when using the very popular ReLU activation function . Our empirical results confirm that ( 2 ) enables effective optimization of ( 1 ) . We also make another approximation when using automatic differentiation . For the leapfrog updates , we stop the backpropagation of the gradient through xk in∇xk log p∗ ( xk ) to prevent the calculation of secondorder gradients . We find this has little impact on the convergence of the algorithm and can lead to 5× speedups in execution time .
The paper proposes a method to optimize the parameters of the Hybrid Monte Carlo (HMC) algorithm (the step size and the diagonal of momentum's covariance matrix). In order to do that, the authors consider the distribution of samples q_T() obtained after T iterations of the algorithm (T accept/reject steps) starting from some distribution q_0(). Then, a reasonable objective for the optimization would be the KL-divergence between q_T() and the target density p(). However, the evaluation of the KL-divergence includes the entropy of q_T(), whose density is intractable due to numerous accept/reject steps. The proposed solution to this difficulty is to ignore the entropy term and maximize the log density of the target on samples from q_T(). To avoid the degenerate solution (due to ignorance of the entropy), the authors propose to choose q_0() carefully, e.g., to learn q_0() as a normalizing flow approximating the target p() via minimization of mass-covering alpha-divergence. The latter involves the usage of samples from the target distribution.
SP:8a2a34d242071dfbb207d394fec3c87517f19cc2
Knowledge distillation via softmax regression representation learning
1 INTRODUCTION . Recently , there has been a great amount of research effort to make Convolutional Neural Networks ( CNNs ) lightweight so that they can be deployed in devices with limited resources . To this end , several approaches for model compression have been proposed , including network pruning ( Han et al. , 2016 ; Lebedev & Lempitsky , 2016 ) , network quantization ( Rastegari et al. , 2016 ; Wu et al. , 2016 ) , knowledge transfer/distillation ( Hinton et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , and neural architecture search ( Zoph & Le , 2017 ; Liu et al. , 2018 ) . Knowledge distillation ( Buciluǎ et al. , 2006 ; Hinton et al. , 2015 ) aims to transfer knowledge from one network ( the so-called “ teacher ” ) to another ( the so-called “ student ” ) . Typically , the teacher is a high-capacity model capable of achieving high accuracy , while the student is a compact model with much fewer parameters , thus also requiring much less computation . The goal of knowledge distillation is to use the teacher to improve the training of the student and push its accuracy closer to that of the teacher . The rationale behind knowledge distillation can be explained from an optimization perspective : there is evidence that high capacity models ( i.e . the teacher ) can find good local minima due to over-parameterization ( Du & Lee , 2018 ; Soltanolkotabi et al. , 2018 ) . In knowledge distillation , such models are used to facilitate the optimization of lower capacity models ( i.e . the student ) during training . For example , in the seminal work of ( Hinton et al. , 2015 ) , the softmax outputs of the teacher provide extra supervisory signals of inter-class similarities which facilitate the training of the student . In other influential works , intermediate representations extracted from the teacher such as feature tensors ( Romero et al. , 2015 ) or attention maps ( Zagoruyko & Komodakis , 2017 ) have been used to define auxiliary loss functions used in the optimization of the student . Training a network whose output feature representation is rich and powerful has been shown crucial for achieving high accuracy for the subsequent classification task in recent works in both unsupervised and supervised learning , see for example ( Chen et al. , 2020 ; He et al. , 2020 ) and ( Kang et al. , 2020 ) . Hence , in this paper , we are advocating for representation learning-based knowledge distillation by optimizing the student ’ s penultimate layer output feature . If we are able to do this effectively , we expect ( and show experimentally ) to end up with a student network which can generalize better than one trained with logit matching as in the KD paper of ( Hinton et al. , 2015 ) . Main contributions : To accomplish the aforementioned goal we propose two loss functions : The first loss function , akin to ( Romero et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , is based on direct feature matching but focuses on optimizing the student ’ s penultimate layer feature only . Because direct feature matching might be difficult due to the lower representation capacity of the student and , more importantly , is detached from the classification task at hand , we also propose a second loss function : we propose to decouple representation learning and classification and utilize the teacher ’ s pre-trained classifier to train the student ’ s penultimate layer feature . In particular , for the same input image , we wish the teacher ’ s and student ’ s feature to produce the same output when passed through the teacher ’ s classifier , which is achieved with a simple L2 loss ( see Fig . 1 ) . This softmax regression projection is used to retain from the student ’ s feature the information that is relevant to classification , but since the projection matrix is pre-trained ( learned during the teacher ’ s training phase ) this does not compromise the representational power of the student ’ s feature . Main results : Our method has two advantages : ( 1 ) It is simple and straightforward to implement . ( 2 ) It consistently outperforms state-of-the-art methods over a large set of experimental settings including different ( a ) network architectures ( WideResNets , ResNets , MobileNets ) , ( b ) teacherstudent capacities , ( c ) datasets ( CIFAR-10/100 , ImageNet ) , and ( d ) domains ( real-to-binary ) . 2 RELATED WORK . Knowledge transfer : In the work of ( Hinton et al. , 2015 ) , knowledge is defined as the teacher ’ s outputs after the final softmax layer . The softmax outputs carry richer information than one-hot labels because they provide extra supervision signals in terms of the inter-class similarities learned by the teacher . In a similar fashion to ( Hinton et al. , 2015 ) , intermediate representations extracted from the teacher such as feature tensors ( Romero et al. , 2015 ) or attention maps ( Zagoruyko & Komodakis , 2017 ) have been used to define loss functions used to facilitate the optimization of the student . Trying to match the whole feature tensor , as in FitNets ( Romero et al. , 2015 ) , is hard and , in certain circumstances , such an approach may adversely affect the performance and convergence of the student . To relax the assumption of FitNet , Attention Transfer ( AT ) was proposed in ( Zagoruyko & Komodakis , 2017 ) where knowledge takes the form of attention maps which are summaries of the energies of the feature tensors over the channel dimension . An extension of ( Zagoruyko & Komodakis , 2017 ) using Maximum Mean Discrepancy of the network activations as a loss term for distillation was proposed in ( Huang & Wang , 2017 ) . Cho & Hariharan ( 2019 ) showed that very accurate networks are “ too good ” to be good teachers and proposed to mitigate this with early stopping of the teacher ’ s training . Recently , the work of ( Heo et al. , 2019a ) studied the location within the network at which feature distillation should be applied and proposed margin ReLU and a specifically designed distance function that transfers only the useful ( positive ) information from the teacher to the student . More recently , Li et al . ( Li et al. , 2020a ) proposed to supervise the blockwise architecture search by the architecture knowledge distilled from a teacher model . Another NAS based method was proposed in ( Guan et al. , 2020 ) , in which a student-to-teacher loss is used to find the aggregation weights that match the learning ability of the student . Passalis et al . ( 2020 ) claimed that traditional KD ignores information plasticity during the training process , and proposed to model the information flow through the various layers of the teacher . Feature relationship transfer : Another line of knowledge distillation methods focus on exploring transferring the relationship between features , rather than the actual features themselves . In ( Yim et al. , 2017 ) , feature correlations are captured by computing the Gram matrix of features across layers for both teacher and student and then applying an L2 loss on pairs of teacher-student Gram matrices . The limitation of this work is the high computational cost , which is addressed to some extent in ( Lee et al. , 2018 ) by compressing the feature maps by singular value decomposition . Park et al . ( 2019 ) proposed a relational knowledge distillation method which computes distance-wise and angle-wise relations of each embedded feature vector . This idea is further explored in ( Peng et al. , 2019 ) and ( Liu et al. , 2019 ) . In ( Peng et al. , 2019 ) , Taylor series expansion is proposed to better capture the correlation between multiple instances . In ( Liu et al. , 2019 ) , the instance feature and relationships are considered as vertexes and edges respectively in a graph and instance relationship graph is proposed to model the feature space transformation across layers . Inspired by the observation that semantically similar inputs should have similar activation patterns , ( Tung & Mori , 2019 ) proposed a similarity-preserving knowledge distillation method which guides the student to mimic the teacher with respect to generating similar or dissimilar activations . More recently , ( Jain et al. , 2020 ) proposed to matching the student output with the teacher ’ s by distilling the knowledge through a quantized visual words space . Li et al . ( 2020b ) proposed the local correlation exploration framework to represent the relationships of local regions in the feature space which contains more details and discriminative patterns . Finally , a similar connection between distillation and representation learning was very recently made in ( Tian et al. , 2020 ) which uses contrastive learning for knowledge distillation . We note that our loss is not related to the one used in ( Tian et al. , 2020 ) , is simpler , and as shown in Section 5 , outperforms it for all of our experiments , often by a significant margin . 3 METHOD . We denote by T and S the teacher and student networks respectively . We split these networks into two parts : ( i ) A convolutional feature extractor fNet , Net = { T , S } , the output of which at the i-th layer is a feature tensor F iNet ∈ RC i Net×H i×W i , where CiNet is the output feature dimensionality , and Hi , W i the output spatial dimensions . We also denote by hNet = ∑HL h=1 ∑WL w=1 F L Net ∈ RC L Net the last layer feature representation learned by fNet . ( ii ) A projection matrix WNet ∈ RC L Net×K which projects the feature representation hNet into K class logits ziNet , i = 1 , . . . , K , followed by the softmax function s ( ziNet ) = exp ( ziNet/τ ) ∑ j exp ( z j Net/τ ) with temperature τ ( τ = 1 for Cross Entropy loss ) which put together form a softmax regression classifier into K classes . Knowledge Distillation ( KD ) ( Hinton et al. , 2015 ) trains the student with the following loss : LKD = − K∑ k=1 s ( zkT ) log s ( z k S ) , ( 1 ) so that the discrepancy between the teacher ’ s and student ’ s classifiers is directly minimized . FitNets ( Romero et al. , 2015 ) match intermediate feature representations . For the i-th layer , the following loss is defined : LFit = ∥∥F iT − r ( F iS ) ∥∥2 , ( 2 ) where r ( . ) is a function for matching the feature tensor dimensions . In our work , we propose to minimize the discrepancy between the representations hT and hS . To accomplish this goal , we propose to use two losses . The first one is an L2 feature matching loss : LFM = ‖hT − hS‖2 , ( 3 ) where for notational simplicity we dropped the dependency on r ( . ) . Hence , LFM loss is a simplified FitNet loss which focuses only on the final representation learned . The intuition for this is that this feature is directly connected to the classifier and hence imposing the student ’ s feature to be similar to that of the teacher could have more impact on classification accuracy . Moreover , it might be questionable why one should optimize for other intermediate representations as in ( Romero et al. , 2015 ) especially when the student is a network of lower representational capacity . In Section 4 : Where should the losses be applied ? , we confirm that LFM alone has a positive impact but feature matching in other layers is not helpful . We found LFM to be effective but only to limited extent . One disadvantage of LFM and , in general , of all feature matching losses e.g . ( Romero et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , is that it treats each channel dimension in the feature space independently , and ignores the inter-channel dependencies of the feature representations hS and hT for the final classification . This is in contrast to the original logit matching loss proposed by Hinton et al . in ( Hinton et al. , 2015 ) which directly targets classification accuracy . To alleviate the aforementioned problem , in this work , we propose a second loss for optimizing hS which is directly linked with classification accuracy . To this end , we will use the teacher ’ s pre-trained Softmax Regression ( SR ) classifier . Let us denote by p the output of the teacher network when fed with some input image x . Let us also feed the same image through the student network to obtain feature hS ( x ) . Finally let us pass hS ( x ) through the teacher ’ s SR classifier to obtain output q . See also Fig . 1 . Our loss is defined as : LSR = −p log q . ( 4 ) At this point , we make the following two observations : ( 1 ) If p = q ( and since the teacher ’ s classifier is frozen ) , then this implies that hS ( x ) = hT ( x ) which shows that indeed Eq . ( 4 ) optimizes the student ’ s feature representation hS ( hT is also frozen ) . ( 2 ) The loss of Eq . ( 4 ) can be written as : LSR = −s ( W ′ThT ) log s ( W ′ThS ) . ( 5 ) Now let us now write KD loss in a similar way : LKD = −s ( W ′ThT ) log s ( W ′shS ) . ( 6 ) By comparing Eq . ( 5 ) with Eq . ( 6 ) , we see that the only difference in our method is that the frozen , pre-trained teacher ’ s classifier is used for both teacher and the student . On the contrary , in KD , WS is also optimized . This gives more degrees of freedom to the optimization algorithm , in particular , to adjust the weights of both the student ’ s feature extractor fS and the student ’ s classifier WS in order to minimize the loss . This has an impact on the learning of the student ’ s feature representation hS which , in turn , hinders the generalization capability of the student on the test set . We confirm this hypothesis with the experiment of Section 4 : Transferability of representations . Finally , we note that we found that , in practice , an L2 loss between the logits : LKD = ‖W ′ThT −W ′ThS‖ 2 = ‖hT − hS‖2WT , ( 7 ) works slightly better than the cross-entropy loss . The comparison between different types of losses for LSR is given in the appendix . Overall , in our method , we train the student network using three losses : L = LCE + αLFM + βLSR , ( 8 ) where α and β are the weights used to scale the losses . The teacher network is pretrained and fixed during training the student . LCE is the standard loss based on ground truth labels for the task in hand ( e.g . cross-entropy loss for image classification ) . Note that this results in a very simple algorithm for training the student , summarized in Algorithm 1 . Algorithm 1 Knowledge distillation via Softmax Regression Representation Learning Input : Teacher network T , Student network S , input image x , ground truth label y , weights α , β . 1 . Input x to S to obtain feature hS and class prediction ŷ . Calculate cross entropy loss LCE = H ( ŷ , y ) ; 2 . Input x to T to obtain feature hT . Calculate distillation losses from Eqs . ( 3 ) and ( 7 ) ; 3 . Update S by optimizing Eq . ( 8 ) Output : the updated S .
This paper proposes a new formulation of knowledge distillation (KD) for model compression. Different from the classic formulation that matches the logits between student and teacher models, this paper suggests to match the output features of the penultimate layers between student and teacher models, based on L2 distance. Two complementary variants are introduced, with one directly minimizing the distance of the original feature vectors and with the other minimizing the distance of the feature vectors projected on the teacher classifiers. The approach is evaluated in a variety of scenarios, such as different network architectures, teacher-student capacities, datasets, and domains, and compared with state-of-the-art results.
SP:4ad6e101af93b83ea1704de6137d2ddd52f6f5ae
Knowledge distillation via softmax regression representation learning
1 INTRODUCTION . Recently , there has been a great amount of research effort to make Convolutional Neural Networks ( CNNs ) lightweight so that they can be deployed in devices with limited resources . To this end , several approaches for model compression have been proposed , including network pruning ( Han et al. , 2016 ; Lebedev & Lempitsky , 2016 ) , network quantization ( Rastegari et al. , 2016 ; Wu et al. , 2016 ) , knowledge transfer/distillation ( Hinton et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , and neural architecture search ( Zoph & Le , 2017 ; Liu et al. , 2018 ) . Knowledge distillation ( Buciluǎ et al. , 2006 ; Hinton et al. , 2015 ) aims to transfer knowledge from one network ( the so-called “ teacher ” ) to another ( the so-called “ student ” ) . Typically , the teacher is a high-capacity model capable of achieving high accuracy , while the student is a compact model with much fewer parameters , thus also requiring much less computation . The goal of knowledge distillation is to use the teacher to improve the training of the student and push its accuracy closer to that of the teacher . The rationale behind knowledge distillation can be explained from an optimization perspective : there is evidence that high capacity models ( i.e . the teacher ) can find good local minima due to over-parameterization ( Du & Lee , 2018 ; Soltanolkotabi et al. , 2018 ) . In knowledge distillation , such models are used to facilitate the optimization of lower capacity models ( i.e . the student ) during training . For example , in the seminal work of ( Hinton et al. , 2015 ) , the softmax outputs of the teacher provide extra supervisory signals of inter-class similarities which facilitate the training of the student . In other influential works , intermediate representations extracted from the teacher such as feature tensors ( Romero et al. , 2015 ) or attention maps ( Zagoruyko & Komodakis , 2017 ) have been used to define auxiliary loss functions used in the optimization of the student . Training a network whose output feature representation is rich and powerful has been shown crucial for achieving high accuracy for the subsequent classification task in recent works in both unsupervised and supervised learning , see for example ( Chen et al. , 2020 ; He et al. , 2020 ) and ( Kang et al. , 2020 ) . Hence , in this paper , we are advocating for representation learning-based knowledge distillation by optimizing the student ’ s penultimate layer output feature . If we are able to do this effectively , we expect ( and show experimentally ) to end up with a student network which can generalize better than one trained with logit matching as in the KD paper of ( Hinton et al. , 2015 ) . Main contributions : To accomplish the aforementioned goal we propose two loss functions : The first loss function , akin to ( Romero et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , is based on direct feature matching but focuses on optimizing the student ’ s penultimate layer feature only . Because direct feature matching might be difficult due to the lower representation capacity of the student and , more importantly , is detached from the classification task at hand , we also propose a second loss function : we propose to decouple representation learning and classification and utilize the teacher ’ s pre-trained classifier to train the student ’ s penultimate layer feature . In particular , for the same input image , we wish the teacher ’ s and student ’ s feature to produce the same output when passed through the teacher ’ s classifier , which is achieved with a simple L2 loss ( see Fig . 1 ) . This softmax regression projection is used to retain from the student ’ s feature the information that is relevant to classification , but since the projection matrix is pre-trained ( learned during the teacher ’ s training phase ) this does not compromise the representational power of the student ’ s feature . Main results : Our method has two advantages : ( 1 ) It is simple and straightforward to implement . ( 2 ) It consistently outperforms state-of-the-art methods over a large set of experimental settings including different ( a ) network architectures ( WideResNets , ResNets , MobileNets ) , ( b ) teacherstudent capacities , ( c ) datasets ( CIFAR-10/100 , ImageNet ) , and ( d ) domains ( real-to-binary ) . 2 RELATED WORK . Knowledge transfer : In the work of ( Hinton et al. , 2015 ) , knowledge is defined as the teacher ’ s outputs after the final softmax layer . The softmax outputs carry richer information than one-hot labels because they provide extra supervision signals in terms of the inter-class similarities learned by the teacher . In a similar fashion to ( Hinton et al. , 2015 ) , intermediate representations extracted from the teacher such as feature tensors ( Romero et al. , 2015 ) or attention maps ( Zagoruyko & Komodakis , 2017 ) have been used to define loss functions used to facilitate the optimization of the student . Trying to match the whole feature tensor , as in FitNets ( Romero et al. , 2015 ) , is hard and , in certain circumstances , such an approach may adversely affect the performance and convergence of the student . To relax the assumption of FitNet , Attention Transfer ( AT ) was proposed in ( Zagoruyko & Komodakis , 2017 ) where knowledge takes the form of attention maps which are summaries of the energies of the feature tensors over the channel dimension . An extension of ( Zagoruyko & Komodakis , 2017 ) using Maximum Mean Discrepancy of the network activations as a loss term for distillation was proposed in ( Huang & Wang , 2017 ) . Cho & Hariharan ( 2019 ) showed that very accurate networks are “ too good ” to be good teachers and proposed to mitigate this with early stopping of the teacher ’ s training . Recently , the work of ( Heo et al. , 2019a ) studied the location within the network at which feature distillation should be applied and proposed margin ReLU and a specifically designed distance function that transfers only the useful ( positive ) information from the teacher to the student . More recently , Li et al . ( Li et al. , 2020a ) proposed to supervise the blockwise architecture search by the architecture knowledge distilled from a teacher model . Another NAS based method was proposed in ( Guan et al. , 2020 ) , in which a student-to-teacher loss is used to find the aggregation weights that match the learning ability of the student . Passalis et al . ( 2020 ) claimed that traditional KD ignores information plasticity during the training process , and proposed to model the information flow through the various layers of the teacher . Feature relationship transfer : Another line of knowledge distillation methods focus on exploring transferring the relationship between features , rather than the actual features themselves . In ( Yim et al. , 2017 ) , feature correlations are captured by computing the Gram matrix of features across layers for both teacher and student and then applying an L2 loss on pairs of teacher-student Gram matrices . The limitation of this work is the high computational cost , which is addressed to some extent in ( Lee et al. , 2018 ) by compressing the feature maps by singular value decomposition . Park et al . ( 2019 ) proposed a relational knowledge distillation method which computes distance-wise and angle-wise relations of each embedded feature vector . This idea is further explored in ( Peng et al. , 2019 ) and ( Liu et al. , 2019 ) . In ( Peng et al. , 2019 ) , Taylor series expansion is proposed to better capture the correlation between multiple instances . In ( Liu et al. , 2019 ) , the instance feature and relationships are considered as vertexes and edges respectively in a graph and instance relationship graph is proposed to model the feature space transformation across layers . Inspired by the observation that semantically similar inputs should have similar activation patterns , ( Tung & Mori , 2019 ) proposed a similarity-preserving knowledge distillation method which guides the student to mimic the teacher with respect to generating similar or dissimilar activations . More recently , ( Jain et al. , 2020 ) proposed to matching the student output with the teacher ’ s by distilling the knowledge through a quantized visual words space . Li et al . ( 2020b ) proposed the local correlation exploration framework to represent the relationships of local regions in the feature space which contains more details and discriminative patterns . Finally , a similar connection between distillation and representation learning was very recently made in ( Tian et al. , 2020 ) which uses contrastive learning for knowledge distillation . We note that our loss is not related to the one used in ( Tian et al. , 2020 ) , is simpler , and as shown in Section 5 , outperforms it for all of our experiments , often by a significant margin . 3 METHOD . We denote by T and S the teacher and student networks respectively . We split these networks into two parts : ( i ) A convolutional feature extractor fNet , Net = { T , S } , the output of which at the i-th layer is a feature tensor F iNet ∈ RC i Net×H i×W i , where CiNet is the output feature dimensionality , and Hi , W i the output spatial dimensions . We also denote by hNet = ∑HL h=1 ∑WL w=1 F L Net ∈ RC L Net the last layer feature representation learned by fNet . ( ii ) A projection matrix WNet ∈ RC L Net×K which projects the feature representation hNet into K class logits ziNet , i = 1 , . . . , K , followed by the softmax function s ( ziNet ) = exp ( ziNet/τ ) ∑ j exp ( z j Net/τ ) with temperature τ ( τ = 1 for Cross Entropy loss ) which put together form a softmax regression classifier into K classes . Knowledge Distillation ( KD ) ( Hinton et al. , 2015 ) trains the student with the following loss : LKD = − K∑ k=1 s ( zkT ) log s ( z k S ) , ( 1 ) so that the discrepancy between the teacher ’ s and student ’ s classifiers is directly minimized . FitNets ( Romero et al. , 2015 ) match intermediate feature representations . For the i-th layer , the following loss is defined : LFit = ∥∥F iT − r ( F iS ) ∥∥2 , ( 2 ) where r ( . ) is a function for matching the feature tensor dimensions . In our work , we propose to minimize the discrepancy between the representations hT and hS . To accomplish this goal , we propose to use two losses . The first one is an L2 feature matching loss : LFM = ‖hT − hS‖2 , ( 3 ) where for notational simplicity we dropped the dependency on r ( . ) . Hence , LFM loss is a simplified FitNet loss which focuses only on the final representation learned . The intuition for this is that this feature is directly connected to the classifier and hence imposing the student ’ s feature to be similar to that of the teacher could have more impact on classification accuracy . Moreover , it might be questionable why one should optimize for other intermediate representations as in ( Romero et al. , 2015 ) especially when the student is a network of lower representational capacity . In Section 4 : Where should the losses be applied ? , we confirm that LFM alone has a positive impact but feature matching in other layers is not helpful . We found LFM to be effective but only to limited extent . One disadvantage of LFM and , in general , of all feature matching losses e.g . ( Romero et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , is that it treats each channel dimension in the feature space independently , and ignores the inter-channel dependencies of the feature representations hS and hT for the final classification . This is in contrast to the original logit matching loss proposed by Hinton et al . in ( Hinton et al. , 2015 ) which directly targets classification accuracy . To alleviate the aforementioned problem , in this work , we propose a second loss for optimizing hS which is directly linked with classification accuracy . To this end , we will use the teacher ’ s pre-trained Softmax Regression ( SR ) classifier . Let us denote by p the output of the teacher network when fed with some input image x . Let us also feed the same image through the student network to obtain feature hS ( x ) . Finally let us pass hS ( x ) through the teacher ’ s SR classifier to obtain output q . See also Fig . 1 . Our loss is defined as : LSR = −p log q . ( 4 ) At this point , we make the following two observations : ( 1 ) If p = q ( and since the teacher ’ s classifier is frozen ) , then this implies that hS ( x ) = hT ( x ) which shows that indeed Eq . ( 4 ) optimizes the student ’ s feature representation hS ( hT is also frozen ) . ( 2 ) The loss of Eq . ( 4 ) can be written as : LSR = −s ( W ′ThT ) log s ( W ′ThS ) . ( 5 ) Now let us now write KD loss in a similar way : LKD = −s ( W ′ThT ) log s ( W ′shS ) . ( 6 ) By comparing Eq . ( 5 ) with Eq . ( 6 ) , we see that the only difference in our method is that the frozen , pre-trained teacher ’ s classifier is used for both teacher and the student . On the contrary , in KD , WS is also optimized . This gives more degrees of freedom to the optimization algorithm , in particular , to adjust the weights of both the student ’ s feature extractor fS and the student ’ s classifier WS in order to minimize the loss . This has an impact on the learning of the student ’ s feature representation hS which , in turn , hinders the generalization capability of the student on the test set . We confirm this hypothesis with the experiment of Section 4 : Transferability of representations . Finally , we note that we found that , in practice , an L2 loss between the logits : LKD = ‖W ′ThT −W ′ThS‖ 2 = ‖hT − hS‖2WT , ( 7 ) works slightly better than the cross-entropy loss . The comparison between different types of losses for LSR is given in the appendix . Overall , in our method , we train the student network using three losses : L = LCE + αLFM + βLSR , ( 8 ) where α and β are the weights used to scale the losses . The teacher network is pretrained and fixed during training the student . LCE is the standard loss based on ground truth labels for the task in hand ( e.g . cross-entropy loss for image classification ) . Note that this results in a very simple algorithm for training the student , summarized in Algorithm 1 . Algorithm 1 Knowledge distillation via Softmax Regression Representation Learning Input : Teacher network T , Student network S , input image x , ground truth label y , weights α , β . 1 . Input x to S to obtain feature hS and class prediction ŷ . Calculate cross entropy loss LCE = H ( ŷ , y ) ; 2 . Input x to T to obtain feature hT . Calculate distillation losses from Eqs . ( 3 ) and ( 7 ) ; 3 . Update S by optimizing Eq . ( 8 ) Output : the updated S .
This paper proposes a new knowledge distillation method by enhancing the student network's representation learning. The proposed framework is very simple: use the teacher's final fully-connected layer (or, 'projection matrix $W$' in the paper) to obtain both the teacher's and the student's logit output and optimize the student network by minimizing the gap between two logits. Experiments cover various network architectures on CIFAR and ImageNet datasets and show improvements over the other competitive knowledge distillation methods.
SP:4ad6e101af93b83ea1704de6137d2ddd52f6f5ae
Knowledge distillation via softmax regression representation learning
1 INTRODUCTION . Recently , there has been a great amount of research effort to make Convolutional Neural Networks ( CNNs ) lightweight so that they can be deployed in devices with limited resources . To this end , several approaches for model compression have been proposed , including network pruning ( Han et al. , 2016 ; Lebedev & Lempitsky , 2016 ) , network quantization ( Rastegari et al. , 2016 ; Wu et al. , 2016 ) , knowledge transfer/distillation ( Hinton et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , and neural architecture search ( Zoph & Le , 2017 ; Liu et al. , 2018 ) . Knowledge distillation ( Buciluǎ et al. , 2006 ; Hinton et al. , 2015 ) aims to transfer knowledge from one network ( the so-called “ teacher ” ) to another ( the so-called “ student ” ) . Typically , the teacher is a high-capacity model capable of achieving high accuracy , while the student is a compact model with much fewer parameters , thus also requiring much less computation . The goal of knowledge distillation is to use the teacher to improve the training of the student and push its accuracy closer to that of the teacher . The rationale behind knowledge distillation can be explained from an optimization perspective : there is evidence that high capacity models ( i.e . the teacher ) can find good local minima due to over-parameterization ( Du & Lee , 2018 ; Soltanolkotabi et al. , 2018 ) . In knowledge distillation , such models are used to facilitate the optimization of lower capacity models ( i.e . the student ) during training . For example , in the seminal work of ( Hinton et al. , 2015 ) , the softmax outputs of the teacher provide extra supervisory signals of inter-class similarities which facilitate the training of the student . In other influential works , intermediate representations extracted from the teacher such as feature tensors ( Romero et al. , 2015 ) or attention maps ( Zagoruyko & Komodakis , 2017 ) have been used to define auxiliary loss functions used in the optimization of the student . Training a network whose output feature representation is rich and powerful has been shown crucial for achieving high accuracy for the subsequent classification task in recent works in both unsupervised and supervised learning , see for example ( Chen et al. , 2020 ; He et al. , 2020 ) and ( Kang et al. , 2020 ) . Hence , in this paper , we are advocating for representation learning-based knowledge distillation by optimizing the student ’ s penultimate layer output feature . If we are able to do this effectively , we expect ( and show experimentally ) to end up with a student network which can generalize better than one trained with logit matching as in the KD paper of ( Hinton et al. , 2015 ) . Main contributions : To accomplish the aforementioned goal we propose two loss functions : The first loss function , akin to ( Romero et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , is based on direct feature matching but focuses on optimizing the student ’ s penultimate layer feature only . Because direct feature matching might be difficult due to the lower representation capacity of the student and , more importantly , is detached from the classification task at hand , we also propose a second loss function : we propose to decouple representation learning and classification and utilize the teacher ’ s pre-trained classifier to train the student ’ s penultimate layer feature . In particular , for the same input image , we wish the teacher ’ s and student ’ s feature to produce the same output when passed through the teacher ’ s classifier , which is achieved with a simple L2 loss ( see Fig . 1 ) . This softmax regression projection is used to retain from the student ’ s feature the information that is relevant to classification , but since the projection matrix is pre-trained ( learned during the teacher ’ s training phase ) this does not compromise the representational power of the student ’ s feature . Main results : Our method has two advantages : ( 1 ) It is simple and straightforward to implement . ( 2 ) It consistently outperforms state-of-the-art methods over a large set of experimental settings including different ( a ) network architectures ( WideResNets , ResNets , MobileNets ) , ( b ) teacherstudent capacities , ( c ) datasets ( CIFAR-10/100 , ImageNet ) , and ( d ) domains ( real-to-binary ) . 2 RELATED WORK . Knowledge transfer : In the work of ( Hinton et al. , 2015 ) , knowledge is defined as the teacher ’ s outputs after the final softmax layer . The softmax outputs carry richer information than one-hot labels because they provide extra supervision signals in terms of the inter-class similarities learned by the teacher . In a similar fashion to ( Hinton et al. , 2015 ) , intermediate representations extracted from the teacher such as feature tensors ( Romero et al. , 2015 ) or attention maps ( Zagoruyko & Komodakis , 2017 ) have been used to define loss functions used to facilitate the optimization of the student . Trying to match the whole feature tensor , as in FitNets ( Romero et al. , 2015 ) , is hard and , in certain circumstances , such an approach may adversely affect the performance and convergence of the student . To relax the assumption of FitNet , Attention Transfer ( AT ) was proposed in ( Zagoruyko & Komodakis , 2017 ) where knowledge takes the form of attention maps which are summaries of the energies of the feature tensors over the channel dimension . An extension of ( Zagoruyko & Komodakis , 2017 ) using Maximum Mean Discrepancy of the network activations as a loss term for distillation was proposed in ( Huang & Wang , 2017 ) . Cho & Hariharan ( 2019 ) showed that very accurate networks are “ too good ” to be good teachers and proposed to mitigate this with early stopping of the teacher ’ s training . Recently , the work of ( Heo et al. , 2019a ) studied the location within the network at which feature distillation should be applied and proposed margin ReLU and a specifically designed distance function that transfers only the useful ( positive ) information from the teacher to the student . More recently , Li et al . ( Li et al. , 2020a ) proposed to supervise the blockwise architecture search by the architecture knowledge distilled from a teacher model . Another NAS based method was proposed in ( Guan et al. , 2020 ) , in which a student-to-teacher loss is used to find the aggregation weights that match the learning ability of the student . Passalis et al . ( 2020 ) claimed that traditional KD ignores information plasticity during the training process , and proposed to model the information flow through the various layers of the teacher . Feature relationship transfer : Another line of knowledge distillation methods focus on exploring transferring the relationship between features , rather than the actual features themselves . In ( Yim et al. , 2017 ) , feature correlations are captured by computing the Gram matrix of features across layers for both teacher and student and then applying an L2 loss on pairs of teacher-student Gram matrices . The limitation of this work is the high computational cost , which is addressed to some extent in ( Lee et al. , 2018 ) by compressing the feature maps by singular value decomposition . Park et al . ( 2019 ) proposed a relational knowledge distillation method which computes distance-wise and angle-wise relations of each embedded feature vector . This idea is further explored in ( Peng et al. , 2019 ) and ( Liu et al. , 2019 ) . In ( Peng et al. , 2019 ) , Taylor series expansion is proposed to better capture the correlation between multiple instances . In ( Liu et al. , 2019 ) , the instance feature and relationships are considered as vertexes and edges respectively in a graph and instance relationship graph is proposed to model the feature space transformation across layers . Inspired by the observation that semantically similar inputs should have similar activation patterns , ( Tung & Mori , 2019 ) proposed a similarity-preserving knowledge distillation method which guides the student to mimic the teacher with respect to generating similar or dissimilar activations . More recently , ( Jain et al. , 2020 ) proposed to matching the student output with the teacher ’ s by distilling the knowledge through a quantized visual words space . Li et al . ( 2020b ) proposed the local correlation exploration framework to represent the relationships of local regions in the feature space which contains more details and discriminative patterns . Finally , a similar connection between distillation and representation learning was very recently made in ( Tian et al. , 2020 ) which uses contrastive learning for knowledge distillation . We note that our loss is not related to the one used in ( Tian et al. , 2020 ) , is simpler , and as shown in Section 5 , outperforms it for all of our experiments , often by a significant margin . 3 METHOD . We denote by T and S the teacher and student networks respectively . We split these networks into two parts : ( i ) A convolutional feature extractor fNet , Net = { T , S } , the output of which at the i-th layer is a feature tensor F iNet ∈ RC i Net×H i×W i , where CiNet is the output feature dimensionality , and Hi , W i the output spatial dimensions . We also denote by hNet = ∑HL h=1 ∑WL w=1 F L Net ∈ RC L Net the last layer feature representation learned by fNet . ( ii ) A projection matrix WNet ∈ RC L Net×K which projects the feature representation hNet into K class logits ziNet , i = 1 , . . . , K , followed by the softmax function s ( ziNet ) = exp ( ziNet/τ ) ∑ j exp ( z j Net/τ ) with temperature τ ( τ = 1 for Cross Entropy loss ) which put together form a softmax regression classifier into K classes . Knowledge Distillation ( KD ) ( Hinton et al. , 2015 ) trains the student with the following loss : LKD = − K∑ k=1 s ( zkT ) log s ( z k S ) , ( 1 ) so that the discrepancy between the teacher ’ s and student ’ s classifiers is directly minimized . FitNets ( Romero et al. , 2015 ) match intermediate feature representations . For the i-th layer , the following loss is defined : LFit = ∥∥F iT − r ( F iS ) ∥∥2 , ( 2 ) where r ( . ) is a function for matching the feature tensor dimensions . In our work , we propose to minimize the discrepancy between the representations hT and hS . To accomplish this goal , we propose to use two losses . The first one is an L2 feature matching loss : LFM = ‖hT − hS‖2 , ( 3 ) where for notational simplicity we dropped the dependency on r ( . ) . Hence , LFM loss is a simplified FitNet loss which focuses only on the final representation learned . The intuition for this is that this feature is directly connected to the classifier and hence imposing the student ’ s feature to be similar to that of the teacher could have more impact on classification accuracy . Moreover , it might be questionable why one should optimize for other intermediate representations as in ( Romero et al. , 2015 ) especially when the student is a network of lower representational capacity . In Section 4 : Where should the losses be applied ? , we confirm that LFM alone has a positive impact but feature matching in other layers is not helpful . We found LFM to be effective but only to limited extent . One disadvantage of LFM and , in general , of all feature matching losses e.g . ( Romero et al. , 2015 ; Zagoruyko & Komodakis , 2017 ) , is that it treats each channel dimension in the feature space independently , and ignores the inter-channel dependencies of the feature representations hS and hT for the final classification . This is in contrast to the original logit matching loss proposed by Hinton et al . in ( Hinton et al. , 2015 ) which directly targets classification accuracy . To alleviate the aforementioned problem , in this work , we propose a second loss for optimizing hS which is directly linked with classification accuracy . To this end , we will use the teacher ’ s pre-trained Softmax Regression ( SR ) classifier . Let us denote by p the output of the teacher network when fed with some input image x . Let us also feed the same image through the student network to obtain feature hS ( x ) . Finally let us pass hS ( x ) through the teacher ’ s SR classifier to obtain output q . See also Fig . 1 . Our loss is defined as : LSR = −p log q . ( 4 ) At this point , we make the following two observations : ( 1 ) If p = q ( and since the teacher ’ s classifier is frozen ) , then this implies that hS ( x ) = hT ( x ) which shows that indeed Eq . ( 4 ) optimizes the student ’ s feature representation hS ( hT is also frozen ) . ( 2 ) The loss of Eq . ( 4 ) can be written as : LSR = −s ( W ′ThT ) log s ( W ′ThS ) . ( 5 ) Now let us now write KD loss in a similar way : LKD = −s ( W ′ThT ) log s ( W ′shS ) . ( 6 ) By comparing Eq . ( 5 ) with Eq . ( 6 ) , we see that the only difference in our method is that the frozen , pre-trained teacher ’ s classifier is used for both teacher and the student . On the contrary , in KD , WS is also optimized . This gives more degrees of freedom to the optimization algorithm , in particular , to adjust the weights of both the student ’ s feature extractor fS and the student ’ s classifier WS in order to minimize the loss . This has an impact on the learning of the student ’ s feature representation hS which , in turn , hinders the generalization capability of the student on the test set . We confirm this hypothesis with the experiment of Section 4 : Transferability of representations . Finally , we note that we found that , in practice , an L2 loss between the logits : LKD = ‖W ′ThT −W ′ThS‖ 2 = ‖hT − hS‖2WT , ( 7 ) works slightly better than the cross-entropy loss . The comparison between different types of losses for LSR is given in the appendix . Overall , in our method , we train the student network using three losses : L = LCE + αLFM + βLSR , ( 8 ) where α and β are the weights used to scale the losses . The teacher network is pretrained and fixed during training the student . LCE is the standard loss based on ground truth labels for the task in hand ( e.g . cross-entropy loss for image classification ) . Note that this results in a very simple algorithm for training the student , summarized in Algorithm 1 . Algorithm 1 Knowledge distillation via Softmax Regression Representation Learning Input : Teacher network T , Student network S , input image x , ground truth label y , weights α , β . 1 . Input x to S to obtain feature hS and class prediction ŷ . Calculate cross entropy loss LCE = H ( ŷ , y ) ; 2 . Input x to T to obtain feature hT . Calculate distillation losses from Eqs . ( 3 ) and ( 7 ) ; 3 . Update S by optimizing Eq . ( 8 ) Output : the updated S .
This paper proposed a novel method for knowledge distillation. The idea is to utilize the teacher’s pre-trained classifier to train the student’s penultimate layer feature by adopting two losses: (a) the Feature Matching loss LFM and (b) the Softmax Regression loss LSR. The latter is designed to take into account the classification task at hand, which imposes that for the same input image, the teacher’s and student’s feature produce the same output when passed through the teacher’s pre-trained and frozen classifier.
SP:4ad6e101af93b83ea1704de6137d2ddd52f6f5ae
Improved Uncertainty Post-Calibration via Rank Preserving Transforms
1 INTRODUCTION . Modern machine learning models such as deep neural networks have achieved high performance on many challenging tasks , and have been put into production that impacts billions of people ( LeCun et al. , 2015 ) . It is increasingly critical that the outputs of these models are comprehensible and safe to use in downstream applications . However , high-accuracy classification models often exhibit the failure mode of miscalibration : the output probabilities of these models do not reflect the true accuracies , and tend to be over-confident ( Guo et al. , 2017 ; Lakshminarayanan et al. , 2017 ) . As the output probabilities are typically comprehended as ( an estimate of ) true accuracies and used in downstream applications , miscalibration can negatively impact the decision making , and is especially dangerous in risk-sensitive domains such as medical AI ( Begoli et al. , 2019 ; Jiang et al. , 2012 ) or self-driving cars ( Michelmore et al. , 2018 ) . It is an important question how to properly calibrate these models so as to make the output probabilities more trustworthy and safer to use . Existing methods for uncertainty calibration can roughly be divided into two types . Diversity-based methods such as ensembles ( Lakshminarayanan et al. , 2017 ; Wen et al. , 2020 ) and Bayesian networks ( Gal & Ghahramani , 2016 ; Maddox et al. , 2019 ; Dusenberry et al. , 2020 ) work by aggregating predicted probability over multiple models or multiple times on a randomized model . These methods are able to improve both the accuracy and the uncertainty calibration over a single deterministic model ( Ovadia et al. , 2019 ) . However , deploying these models requires either storing all the ensemble members and/or running multiple random variants of the same model , which makes them memory-expensive and runtime-inefficient . On the other hand , post-calibration methods work by learning a calibrator on top of the output probabilities ( or logits ) of an existing well-trained model ( Platt et al. , 1999 ; Zadrozny & Elkan , 2001 ; 2002 ; Guo et al. , 2017 ; Ding et al. , 2020 ) . For a K-class classification model that outputs logits z = z ( x ) ∈ RK , post-calibration methods learn a calibrator f : RK → RK using additional holdout data , so that f ( z ) is better calibrated than the original z . The architectures of such calibrators are typically simple : A prevalent example is the temperature scaling method which learns fT ( z ) = z/T with a single trainable parameter T > 0 by minimizing the negative log-likelihood ( NLL ) loss on holdout data . Such simple calibrators add no overhead to the existing model , and is empirically shown to improve the calibration significantly on a variety of tasks and models ( Guo et al. , 2017 ) . Despite its empirical success , the design of post-calibration methods is not yet fully satisfactory : In practice , simple calibrators such as temperature scaling often underfit the calibration loss on its training data , whereas more complex calibrators can often overfit—see Figure 1 for a quantitative illustration of this effect . While the underfitting of simple calibrators are perhaps due to their limited expressive power , the overfitting of complex calibrators is also believed to be natural since the holdout dataset used for training the calibrators are typically small ( e.g . a few thousands of examples ) . One concrete example is the matrix scaling method which learns a matrix calibrator fW , b ( z ) = Wz + b involving O ( K2 ) trainable parameters . When K is large , matrix scaling often tend to overfit and hurt calibration , despite being a strict generalization of temperature scaling ( Guo et al. , 2017 ) . It is further observed that the overfitting can not be easily fixed by applying common regularizations such as L2 on the calibrator ( Kull et al. , 2019 ) . These empirical evidence seems to suggest that complex calibrators with a large amount of parameters are perhaps not recommended in designing post calibration methods . In this paper , we show that in contrast to the prior belief , large calibrators do not necessarily overfit ; it is rather a lack of accuracy constraint on the calibrator that may have caused the overfitting . Observe that matrix scaling , unlike temperature scaling , is not guaranteed to maintain the accuracy of the model : it applies a general affine transform z 7→ Wz + b on the logits and can modify their rank ( and thus the predicted top label ) , whereas temperature scaling is guaranteed to preserve the rank . When trained with the NLL loss , a calibrator that does not maintain the accuracy may attempt to improve the accuracy at the cost of hurting ( or not improving ) the calibration . Motivated by this observation , this paper proposes Neural Rank-Preserving Transforms ( NRPT ) , a method for learning calibrators that maintain the accuracy of the model , yet are complex enough for yielding better calibration performance than simple calibrators such as temperature scaling . Our key idea is that a sufficient condition for the calibrator to maintain the accuracy is for it to preserve the rank of the logits : any mapping that preserves the rank of the logits will not change the predicted top label . We instantiate this idea by designing a family of calibrators that perform entrywise monotone transforms on each individual logit ( or log-probability ) : for a K-class classification problem , NRPT scales each logit as zi → f ( zi , x ) , where zi ∈ R is the i-th logit ( 1 ≤ i ≤ K ) , x ∈ Rd is the original input features , and f : R× Rd → R is monotonically increasing in its first argument but otherwise arbitrary . As f is monotone , we have f ( z1 , x ) ≤ f ( z2 , x ) if z1 ≤ z2 , and thus f preserves the rank of the logits . This method strictly generalizes temperature scaling ( which uses f ( zi , x ) = zi/T ) and local temperature scaling ( which uses f ( zi , x ) = zi/T ( x ) ) ( Ding et al. , 2020 ) . The fact that f can depend on x further helps improve the expressivity of f and allows great flexibility in the architecture design . We compare our instantiation of NRPT against temperature scaling and matrix scaling in Figure 1 , in which we see that NRPT is indeed able to fit the training loss better than temperature scaling and does not suffer from overfitting . Our contributions We propose Neural Rank-Preserving Transforms ( NRPT ) , an improved method for performing uncertainty post-calibration on a trained classifier while maintaining its accuracy ( Section 3 ) . NRPT learns calibrators that scale the logits using general monotone transforms , are individualized to the original input features , and allow learning with any calibration loss function ( not restricted to those that correlates with the accuracy ) . We show experimentally that NRPT improves the expected calibration error ( ECE ) significantly over existing post-calibration methods on large-scale image and text classification tasks such as CIFAR-100 , ImageNet , and MNLI ( Section 4.1 ) . NRPT can further match diversity-based methods such as deep ensembles , while using a much less number of additional parameters . We further demonstrate the strong calibration ability of NRPT beyond the ECE , by showing that it improves on the accuracy among top-confidence predictions , as well as the tradeoff between ECE and sharpness of prediction ( Section 4.2 ) . Due to the space constraint , we defer the discussions of additional related work to Appendix A and additional experimental details and results to the later Appendices . 2 BACKGROUND ON UNCERTAINTY CALIBRATION . We consider K-class classification problems where X ∈ Rd is the input ( features ) , Y ∈ [ K ] : = { 1 , . . . , K } is the true label , and ( X , Y ) follows some underlying joint distribution . Let p̂ : Rd → ∆K be a prediction model ( for example , a neural network learned from data ) that maps inputs to probabilities , where ∆K : = { ( p1 , . . . , pK ) : pi ≥ 0 , ∑ i pi = 1 } is the set of all probability distributions on [ K ] . We say p̂ is perfectly calibrated if P ( Y = k | p̂ ( X ) = p ) = pk for all p ∈ ∆K , k ∈ [ K ] . In other words , a model is perfectly calibrated if when the model predicts p̂ ( X ) = p , the conditional distribution of Y is exactly p. It is difficult to evaluate perfect calibration from finite data , as for almost all p we do not receive samples that satisfy the exact conditioning p̂ ( x ) = p. This motivates considering alternative scalar metrics for calibration that can be estimated from data . ECE The Expected Calibration Error ( ECE ) is a commonly used metric that measures calibration through grouping examples according to the confidence ( i.e . the top predicted probability ) ( Naeini et al. , 2015 ; Guo et al. , 2017 ) . Let { ( xi , yi ) } ni=1 be the evaluation dataset on which we wish to evaluate the calibration of a model p̂ . Define the intervals Im = ( m−1M , m M ] , where M > 0 is a ( fixed ) number of bins , and partitions the examples into M bins according to the confidence : Bm = { i : maxk p̂ ( xi ) k ∈ Im } . Define the accuracy and confidence within Bm as acc ( Bm ) : = 1 Bm ∑ i∈Bm 1 { arg max k p̂ ( xi ) k = yi } and conf ( Bm ) : = 1 Bm ∑ i∈Bm max k p̂ ( xi ) k The ECE is then defined as the ( weighted ) average difference between accuracy and confidence : ECE ( p̂ ) : = M∑ m=1 |Bm| n |acc ( Bm ) − conf ( Bm ) | . ( 1 ) The ECE is a sensible calibration metric since it is a binned approximation of the top-label calibration error ( TCE ) that measures the difference between accuracy and confidence under exact conditioning : TCE ( p̂ ) : = E [ ∣∣∣∣P ( arg max k p̂ ( X ) k = Y | max k p̂ ( X ) k ) −max k p̂ ( X ) k ∣∣∣∣ ] . Debiased ECE Recent work shows that the ECE has an inherent positive bias and proposes the Debiased ECE that approximately removes this bias using Gaussian bootstrapping ( Kumar et al. , 2019 ) : DECE ( p̂ ) : = ECE ( p̂ ) − ( ER1 : M [ M∑ m=1 |Bm| n |conf ( Bm ) −Rm| ] − ECE ( p̂ ) ) , where Rm ∼ N ( acc ( Bm ) , acc ( Bm ) ( 1−acc ( Bm ) ) |Bm| ) . Kumar et al . ( 2019 ) showed that the debiased ECE is a typically more accurate estimator of the TCE than ECE , especially when the TCE is relatively small . In our experiments , we use both the ECE and the debiased ECE for evaluating calibration . NLL The Negative Log-Likelihood ( NLL ) , typically used as loss function for training classifiers , is also a measure of calibration : NLL ( p̂ ) : = 1 n n∑ i=1 − log p̂ ( xi ) yi . ( 2 ) NLL is a proper scoring rule ( Lakshminarayanan et al. , 2017 ) in the sense that the population minimizer over all possible p̂ is achieved at the ground truth conditional distribution p ? ( Hastie et al. , 2009 ) . In general , the NLL measures the distance between p̂ and p ? , and is thus a joint metric of accuracy and calibration . Predictive entropy ( sharpness ) While we are mostly concered about the accuracy and calibration of a model , these two metrics alone do not fully guarantee a proper uncertainty quantification . For example , any high-accuracy model can be calibrated in a “ trivial ” way such that the ECE becomes exactly 0 , by mapping the confidence on all examples to be equal to the ( overall ) accuracy of the model , and rescaling the non-top probabilities accordingly . In order to prevent such trivial calibration , we additionally measure the sharpness of the predictions using the predictive entropy ( Lakshminarayanan et al. , 2017 ) : PEnt ( p̂ ) = 1 n n∑ i=1 K∑ k=1 −p̂ ( xi ) k log p̂ ( xi ) k. Lower predictive entropies indicate sharper predictions ( i.e . predictions closer to delta distributions than the uniform distribution ) . In general , the predictive entropy is not necessarily related to the calibration ; however , for models that have the same accuracies , we observe that the predictive entropy is typically negatively correlated with calibration—sharper predictions are usually less calibrated .
This paper proposes a post-calibration technique that is meant to be more powerful than temperature scaling without introducing overfitting. The authors argue that previous attempts to generalize temperature scaling have a tendency to overfit not because of the additional parameters, but rather because they are not rank preserving (and therefore can change model predictions / accuracy). The key idea is to use a higher-capacity (2-layer neural network) calibrator that is constrained to be rank-preserving so that model accuracy remains unchanged. The proposed method is compared against baselines on classification tasks from vision (CIFAR-100, ImageNet) and language (MNLI).
SP:6dfa69b550d13cf14a3f1492245913b5895cb44b
Improved Uncertainty Post-Calibration via Rank Preserving Transforms
1 INTRODUCTION . Modern machine learning models such as deep neural networks have achieved high performance on many challenging tasks , and have been put into production that impacts billions of people ( LeCun et al. , 2015 ) . It is increasingly critical that the outputs of these models are comprehensible and safe to use in downstream applications . However , high-accuracy classification models often exhibit the failure mode of miscalibration : the output probabilities of these models do not reflect the true accuracies , and tend to be over-confident ( Guo et al. , 2017 ; Lakshminarayanan et al. , 2017 ) . As the output probabilities are typically comprehended as ( an estimate of ) true accuracies and used in downstream applications , miscalibration can negatively impact the decision making , and is especially dangerous in risk-sensitive domains such as medical AI ( Begoli et al. , 2019 ; Jiang et al. , 2012 ) or self-driving cars ( Michelmore et al. , 2018 ) . It is an important question how to properly calibrate these models so as to make the output probabilities more trustworthy and safer to use . Existing methods for uncertainty calibration can roughly be divided into two types . Diversity-based methods such as ensembles ( Lakshminarayanan et al. , 2017 ; Wen et al. , 2020 ) and Bayesian networks ( Gal & Ghahramani , 2016 ; Maddox et al. , 2019 ; Dusenberry et al. , 2020 ) work by aggregating predicted probability over multiple models or multiple times on a randomized model . These methods are able to improve both the accuracy and the uncertainty calibration over a single deterministic model ( Ovadia et al. , 2019 ) . However , deploying these models requires either storing all the ensemble members and/or running multiple random variants of the same model , which makes them memory-expensive and runtime-inefficient . On the other hand , post-calibration methods work by learning a calibrator on top of the output probabilities ( or logits ) of an existing well-trained model ( Platt et al. , 1999 ; Zadrozny & Elkan , 2001 ; 2002 ; Guo et al. , 2017 ; Ding et al. , 2020 ) . For a K-class classification model that outputs logits z = z ( x ) ∈ RK , post-calibration methods learn a calibrator f : RK → RK using additional holdout data , so that f ( z ) is better calibrated than the original z . The architectures of such calibrators are typically simple : A prevalent example is the temperature scaling method which learns fT ( z ) = z/T with a single trainable parameter T > 0 by minimizing the negative log-likelihood ( NLL ) loss on holdout data . Such simple calibrators add no overhead to the existing model , and is empirically shown to improve the calibration significantly on a variety of tasks and models ( Guo et al. , 2017 ) . Despite its empirical success , the design of post-calibration methods is not yet fully satisfactory : In practice , simple calibrators such as temperature scaling often underfit the calibration loss on its training data , whereas more complex calibrators can often overfit—see Figure 1 for a quantitative illustration of this effect . While the underfitting of simple calibrators are perhaps due to their limited expressive power , the overfitting of complex calibrators is also believed to be natural since the holdout dataset used for training the calibrators are typically small ( e.g . a few thousands of examples ) . One concrete example is the matrix scaling method which learns a matrix calibrator fW , b ( z ) = Wz + b involving O ( K2 ) trainable parameters . When K is large , matrix scaling often tend to overfit and hurt calibration , despite being a strict generalization of temperature scaling ( Guo et al. , 2017 ) . It is further observed that the overfitting can not be easily fixed by applying common regularizations such as L2 on the calibrator ( Kull et al. , 2019 ) . These empirical evidence seems to suggest that complex calibrators with a large amount of parameters are perhaps not recommended in designing post calibration methods . In this paper , we show that in contrast to the prior belief , large calibrators do not necessarily overfit ; it is rather a lack of accuracy constraint on the calibrator that may have caused the overfitting . Observe that matrix scaling , unlike temperature scaling , is not guaranteed to maintain the accuracy of the model : it applies a general affine transform z 7→ Wz + b on the logits and can modify their rank ( and thus the predicted top label ) , whereas temperature scaling is guaranteed to preserve the rank . When trained with the NLL loss , a calibrator that does not maintain the accuracy may attempt to improve the accuracy at the cost of hurting ( or not improving ) the calibration . Motivated by this observation , this paper proposes Neural Rank-Preserving Transforms ( NRPT ) , a method for learning calibrators that maintain the accuracy of the model , yet are complex enough for yielding better calibration performance than simple calibrators such as temperature scaling . Our key idea is that a sufficient condition for the calibrator to maintain the accuracy is for it to preserve the rank of the logits : any mapping that preserves the rank of the logits will not change the predicted top label . We instantiate this idea by designing a family of calibrators that perform entrywise monotone transforms on each individual logit ( or log-probability ) : for a K-class classification problem , NRPT scales each logit as zi → f ( zi , x ) , where zi ∈ R is the i-th logit ( 1 ≤ i ≤ K ) , x ∈ Rd is the original input features , and f : R× Rd → R is monotonically increasing in its first argument but otherwise arbitrary . As f is monotone , we have f ( z1 , x ) ≤ f ( z2 , x ) if z1 ≤ z2 , and thus f preserves the rank of the logits . This method strictly generalizes temperature scaling ( which uses f ( zi , x ) = zi/T ) and local temperature scaling ( which uses f ( zi , x ) = zi/T ( x ) ) ( Ding et al. , 2020 ) . The fact that f can depend on x further helps improve the expressivity of f and allows great flexibility in the architecture design . We compare our instantiation of NRPT against temperature scaling and matrix scaling in Figure 1 , in which we see that NRPT is indeed able to fit the training loss better than temperature scaling and does not suffer from overfitting . Our contributions We propose Neural Rank-Preserving Transforms ( NRPT ) , an improved method for performing uncertainty post-calibration on a trained classifier while maintaining its accuracy ( Section 3 ) . NRPT learns calibrators that scale the logits using general monotone transforms , are individualized to the original input features , and allow learning with any calibration loss function ( not restricted to those that correlates with the accuracy ) . We show experimentally that NRPT improves the expected calibration error ( ECE ) significantly over existing post-calibration methods on large-scale image and text classification tasks such as CIFAR-100 , ImageNet , and MNLI ( Section 4.1 ) . NRPT can further match diversity-based methods such as deep ensembles , while using a much less number of additional parameters . We further demonstrate the strong calibration ability of NRPT beyond the ECE , by showing that it improves on the accuracy among top-confidence predictions , as well as the tradeoff between ECE and sharpness of prediction ( Section 4.2 ) . Due to the space constraint , we defer the discussions of additional related work to Appendix A and additional experimental details and results to the later Appendices . 2 BACKGROUND ON UNCERTAINTY CALIBRATION . We consider K-class classification problems where X ∈ Rd is the input ( features ) , Y ∈ [ K ] : = { 1 , . . . , K } is the true label , and ( X , Y ) follows some underlying joint distribution . Let p̂ : Rd → ∆K be a prediction model ( for example , a neural network learned from data ) that maps inputs to probabilities , where ∆K : = { ( p1 , . . . , pK ) : pi ≥ 0 , ∑ i pi = 1 } is the set of all probability distributions on [ K ] . We say p̂ is perfectly calibrated if P ( Y = k | p̂ ( X ) = p ) = pk for all p ∈ ∆K , k ∈ [ K ] . In other words , a model is perfectly calibrated if when the model predicts p̂ ( X ) = p , the conditional distribution of Y is exactly p. It is difficult to evaluate perfect calibration from finite data , as for almost all p we do not receive samples that satisfy the exact conditioning p̂ ( x ) = p. This motivates considering alternative scalar metrics for calibration that can be estimated from data . ECE The Expected Calibration Error ( ECE ) is a commonly used metric that measures calibration through grouping examples according to the confidence ( i.e . the top predicted probability ) ( Naeini et al. , 2015 ; Guo et al. , 2017 ) . Let { ( xi , yi ) } ni=1 be the evaluation dataset on which we wish to evaluate the calibration of a model p̂ . Define the intervals Im = ( m−1M , m M ] , where M > 0 is a ( fixed ) number of bins , and partitions the examples into M bins according to the confidence : Bm = { i : maxk p̂ ( xi ) k ∈ Im } . Define the accuracy and confidence within Bm as acc ( Bm ) : = 1 Bm ∑ i∈Bm 1 { arg max k p̂ ( xi ) k = yi } and conf ( Bm ) : = 1 Bm ∑ i∈Bm max k p̂ ( xi ) k The ECE is then defined as the ( weighted ) average difference between accuracy and confidence : ECE ( p̂ ) : = M∑ m=1 |Bm| n |acc ( Bm ) − conf ( Bm ) | . ( 1 ) The ECE is a sensible calibration metric since it is a binned approximation of the top-label calibration error ( TCE ) that measures the difference between accuracy and confidence under exact conditioning : TCE ( p̂ ) : = E [ ∣∣∣∣P ( arg max k p̂ ( X ) k = Y | max k p̂ ( X ) k ) −max k p̂ ( X ) k ∣∣∣∣ ] . Debiased ECE Recent work shows that the ECE has an inherent positive bias and proposes the Debiased ECE that approximately removes this bias using Gaussian bootstrapping ( Kumar et al. , 2019 ) : DECE ( p̂ ) : = ECE ( p̂ ) − ( ER1 : M [ M∑ m=1 |Bm| n |conf ( Bm ) −Rm| ] − ECE ( p̂ ) ) , where Rm ∼ N ( acc ( Bm ) , acc ( Bm ) ( 1−acc ( Bm ) ) |Bm| ) . Kumar et al . ( 2019 ) showed that the debiased ECE is a typically more accurate estimator of the TCE than ECE , especially when the TCE is relatively small . In our experiments , we use both the ECE and the debiased ECE for evaluating calibration . NLL The Negative Log-Likelihood ( NLL ) , typically used as loss function for training classifiers , is also a measure of calibration : NLL ( p̂ ) : = 1 n n∑ i=1 − log p̂ ( xi ) yi . ( 2 ) NLL is a proper scoring rule ( Lakshminarayanan et al. , 2017 ) in the sense that the population minimizer over all possible p̂ is achieved at the ground truth conditional distribution p ? ( Hastie et al. , 2009 ) . In general , the NLL measures the distance between p̂ and p ? , and is thus a joint metric of accuracy and calibration . Predictive entropy ( sharpness ) While we are mostly concered about the accuracy and calibration of a model , these two metrics alone do not fully guarantee a proper uncertainty quantification . For example , any high-accuracy model can be calibrated in a “ trivial ” way such that the ECE becomes exactly 0 , by mapping the confidence on all examples to be equal to the ( overall ) accuracy of the model , and rescaling the non-top probabilities accordingly . In order to prevent such trivial calibration , we additionally measure the sharpness of the predictions using the predictive entropy ( Lakshminarayanan et al. , 2017 ) : PEnt ( p̂ ) = 1 n n∑ i=1 K∑ k=1 −p̂ ( xi ) k log p̂ ( xi ) k. Lower predictive entropies indicate sharper predictions ( i.e . predictions closer to delta distributions than the uniform distribution ) . In general , the predictive entropy is not necessarily related to the calibration ; however , for models that have the same accuracies , we observe that the predictive entropy is typically negatively correlated with calibration—sharper predictions are usually less calibrated .
This work proposes a method for calibrating outputs of deep neural networks using higher capacity learning than previously possible. This is accomplished by a “Neural Rank Preserving Transform” (NRPT) which is applied post-logit to the network outputs. The learned NRPT transform is monotonic, it preserves the rank of the probabilities between logits. The authors also propose to train using a loss for the Expected Calibration Error (ECE), which is the metric that calibration models seek to minimize. This is a straightforward way to improve model calibration, and to my knowledge it has not been proposed in prior works.
SP:6dfa69b550d13cf14a3f1492245913b5895cb44b
Improved Uncertainty Post-Calibration via Rank Preserving Transforms
1 INTRODUCTION . Modern machine learning models such as deep neural networks have achieved high performance on many challenging tasks , and have been put into production that impacts billions of people ( LeCun et al. , 2015 ) . It is increasingly critical that the outputs of these models are comprehensible and safe to use in downstream applications . However , high-accuracy classification models often exhibit the failure mode of miscalibration : the output probabilities of these models do not reflect the true accuracies , and tend to be over-confident ( Guo et al. , 2017 ; Lakshminarayanan et al. , 2017 ) . As the output probabilities are typically comprehended as ( an estimate of ) true accuracies and used in downstream applications , miscalibration can negatively impact the decision making , and is especially dangerous in risk-sensitive domains such as medical AI ( Begoli et al. , 2019 ; Jiang et al. , 2012 ) or self-driving cars ( Michelmore et al. , 2018 ) . It is an important question how to properly calibrate these models so as to make the output probabilities more trustworthy and safer to use . Existing methods for uncertainty calibration can roughly be divided into two types . Diversity-based methods such as ensembles ( Lakshminarayanan et al. , 2017 ; Wen et al. , 2020 ) and Bayesian networks ( Gal & Ghahramani , 2016 ; Maddox et al. , 2019 ; Dusenberry et al. , 2020 ) work by aggregating predicted probability over multiple models or multiple times on a randomized model . These methods are able to improve both the accuracy and the uncertainty calibration over a single deterministic model ( Ovadia et al. , 2019 ) . However , deploying these models requires either storing all the ensemble members and/or running multiple random variants of the same model , which makes them memory-expensive and runtime-inefficient . On the other hand , post-calibration methods work by learning a calibrator on top of the output probabilities ( or logits ) of an existing well-trained model ( Platt et al. , 1999 ; Zadrozny & Elkan , 2001 ; 2002 ; Guo et al. , 2017 ; Ding et al. , 2020 ) . For a K-class classification model that outputs logits z = z ( x ) ∈ RK , post-calibration methods learn a calibrator f : RK → RK using additional holdout data , so that f ( z ) is better calibrated than the original z . The architectures of such calibrators are typically simple : A prevalent example is the temperature scaling method which learns fT ( z ) = z/T with a single trainable parameter T > 0 by minimizing the negative log-likelihood ( NLL ) loss on holdout data . Such simple calibrators add no overhead to the existing model , and is empirically shown to improve the calibration significantly on a variety of tasks and models ( Guo et al. , 2017 ) . Despite its empirical success , the design of post-calibration methods is not yet fully satisfactory : In practice , simple calibrators such as temperature scaling often underfit the calibration loss on its training data , whereas more complex calibrators can often overfit—see Figure 1 for a quantitative illustration of this effect . While the underfitting of simple calibrators are perhaps due to their limited expressive power , the overfitting of complex calibrators is also believed to be natural since the holdout dataset used for training the calibrators are typically small ( e.g . a few thousands of examples ) . One concrete example is the matrix scaling method which learns a matrix calibrator fW , b ( z ) = Wz + b involving O ( K2 ) trainable parameters . When K is large , matrix scaling often tend to overfit and hurt calibration , despite being a strict generalization of temperature scaling ( Guo et al. , 2017 ) . It is further observed that the overfitting can not be easily fixed by applying common regularizations such as L2 on the calibrator ( Kull et al. , 2019 ) . These empirical evidence seems to suggest that complex calibrators with a large amount of parameters are perhaps not recommended in designing post calibration methods . In this paper , we show that in contrast to the prior belief , large calibrators do not necessarily overfit ; it is rather a lack of accuracy constraint on the calibrator that may have caused the overfitting . Observe that matrix scaling , unlike temperature scaling , is not guaranteed to maintain the accuracy of the model : it applies a general affine transform z 7→ Wz + b on the logits and can modify their rank ( and thus the predicted top label ) , whereas temperature scaling is guaranteed to preserve the rank . When trained with the NLL loss , a calibrator that does not maintain the accuracy may attempt to improve the accuracy at the cost of hurting ( or not improving ) the calibration . Motivated by this observation , this paper proposes Neural Rank-Preserving Transforms ( NRPT ) , a method for learning calibrators that maintain the accuracy of the model , yet are complex enough for yielding better calibration performance than simple calibrators such as temperature scaling . Our key idea is that a sufficient condition for the calibrator to maintain the accuracy is for it to preserve the rank of the logits : any mapping that preserves the rank of the logits will not change the predicted top label . We instantiate this idea by designing a family of calibrators that perform entrywise monotone transforms on each individual logit ( or log-probability ) : for a K-class classification problem , NRPT scales each logit as zi → f ( zi , x ) , where zi ∈ R is the i-th logit ( 1 ≤ i ≤ K ) , x ∈ Rd is the original input features , and f : R× Rd → R is monotonically increasing in its first argument but otherwise arbitrary . As f is monotone , we have f ( z1 , x ) ≤ f ( z2 , x ) if z1 ≤ z2 , and thus f preserves the rank of the logits . This method strictly generalizes temperature scaling ( which uses f ( zi , x ) = zi/T ) and local temperature scaling ( which uses f ( zi , x ) = zi/T ( x ) ) ( Ding et al. , 2020 ) . The fact that f can depend on x further helps improve the expressivity of f and allows great flexibility in the architecture design . We compare our instantiation of NRPT against temperature scaling and matrix scaling in Figure 1 , in which we see that NRPT is indeed able to fit the training loss better than temperature scaling and does not suffer from overfitting . Our contributions We propose Neural Rank-Preserving Transforms ( NRPT ) , an improved method for performing uncertainty post-calibration on a trained classifier while maintaining its accuracy ( Section 3 ) . NRPT learns calibrators that scale the logits using general monotone transforms , are individualized to the original input features , and allow learning with any calibration loss function ( not restricted to those that correlates with the accuracy ) . We show experimentally that NRPT improves the expected calibration error ( ECE ) significantly over existing post-calibration methods on large-scale image and text classification tasks such as CIFAR-100 , ImageNet , and MNLI ( Section 4.1 ) . NRPT can further match diversity-based methods such as deep ensembles , while using a much less number of additional parameters . We further demonstrate the strong calibration ability of NRPT beyond the ECE , by showing that it improves on the accuracy among top-confidence predictions , as well as the tradeoff between ECE and sharpness of prediction ( Section 4.2 ) . Due to the space constraint , we defer the discussions of additional related work to Appendix A and additional experimental details and results to the later Appendices . 2 BACKGROUND ON UNCERTAINTY CALIBRATION . We consider K-class classification problems where X ∈ Rd is the input ( features ) , Y ∈ [ K ] : = { 1 , . . . , K } is the true label , and ( X , Y ) follows some underlying joint distribution . Let p̂ : Rd → ∆K be a prediction model ( for example , a neural network learned from data ) that maps inputs to probabilities , where ∆K : = { ( p1 , . . . , pK ) : pi ≥ 0 , ∑ i pi = 1 } is the set of all probability distributions on [ K ] . We say p̂ is perfectly calibrated if P ( Y = k | p̂ ( X ) = p ) = pk for all p ∈ ∆K , k ∈ [ K ] . In other words , a model is perfectly calibrated if when the model predicts p̂ ( X ) = p , the conditional distribution of Y is exactly p. It is difficult to evaluate perfect calibration from finite data , as for almost all p we do not receive samples that satisfy the exact conditioning p̂ ( x ) = p. This motivates considering alternative scalar metrics for calibration that can be estimated from data . ECE The Expected Calibration Error ( ECE ) is a commonly used metric that measures calibration through grouping examples according to the confidence ( i.e . the top predicted probability ) ( Naeini et al. , 2015 ; Guo et al. , 2017 ) . Let { ( xi , yi ) } ni=1 be the evaluation dataset on which we wish to evaluate the calibration of a model p̂ . Define the intervals Im = ( m−1M , m M ] , where M > 0 is a ( fixed ) number of bins , and partitions the examples into M bins according to the confidence : Bm = { i : maxk p̂ ( xi ) k ∈ Im } . Define the accuracy and confidence within Bm as acc ( Bm ) : = 1 Bm ∑ i∈Bm 1 { arg max k p̂ ( xi ) k = yi } and conf ( Bm ) : = 1 Bm ∑ i∈Bm max k p̂ ( xi ) k The ECE is then defined as the ( weighted ) average difference between accuracy and confidence : ECE ( p̂ ) : = M∑ m=1 |Bm| n |acc ( Bm ) − conf ( Bm ) | . ( 1 ) The ECE is a sensible calibration metric since it is a binned approximation of the top-label calibration error ( TCE ) that measures the difference between accuracy and confidence under exact conditioning : TCE ( p̂ ) : = E [ ∣∣∣∣P ( arg max k p̂ ( X ) k = Y | max k p̂ ( X ) k ) −max k p̂ ( X ) k ∣∣∣∣ ] . Debiased ECE Recent work shows that the ECE has an inherent positive bias and proposes the Debiased ECE that approximately removes this bias using Gaussian bootstrapping ( Kumar et al. , 2019 ) : DECE ( p̂ ) : = ECE ( p̂ ) − ( ER1 : M [ M∑ m=1 |Bm| n |conf ( Bm ) −Rm| ] − ECE ( p̂ ) ) , where Rm ∼ N ( acc ( Bm ) , acc ( Bm ) ( 1−acc ( Bm ) ) |Bm| ) . Kumar et al . ( 2019 ) showed that the debiased ECE is a typically more accurate estimator of the TCE than ECE , especially when the TCE is relatively small . In our experiments , we use both the ECE and the debiased ECE for evaluating calibration . NLL The Negative Log-Likelihood ( NLL ) , typically used as loss function for training classifiers , is also a measure of calibration : NLL ( p̂ ) : = 1 n n∑ i=1 − log p̂ ( xi ) yi . ( 2 ) NLL is a proper scoring rule ( Lakshminarayanan et al. , 2017 ) in the sense that the population minimizer over all possible p̂ is achieved at the ground truth conditional distribution p ? ( Hastie et al. , 2009 ) . In general , the NLL measures the distance between p̂ and p ? , and is thus a joint metric of accuracy and calibration . Predictive entropy ( sharpness ) While we are mostly concered about the accuracy and calibration of a model , these two metrics alone do not fully guarantee a proper uncertainty quantification . For example , any high-accuracy model can be calibrated in a “ trivial ” way such that the ECE becomes exactly 0 , by mapping the confidence on all examples to be equal to the ( overall ) accuracy of the model , and rescaling the non-top probabilities accordingly . In order to prevent such trivial calibration , we additionally measure the sharpness of the predictions using the predictive entropy ( Lakshminarayanan et al. , 2017 ) : PEnt ( p̂ ) = 1 n n∑ i=1 K∑ k=1 −p̂ ( xi ) k log p̂ ( xi ) k. Lower predictive entropies indicate sharper predictions ( i.e . predictions closer to delta distributions than the uniform distribution ) . In general , the predictive entropy is not necessarily related to the calibration ; however , for models that have the same accuracies , we observe that the predictive entropy is typically negatively correlated with calibration—sharper predictions are usually less calibrated .
This paper introduces a new post-processing calibration method that can keep classification ranking, like the simple (local) temperature scaling methods, but has larger capacity, comparable to matrix scaling. Essentially it tries to achieve the best of both approaches by avoiding the underfitting and overfitting issues of temperature and matrix scaling, respectively. The method proposed essentially learns a temperature and a bias parameter that depends on the image, and two matrices that are global to all images. During post-processing calibration training, the constraining of the matrices and the temperature to be strictly positive guarantees that the calibration is monotonically increasing, guaranteeing the preservation of classification ranking. The paper further shows that this calibration model can be trained in a post-processing approach with NLL and ECE losses (the training with the ECE loss is claimed as another novelty). Experiments are performed on CIFAR100, ImageNet, and MNLI, and results show that the proposed post-processing calibration stage trained with NLL improves NLL and Entropy for CIFAR100 and ImageNet, and the one trained with ECE improves the ECE related measures. For MNLI, results seem to show that the calibration with NLL loss provides the best general result. Additional results that show the value of the method for other calibration measures also display the value of the proposed approach.
SP:6dfa69b550d13cf14a3f1492245913b5895cb44b
Formalizing Generalization and Robustness of Neural Networks to Weight Perturbations
1 INTRODUCTION . Neural network is currently the state-of-the-art machine learning model in a variety of tasks , including computer vision , natural language processing , and game-playing , to name a few . In particular , feed-forward neural networks consists of layers of trainable model weights and activation functions with the premise of learning informative data representations and the complex mapping between data samples and the associated labels . Albeit attaining superior performance , the need for studying the sensitivity of neural networks to weight perturbations is also intensifying owing to several practical motivations . For instance , in model compression , the robustness to weight quantification is crucial for reducing memory storage while retaining model performance ( Hubara et al. , 2017 ; Weng et al. , 2020 ) . The notion of weight perturbation sensitivity is also used as a metric to evaluate the generalization gap at local minima ( Keskar et al. , 2017 ; Neyshabur et al. , 2017 ) . In adversarial robustness and security , weight sensitivity can be leveraged as a vulnerability for fault injection and causing erroneous prediction ( Liu et al. , 2017 ; Zhao et al. , 2019 ) . However , while weight sensitivity plays an important role in many machine learning tasks and problem setups , theoretical characterization of its impacts on generalization and robustness of neural networks remains elusive . This paper bridges this gap by developing a novel theoretical framework for understanding the generalization gap ( through Rademacher complexity ) and the robustness ( through classification margin ) of neural networks against norm-bounded weight perturbations . Specifically , we consider the multiclass classification problem setup and multi-layer feed-forward neural networks with non-negative monotonic activation functions . Our analysis offers fundamental insights into how weight perturbation affects the generalization gap and the pairwise class margin . To the best of our knowledge , this study is the first work that provides a comprehensive theoretical characterization of the interplay between weight perturbation , robustness in classification margin , and generalization gap . Moreover , based on our analysis , we propose a theory-driven loss function for training generalizable and robust neural networks against norm-bounded weight perturbations . We validate its effectiveness via empirical experiments . We summarize our main contributions as follows . • We study the robustness ( worst-case bound ) of the pairwise class margin function against weight perturbations in neural networks , including the analysis of single-layer ( Theorem 1 ) , all-layer ( Theorem 2 ) , and selected-layer ( Theorem 3 ) weight perturbations . • We characterize the generalization behavior of robust surrogate loss for neural networks under weight perturbations ( Section 3.4 ) through Rademacher complexity ( Theorem 4 ) . • We propose a theory-driven loss design for training generalizable and robust neural networks ( Section 3.5 ) . The empirical results in Section 4 validate our theoretical analysis and demonstrate the effectiveness of improving generalization and robustness against weight perturbations . 2 RELATED WORKS . In model compression , the robustness to weight quantization is critical to reducing memory size and accesses for low-precision inference and training ( Hubara et al. , 2017 ) . Weng et al . ( 2020 ) showed that incorporating weight perturbation sensitivity into training can better retain model performance ( standard accuracy ) after quantization . For studying the generalization of neural networks , Keskar et al . ( 2017 ) proposed a metric called sharpness ( or weight sensitivity ) by perturbing the learned model weights around the local minima of the loss landscape for generalization assessment while An ( 1996 ) introduced weight noise into the training process and concluded that random noise training improves the overall generalization . Neyshabur et al . ( 2017 ) made a connection between sharpness and PAC-Bayes theory and found that some combination of sharpness and norms on the model weights may capture the generalization behavior of neural networks . Additionally , Bartlett et al . ( 2017 ) discovered normalized margin measure to be useful towards quantifying generalization property and a bound was therefore constructed to give an quantitative description on the generalization gap . Moreover , Golowich et al . ( 2019 ) incorporated additional assumptions to offer tighter and size-independent bounds from the setting of ( Neyshabur et al. , 2015 ) and ( Bartlett et al. , 2017 ) respectively . Despite development of various generalization bounds , empirical observations in ( Nagarajan & Kolter , 2019 ) showed that once the size of the training dataset grows , generalization bounds proposed in ( Neyshabur et al. , 2017 ) and ( Bartlett et al. , 2017 ) will enlarge thus become vacuous . Discussions on the relation between ( Nagarajan & Kolter , 2019 ) and our works can be found at Appendix E , where we show that in our studied setting the associated generalization bounds are non-vacuous . On the other hand , Barron & Klusowski ( 2018 ) and Theisen et al . ( 2019 ) applied several techniques in tandem with a probabilistic method named path sampling to construct a representing set of given neural networks for approximating and studying the generalization property . Another approach considered by Petzka et al . ( 2020 ) consists of segmenting the neural networks into two functions , predictor and feature selection respectively where two measures ( representativeness and feature robustness ) concerning these aforementioned functions were later combined to offer a meaningful generalization bound . However , these works only focused on the generalization behavior of the local minima and did not consider the generalization and robustness under weight perturbations . Weng et al . ( 2020 ) proposed a certification method for weight perturbation retaining consistent model prediction . While the certification bound can be used to train robust models with interval bound propagation ( Gowal et al. , 2019 ) , it requires additional optimization subroutine and computation costs when comparing to our approach . Moreover , the convoluted nature of certification bound complicates the analysis when studying generalization , which is one of our main objectives . In adversarial robustness , fault-injection attacks are known to inject errors to model weights at the inference phase and causing erroneous model prediction ( Liu et al. , 2017 ; Zhao et al. , 2019 ) , which can be realized at the hardware level by changing or flipping the logic values of the corresponding bits and thus modifying the model parameters saved in memory ( Barenghi et al. , 2012 ; Van Der Veen et al. , 2016 ) . Zhao et al . ( 2020 ) proposed to use the mode connectivity of the model parameters in the loss landscape for mitigating such weight-perturbation-based adversarial attacks . Although , to the best of our knowledge , theoretical characterization of generalization and robustness for neural networks against weight perturbations remains elusive , recent works have studied these properties under another scenario – the input perturbations . Both empirical and theoretical evidence have been given to the existence of a fundamental trade-off between generalization and robustness against norm-bounded input perturbations ( Xu & Mannor , 2012 ; Su et al. , 2018 ; Zhang et al. , 2019 ; Tsipras et al. , 2019 ) . The adversarial training proposed in ( Madry et al. , 2018 ) is a popular training strategy for training robust models against input perturbations , where a min-max optimization principle is used to minimize the worst-case input perturbations of a data batch during model parameter updates . For adversarial training with input perturbations , Wang et al . ( 2019 ) proved its convergence and Yin et al . ( 2019 ) derived bounds on its Rademacher complexity for generalization . Different from the case of input perturbation , we note that min-max optimization on neural network training subject to weight perturbation is not straightforward , as the minimization and maximization steps are both taken on the model parameters . In this paper , we disentangle the min-max formulation for weight perturbation by developing bounds for the inner maximization step and provide quantifiable metrics for training generalization and robust neural networks against weight perturbations . 3 MAIN RESULTS . We provide an overview of the presentation flow for our main results as follows . First , we introduce the mathematical notations and preliminary information in Section 3.1 . In Section 3.2 , we establish our weight perturbation analysis on a simplified case of single-layer perturbation . We then use the single-layer analysis as a building block and extend the results to the multi-layer perturbation setting in Section 3.3 . In Section 3.4 , we define the framework of robust training with surrogate loss and study the generalization property using Rademacher complexity . Finally , we propose a theory-driven loss toward training robust and generalizable neural networks in Section 3.5 . 3.1 NOTATION AND PRELIMINARIES . Notation We start by introducing the mathematical notations used in this paper . We define the set [ L ] : = { 1 , 2 , ... , L } . For any two non-empty sets A , B , FA7→B denotes the set of all functions from A to B . We mark the indicator function of an event E as 1 ( E ) , which is 1 if E holds and 0 otherwise . We use sgn ( · ) to denote element-wise sign function that outputs 1 when input is nonnegative and -1 otherwise . Boldface lowercase letters are used to denote vectors ( e.g. , x ) , and the i-th element is denoted as [ x ] i. Matrices are presented as boldface uppercase letters , say W. Given a matrix W ∈ Rk×d , we write its i-th row , j-th column and ( i , j ) element as Wi , : , W : ,j , and Wi , j respectively . Moreover , we write its transpose matrix as ( W ) T . The matrix ( p , q ) norm is defined as ‖W‖p , q : = ∥∥∥ [ ‖W : ,1‖p , ‖W : ,2‖p , ... , ‖W : ,d‖p ] ∥∥∥ q for any p , q ≥ 1 . For convenience , we have ‖W‖p = ‖W‖p , p and write the spectral norm and Frobenius norm as ‖W‖σ and ‖W‖F respectively . We mark one matrix norm commonly used in this paper – the matrix ( 1 , ∞ ) norm . With a matrix W , we express its matrix ( 1 , ∞ ) norm as ‖W‖1 , ∞ , which is defined as ‖W‖1 , ∞ = maxj ‖W : ,j‖1 and ∥∥WT∥∥ 1 , ∞ = maxi ‖Wi , :‖1 . We use IB ∞ W ( ) to express an element-wise ` ∞ norm ball of matrix W within radius , i.e. , IB∞W ( ) = { Ŵ| |Ŵi , j −Wi , j | ≤ , ∀i ∈ [ k ] , j ∈ [ d ] } . Preliminaries In order to formally explain our theoretical results , we introduce the considered learning problem , neural network model and complexity definition . LetX andY be the feature space and label space , respectively . We place the assumption that all data are drawn from an unknown distribution D over X × Y and each data point is generated under i.i.d condition . In this paper , we specifically consider the feature space X as a subset of d-dimensional Euclidean space , i.e. , X ⊆ Rd . We denote the symbol F ⊆ FX 7→Y to be the hypothesis class which we use to make predictions . Furthermore , we consider a loss function ` : X × Y −→ [ 0 , 1 ] and compose it with the hypothesis class to make a function family written as ` F : = { ( x , y ) −→ ` ( f ( x ) , y ) | f ∈ F } . The optimal solution of this learning problem is a function f∗ ∈ F such that it minimizes the population risk R ( f ) = E ( x , y ) ∼D [ ` ( f ( x ) , y ) ] . However , since the underlying data distribution is generally unknown , one typically aims at reducing the empirical risk evaluated by a set of training data { ( xi , yi ) } ni=1 , which can be expressed as Rn ( f ) = 1n ∑n i=1 ` ( f ( xi ) , yi ) . The generalization error is the gap between population and empirical risk , which could serve as an indicator of model ’ s performance under unseen data from identical distribution D. To study the generalization error , one would explore the learning capacity of a certain hypothesis class . In this paper , we adopt the notion of Rademacher complexity as a measure of learning capacity , which is widely used in statistical machine learning literature ( Mohri et al. , 2018 ) . The empirical Rademacher complexity of a function class F given a set of samples S = { ( xi , yi ) } ni=1 is RS ( ` F ) = Eν [ sup f∈F 1 n n∑ i=1 νi ` ( f ( xi ) , yi ) ] ( 1 ) where { νi } ni=1 is a set of i.i.d Rademacher random variables with P { νi = −1 } = P { νi = +1 } = 12 . The empirical Rademacher complexity measures on average how well a function class F correlates with random noises on dataset S. Thus , a richer or more complex family could better correlate with random noise on average . With Rademacher complexity as a toolkit , one can develop the following relationship between generalization error and complexity measure . Specifically , it is shown in ( Mohri et al. , 2018 ) that given a set of training samples S and assume that the range of loss function ` ( f ( x ) , y ) is [ 0 , 1 ] . Then for any δ ∈ ( 0 , 1 ) , with at least probability 1− δ we have ∀f ∈ F R ( f ) ≤ Rn ( f ) + 2RS ( ` F ) + 3 √ log 2 δ 2n ( 2 ) Note that when the Rademacher complexity is small , it is then viable to learn the hypothesis class F by minimizing the empirical risk and thus effectively reducing the generalization gap . Finally , we define the structure of neural networks and introduce a few related quantities . The problem studied in this paper is a multi-class classification task with the number of classes being K. Consider an input vector x ∈ X ⊆ Rd , an L-layer neural network is defined as fW ( x ) = WL ( ... ρ ( W1x ) ... ) ∈ FX 7→R ( 3 ) with W being the set containing all weight matrices , i.e. , W : = { Wi| ∀i ∈ [ L ] } , and the notation ρ ( · ) is used to express any non-negative monotone activation function and we further assume that ρ ( · ) is 1-Lipschitz , which includes popular activation functions such as ReLU applied element-wise on a vector . Moreover , the i-th component of neural networks ’ output is written as f iW ( x ) = [ fW ( x ) ] i and a pairwise margin between i-th and j-th class , denoted as f ijW ( x ) : = f j W ( x ) − f j W ( x ) , is said to be the difference between two classes in output of the neural network . Lastly , we use the notion of zk and ẑk to represent the output vector of the k-th layer ( k ∈ [ L − 1 ] ) under natural and weight perturbed settings respectively , which are zk = ρ ( Wk ( ... ρ ( W1x ) ... ) ) and ẑk = ρ ( Ŵ k ( ... ρ ( Ŵ 1 x ) ... ) ) , where Ŵ i ∈ IB∞Wi ( i ) denotes the perturbed weight matrix bounded by its element-wise ` ∞-norm with radius i for some i ∈ [ k ] .
The paper investigates the effects of weight perturbations on the output margin for multiclass classifcation problems. The paper shows that robustness to weight perturbations can be bounded using the (1,\infty)-norm of the weight matrices. The paper then suggests that a low (1,\infty)-norm of the weight matrices leads to better generalization. Moreover, the robustness against weight perturbation implied by low (1,\infty)-norms of weight matrices should increase the robustness against adversarial perturbations. To support these claims, the paper presents a generalization bound using the (1,\infty)-norm of weight matrices as well as an empirical evaluation using a novel surrogate loss function that, when used in training, is empirically shown to reduce the generalization gap and increase the robustness against adversarial perturbations.
SP:d4689f4057f55060106e5a21480c88330ee0e446
Formalizing Generalization and Robustness of Neural Networks to Weight Perturbations
1 INTRODUCTION . Neural network is currently the state-of-the-art machine learning model in a variety of tasks , including computer vision , natural language processing , and game-playing , to name a few . In particular , feed-forward neural networks consists of layers of trainable model weights and activation functions with the premise of learning informative data representations and the complex mapping between data samples and the associated labels . Albeit attaining superior performance , the need for studying the sensitivity of neural networks to weight perturbations is also intensifying owing to several practical motivations . For instance , in model compression , the robustness to weight quantification is crucial for reducing memory storage while retaining model performance ( Hubara et al. , 2017 ; Weng et al. , 2020 ) . The notion of weight perturbation sensitivity is also used as a metric to evaluate the generalization gap at local minima ( Keskar et al. , 2017 ; Neyshabur et al. , 2017 ) . In adversarial robustness and security , weight sensitivity can be leveraged as a vulnerability for fault injection and causing erroneous prediction ( Liu et al. , 2017 ; Zhao et al. , 2019 ) . However , while weight sensitivity plays an important role in many machine learning tasks and problem setups , theoretical characterization of its impacts on generalization and robustness of neural networks remains elusive . This paper bridges this gap by developing a novel theoretical framework for understanding the generalization gap ( through Rademacher complexity ) and the robustness ( through classification margin ) of neural networks against norm-bounded weight perturbations . Specifically , we consider the multiclass classification problem setup and multi-layer feed-forward neural networks with non-negative monotonic activation functions . Our analysis offers fundamental insights into how weight perturbation affects the generalization gap and the pairwise class margin . To the best of our knowledge , this study is the first work that provides a comprehensive theoretical characterization of the interplay between weight perturbation , robustness in classification margin , and generalization gap . Moreover , based on our analysis , we propose a theory-driven loss function for training generalizable and robust neural networks against norm-bounded weight perturbations . We validate its effectiveness via empirical experiments . We summarize our main contributions as follows . • We study the robustness ( worst-case bound ) of the pairwise class margin function against weight perturbations in neural networks , including the analysis of single-layer ( Theorem 1 ) , all-layer ( Theorem 2 ) , and selected-layer ( Theorem 3 ) weight perturbations . • We characterize the generalization behavior of robust surrogate loss for neural networks under weight perturbations ( Section 3.4 ) through Rademacher complexity ( Theorem 4 ) . • We propose a theory-driven loss design for training generalizable and robust neural networks ( Section 3.5 ) . The empirical results in Section 4 validate our theoretical analysis and demonstrate the effectiveness of improving generalization and robustness against weight perturbations . 2 RELATED WORKS . In model compression , the robustness to weight quantization is critical to reducing memory size and accesses for low-precision inference and training ( Hubara et al. , 2017 ) . Weng et al . ( 2020 ) showed that incorporating weight perturbation sensitivity into training can better retain model performance ( standard accuracy ) after quantization . For studying the generalization of neural networks , Keskar et al . ( 2017 ) proposed a metric called sharpness ( or weight sensitivity ) by perturbing the learned model weights around the local minima of the loss landscape for generalization assessment while An ( 1996 ) introduced weight noise into the training process and concluded that random noise training improves the overall generalization . Neyshabur et al . ( 2017 ) made a connection between sharpness and PAC-Bayes theory and found that some combination of sharpness and norms on the model weights may capture the generalization behavior of neural networks . Additionally , Bartlett et al . ( 2017 ) discovered normalized margin measure to be useful towards quantifying generalization property and a bound was therefore constructed to give an quantitative description on the generalization gap . Moreover , Golowich et al . ( 2019 ) incorporated additional assumptions to offer tighter and size-independent bounds from the setting of ( Neyshabur et al. , 2015 ) and ( Bartlett et al. , 2017 ) respectively . Despite development of various generalization bounds , empirical observations in ( Nagarajan & Kolter , 2019 ) showed that once the size of the training dataset grows , generalization bounds proposed in ( Neyshabur et al. , 2017 ) and ( Bartlett et al. , 2017 ) will enlarge thus become vacuous . Discussions on the relation between ( Nagarajan & Kolter , 2019 ) and our works can be found at Appendix E , where we show that in our studied setting the associated generalization bounds are non-vacuous . On the other hand , Barron & Klusowski ( 2018 ) and Theisen et al . ( 2019 ) applied several techniques in tandem with a probabilistic method named path sampling to construct a representing set of given neural networks for approximating and studying the generalization property . Another approach considered by Petzka et al . ( 2020 ) consists of segmenting the neural networks into two functions , predictor and feature selection respectively where two measures ( representativeness and feature robustness ) concerning these aforementioned functions were later combined to offer a meaningful generalization bound . However , these works only focused on the generalization behavior of the local minima and did not consider the generalization and robustness under weight perturbations . Weng et al . ( 2020 ) proposed a certification method for weight perturbation retaining consistent model prediction . While the certification bound can be used to train robust models with interval bound propagation ( Gowal et al. , 2019 ) , it requires additional optimization subroutine and computation costs when comparing to our approach . Moreover , the convoluted nature of certification bound complicates the analysis when studying generalization , which is one of our main objectives . In adversarial robustness , fault-injection attacks are known to inject errors to model weights at the inference phase and causing erroneous model prediction ( Liu et al. , 2017 ; Zhao et al. , 2019 ) , which can be realized at the hardware level by changing or flipping the logic values of the corresponding bits and thus modifying the model parameters saved in memory ( Barenghi et al. , 2012 ; Van Der Veen et al. , 2016 ) . Zhao et al . ( 2020 ) proposed to use the mode connectivity of the model parameters in the loss landscape for mitigating such weight-perturbation-based adversarial attacks . Although , to the best of our knowledge , theoretical characterization of generalization and robustness for neural networks against weight perturbations remains elusive , recent works have studied these properties under another scenario – the input perturbations . Both empirical and theoretical evidence have been given to the existence of a fundamental trade-off between generalization and robustness against norm-bounded input perturbations ( Xu & Mannor , 2012 ; Su et al. , 2018 ; Zhang et al. , 2019 ; Tsipras et al. , 2019 ) . The adversarial training proposed in ( Madry et al. , 2018 ) is a popular training strategy for training robust models against input perturbations , where a min-max optimization principle is used to minimize the worst-case input perturbations of a data batch during model parameter updates . For adversarial training with input perturbations , Wang et al . ( 2019 ) proved its convergence and Yin et al . ( 2019 ) derived bounds on its Rademacher complexity for generalization . Different from the case of input perturbation , we note that min-max optimization on neural network training subject to weight perturbation is not straightforward , as the minimization and maximization steps are both taken on the model parameters . In this paper , we disentangle the min-max formulation for weight perturbation by developing bounds for the inner maximization step and provide quantifiable metrics for training generalization and robust neural networks against weight perturbations . 3 MAIN RESULTS . We provide an overview of the presentation flow for our main results as follows . First , we introduce the mathematical notations and preliminary information in Section 3.1 . In Section 3.2 , we establish our weight perturbation analysis on a simplified case of single-layer perturbation . We then use the single-layer analysis as a building block and extend the results to the multi-layer perturbation setting in Section 3.3 . In Section 3.4 , we define the framework of robust training with surrogate loss and study the generalization property using Rademacher complexity . Finally , we propose a theory-driven loss toward training robust and generalizable neural networks in Section 3.5 . 3.1 NOTATION AND PRELIMINARIES . Notation We start by introducing the mathematical notations used in this paper . We define the set [ L ] : = { 1 , 2 , ... , L } . For any two non-empty sets A , B , FA7→B denotes the set of all functions from A to B . We mark the indicator function of an event E as 1 ( E ) , which is 1 if E holds and 0 otherwise . We use sgn ( · ) to denote element-wise sign function that outputs 1 when input is nonnegative and -1 otherwise . Boldface lowercase letters are used to denote vectors ( e.g. , x ) , and the i-th element is denoted as [ x ] i. Matrices are presented as boldface uppercase letters , say W. Given a matrix W ∈ Rk×d , we write its i-th row , j-th column and ( i , j ) element as Wi , : , W : ,j , and Wi , j respectively . Moreover , we write its transpose matrix as ( W ) T . The matrix ( p , q ) norm is defined as ‖W‖p , q : = ∥∥∥ [ ‖W : ,1‖p , ‖W : ,2‖p , ... , ‖W : ,d‖p ] ∥∥∥ q for any p , q ≥ 1 . For convenience , we have ‖W‖p = ‖W‖p , p and write the spectral norm and Frobenius norm as ‖W‖σ and ‖W‖F respectively . We mark one matrix norm commonly used in this paper – the matrix ( 1 , ∞ ) norm . With a matrix W , we express its matrix ( 1 , ∞ ) norm as ‖W‖1 , ∞ , which is defined as ‖W‖1 , ∞ = maxj ‖W : ,j‖1 and ∥∥WT∥∥ 1 , ∞ = maxi ‖Wi , :‖1 . We use IB ∞ W ( ) to express an element-wise ` ∞ norm ball of matrix W within radius , i.e. , IB∞W ( ) = { Ŵ| |Ŵi , j −Wi , j | ≤ , ∀i ∈ [ k ] , j ∈ [ d ] } . Preliminaries In order to formally explain our theoretical results , we introduce the considered learning problem , neural network model and complexity definition . LetX andY be the feature space and label space , respectively . We place the assumption that all data are drawn from an unknown distribution D over X × Y and each data point is generated under i.i.d condition . In this paper , we specifically consider the feature space X as a subset of d-dimensional Euclidean space , i.e. , X ⊆ Rd . We denote the symbol F ⊆ FX 7→Y to be the hypothesis class which we use to make predictions . Furthermore , we consider a loss function ` : X × Y −→ [ 0 , 1 ] and compose it with the hypothesis class to make a function family written as ` F : = { ( x , y ) −→ ` ( f ( x ) , y ) | f ∈ F } . The optimal solution of this learning problem is a function f∗ ∈ F such that it minimizes the population risk R ( f ) = E ( x , y ) ∼D [ ` ( f ( x ) , y ) ] . However , since the underlying data distribution is generally unknown , one typically aims at reducing the empirical risk evaluated by a set of training data { ( xi , yi ) } ni=1 , which can be expressed as Rn ( f ) = 1n ∑n i=1 ` ( f ( xi ) , yi ) . The generalization error is the gap between population and empirical risk , which could serve as an indicator of model ’ s performance under unseen data from identical distribution D. To study the generalization error , one would explore the learning capacity of a certain hypothesis class . In this paper , we adopt the notion of Rademacher complexity as a measure of learning capacity , which is widely used in statistical machine learning literature ( Mohri et al. , 2018 ) . The empirical Rademacher complexity of a function class F given a set of samples S = { ( xi , yi ) } ni=1 is RS ( ` F ) = Eν [ sup f∈F 1 n n∑ i=1 νi ` ( f ( xi ) , yi ) ] ( 1 ) where { νi } ni=1 is a set of i.i.d Rademacher random variables with P { νi = −1 } = P { νi = +1 } = 12 . The empirical Rademacher complexity measures on average how well a function class F correlates with random noises on dataset S. Thus , a richer or more complex family could better correlate with random noise on average . With Rademacher complexity as a toolkit , one can develop the following relationship between generalization error and complexity measure . Specifically , it is shown in ( Mohri et al. , 2018 ) that given a set of training samples S and assume that the range of loss function ` ( f ( x ) , y ) is [ 0 , 1 ] . Then for any δ ∈ ( 0 , 1 ) , with at least probability 1− δ we have ∀f ∈ F R ( f ) ≤ Rn ( f ) + 2RS ( ` F ) + 3 √ log 2 δ 2n ( 2 ) Note that when the Rademacher complexity is small , it is then viable to learn the hypothesis class F by minimizing the empirical risk and thus effectively reducing the generalization gap . Finally , we define the structure of neural networks and introduce a few related quantities . The problem studied in this paper is a multi-class classification task with the number of classes being K. Consider an input vector x ∈ X ⊆ Rd , an L-layer neural network is defined as fW ( x ) = WL ( ... ρ ( W1x ) ... ) ∈ FX 7→R ( 3 ) with W being the set containing all weight matrices , i.e. , W : = { Wi| ∀i ∈ [ L ] } , and the notation ρ ( · ) is used to express any non-negative monotone activation function and we further assume that ρ ( · ) is 1-Lipschitz , which includes popular activation functions such as ReLU applied element-wise on a vector . Moreover , the i-th component of neural networks ’ output is written as f iW ( x ) = [ fW ( x ) ] i and a pairwise margin between i-th and j-th class , denoted as f ijW ( x ) : = f j W ( x ) − f j W ( x ) , is said to be the difference between two classes in output of the neural network . Lastly , we use the notion of zk and ẑk to represent the output vector of the k-th layer ( k ∈ [ L − 1 ] ) under natural and weight perturbed settings respectively , which are zk = ρ ( Wk ( ... ρ ( W1x ) ... ) ) and ẑk = ρ ( Ŵ k ( ... ρ ( Ŵ 1 x ) ... ) ) , where Ŵ i ∈ IB∞Wi ( i ) denotes the perturbed weight matrix bounded by its element-wise ` ∞-norm with radius i for some i ∈ [ k ] .
The paper discusses learning neural network models under weight parameter perturbations. In particular the paper motivates the use of a new loss function (equation 9) based on the analysis of neural network robustness (Section 3.2, 3.3) and generalization properties (Section 3.4) to perturbations of the weight parameters. Section 4 has experiments supporting the theory that the loss function in equation 9 is robust and has good generalization properties to weight perturbations.
SP:d4689f4057f55060106e5a21480c88330ee0e446
Formalizing Generalization and Robustness of Neural Networks to Weight Perturbations
1 INTRODUCTION . Neural network is currently the state-of-the-art machine learning model in a variety of tasks , including computer vision , natural language processing , and game-playing , to name a few . In particular , feed-forward neural networks consists of layers of trainable model weights and activation functions with the premise of learning informative data representations and the complex mapping between data samples and the associated labels . Albeit attaining superior performance , the need for studying the sensitivity of neural networks to weight perturbations is also intensifying owing to several practical motivations . For instance , in model compression , the robustness to weight quantification is crucial for reducing memory storage while retaining model performance ( Hubara et al. , 2017 ; Weng et al. , 2020 ) . The notion of weight perturbation sensitivity is also used as a metric to evaluate the generalization gap at local minima ( Keskar et al. , 2017 ; Neyshabur et al. , 2017 ) . In adversarial robustness and security , weight sensitivity can be leveraged as a vulnerability for fault injection and causing erroneous prediction ( Liu et al. , 2017 ; Zhao et al. , 2019 ) . However , while weight sensitivity plays an important role in many machine learning tasks and problem setups , theoretical characterization of its impacts on generalization and robustness of neural networks remains elusive . This paper bridges this gap by developing a novel theoretical framework for understanding the generalization gap ( through Rademacher complexity ) and the robustness ( through classification margin ) of neural networks against norm-bounded weight perturbations . Specifically , we consider the multiclass classification problem setup and multi-layer feed-forward neural networks with non-negative monotonic activation functions . Our analysis offers fundamental insights into how weight perturbation affects the generalization gap and the pairwise class margin . To the best of our knowledge , this study is the first work that provides a comprehensive theoretical characterization of the interplay between weight perturbation , robustness in classification margin , and generalization gap . Moreover , based on our analysis , we propose a theory-driven loss function for training generalizable and robust neural networks against norm-bounded weight perturbations . We validate its effectiveness via empirical experiments . We summarize our main contributions as follows . • We study the robustness ( worst-case bound ) of the pairwise class margin function against weight perturbations in neural networks , including the analysis of single-layer ( Theorem 1 ) , all-layer ( Theorem 2 ) , and selected-layer ( Theorem 3 ) weight perturbations . • We characterize the generalization behavior of robust surrogate loss for neural networks under weight perturbations ( Section 3.4 ) through Rademacher complexity ( Theorem 4 ) . • We propose a theory-driven loss design for training generalizable and robust neural networks ( Section 3.5 ) . The empirical results in Section 4 validate our theoretical analysis and demonstrate the effectiveness of improving generalization and robustness against weight perturbations . 2 RELATED WORKS . In model compression , the robustness to weight quantization is critical to reducing memory size and accesses for low-precision inference and training ( Hubara et al. , 2017 ) . Weng et al . ( 2020 ) showed that incorporating weight perturbation sensitivity into training can better retain model performance ( standard accuracy ) after quantization . For studying the generalization of neural networks , Keskar et al . ( 2017 ) proposed a metric called sharpness ( or weight sensitivity ) by perturbing the learned model weights around the local minima of the loss landscape for generalization assessment while An ( 1996 ) introduced weight noise into the training process and concluded that random noise training improves the overall generalization . Neyshabur et al . ( 2017 ) made a connection between sharpness and PAC-Bayes theory and found that some combination of sharpness and norms on the model weights may capture the generalization behavior of neural networks . Additionally , Bartlett et al . ( 2017 ) discovered normalized margin measure to be useful towards quantifying generalization property and a bound was therefore constructed to give an quantitative description on the generalization gap . Moreover , Golowich et al . ( 2019 ) incorporated additional assumptions to offer tighter and size-independent bounds from the setting of ( Neyshabur et al. , 2015 ) and ( Bartlett et al. , 2017 ) respectively . Despite development of various generalization bounds , empirical observations in ( Nagarajan & Kolter , 2019 ) showed that once the size of the training dataset grows , generalization bounds proposed in ( Neyshabur et al. , 2017 ) and ( Bartlett et al. , 2017 ) will enlarge thus become vacuous . Discussions on the relation between ( Nagarajan & Kolter , 2019 ) and our works can be found at Appendix E , where we show that in our studied setting the associated generalization bounds are non-vacuous . On the other hand , Barron & Klusowski ( 2018 ) and Theisen et al . ( 2019 ) applied several techniques in tandem with a probabilistic method named path sampling to construct a representing set of given neural networks for approximating and studying the generalization property . Another approach considered by Petzka et al . ( 2020 ) consists of segmenting the neural networks into two functions , predictor and feature selection respectively where two measures ( representativeness and feature robustness ) concerning these aforementioned functions were later combined to offer a meaningful generalization bound . However , these works only focused on the generalization behavior of the local minima and did not consider the generalization and robustness under weight perturbations . Weng et al . ( 2020 ) proposed a certification method for weight perturbation retaining consistent model prediction . While the certification bound can be used to train robust models with interval bound propagation ( Gowal et al. , 2019 ) , it requires additional optimization subroutine and computation costs when comparing to our approach . Moreover , the convoluted nature of certification bound complicates the analysis when studying generalization , which is one of our main objectives . In adversarial robustness , fault-injection attacks are known to inject errors to model weights at the inference phase and causing erroneous model prediction ( Liu et al. , 2017 ; Zhao et al. , 2019 ) , which can be realized at the hardware level by changing or flipping the logic values of the corresponding bits and thus modifying the model parameters saved in memory ( Barenghi et al. , 2012 ; Van Der Veen et al. , 2016 ) . Zhao et al . ( 2020 ) proposed to use the mode connectivity of the model parameters in the loss landscape for mitigating such weight-perturbation-based adversarial attacks . Although , to the best of our knowledge , theoretical characterization of generalization and robustness for neural networks against weight perturbations remains elusive , recent works have studied these properties under another scenario – the input perturbations . Both empirical and theoretical evidence have been given to the existence of a fundamental trade-off between generalization and robustness against norm-bounded input perturbations ( Xu & Mannor , 2012 ; Su et al. , 2018 ; Zhang et al. , 2019 ; Tsipras et al. , 2019 ) . The adversarial training proposed in ( Madry et al. , 2018 ) is a popular training strategy for training robust models against input perturbations , where a min-max optimization principle is used to minimize the worst-case input perturbations of a data batch during model parameter updates . For adversarial training with input perturbations , Wang et al . ( 2019 ) proved its convergence and Yin et al . ( 2019 ) derived bounds on its Rademacher complexity for generalization . Different from the case of input perturbation , we note that min-max optimization on neural network training subject to weight perturbation is not straightforward , as the minimization and maximization steps are both taken on the model parameters . In this paper , we disentangle the min-max formulation for weight perturbation by developing bounds for the inner maximization step and provide quantifiable metrics for training generalization and robust neural networks against weight perturbations . 3 MAIN RESULTS . We provide an overview of the presentation flow for our main results as follows . First , we introduce the mathematical notations and preliminary information in Section 3.1 . In Section 3.2 , we establish our weight perturbation analysis on a simplified case of single-layer perturbation . We then use the single-layer analysis as a building block and extend the results to the multi-layer perturbation setting in Section 3.3 . In Section 3.4 , we define the framework of robust training with surrogate loss and study the generalization property using Rademacher complexity . Finally , we propose a theory-driven loss toward training robust and generalizable neural networks in Section 3.5 . 3.1 NOTATION AND PRELIMINARIES . Notation We start by introducing the mathematical notations used in this paper . We define the set [ L ] : = { 1 , 2 , ... , L } . For any two non-empty sets A , B , FA7→B denotes the set of all functions from A to B . We mark the indicator function of an event E as 1 ( E ) , which is 1 if E holds and 0 otherwise . We use sgn ( · ) to denote element-wise sign function that outputs 1 when input is nonnegative and -1 otherwise . Boldface lowercase letters are used to denote vectors ( e.g. , x ) , and the i-th element is denoted as [ x ] i. Matrices are presented as boldface uppercase letters , say W. Given a matrix W ∈ Rk×d , we write its i-th row , j-th column and ( i , j ) element as Wi , : , W : ,j , and Wi , j respectively . Moreover , we write its transpose matrix as ( W ) T . The matrix ( p , q ) norm is defined as ‖W‖p , q : = ∥∥∥ [ ‖W : ,1‖p , ‖W : ,2‖p , ... , ‖W : ,d‖p ] ∥∥∥ q for any p , q ≥ 1 . For convenience , we have ‖W‖p = ‖W‖p , p and write the spectral norm and Frobenius norm as ‖W‖σ and ‖W‖F respectively . We mark one matrix norm commonly used in this paper – the matrix ( 1 , ∞ ) norm . With a matrix W , we express its matrix ( 1 , ∞ ) norm as ‖W‖1 , ∞ , which is defined as ‖W‖1 , ∞ = maxj ‖W : ,j‖1 and ∥∥WT∥∥ 1 , ∞ = maxi ‖Wi , :‖1 . We use IB ∞ W ( ) to express an element-wise ` ∞ norm ball of matrix W within radius , i.e. , IB∞W ( ) = { Ŵ| |Ŵi , j −Wi , j | ≤ , ∀i ∈ [ k ] , j ∈ [ d ] } . Preliminaries In order to formally explain our theoretical results , we introduce the considered learning problem , neural network model and complexity definition . LetX andY be the feature space and label space , respectively . We place the assumption that all data are drawn from an unknown distribution D over X × Y and each data point is generated under i.i.d condition . In this paper , we specifically consider the feature space X as a subset of d-dimensional Euclidean space , i.e. , X ⊆ Rd . We denote the symbol F ⊆ FX 7→Y to be the hypothesis class which we use to make predictions . Furthermore , we consider a loss function ` : X × Y −→ [ 0 , 1 ] and compose it with the hypothesis class to make a function family written as ` F : = { ( x , y ) −→ ` ( f ( x ) , y ) | f ∈ F } . The optimal solution of this learning problem is a function f∗ ∈ F such that it minimizes the population risk R ( f ) = E ( x , y ) ∼D [ ` ( f ( x ) , y ) ] . However , since the underlying data distribution is generally unknown , one typically aims at reducing the empirical risk evaluated by a set of training data { ( xi , yi ) } ni=1 , which can be expressed as Rn ( f ) = 1n ∑n i=1 ` ( f ( xi ) , yi ) . The generalization error is the gap between population and empirical risk , which could serve as an indicator of model ’ s performance under unseen data from identical distribution D. To study the generalization error , one would explore the learning capacity of a certain hypothesis class . In this paper , we adopt the notion of Rademacher complexity as a measure of learning capacity , which is widely used in statistical machine learning literature ( Mohri et al. , 2018 ) . The empirical Rademacher complexity of a function class F given a set of samples S = { ( xi , yi ) } ni=1 is RS ( ` F ) = Eν [ sup f∈F 1 n n∑ i=1 νi ` ( f ( xi ) , yi ) ] ( 1 ) where { νi } ni=1 is a set of i.i.d Rademacher random variables with P { νi = −1 } = P { νi = +1 } = 12 . The empirical Rademacher complexity measures on average how well a function class F correlates with random noises on dataset S. Thus , a richer or more complex family could better correlate with random noise on average . With Rademacher complexity as a toolkit , one can develop the following relationship between generalization error and complexity measure . Specifically , it is shown in ( Mohri et al. , 2018 ) that given a set of training samples S and assume that the range of loss function ` ( f ( x ) , y ) is [ 0 , 1 ] . Then for any δ ∈ ( 0 , 1 ) , with at least probability 1− δ we have ∀f ∈ F R ( f ) ≤ Rn ( f ) + 2RS ( ` F ) + 3 √ log 2 δ 2n ( 2 ) Note that when the Rademacher complexity is small , it is then viable to learn the hypothesis class F by minimizing the empirical risk and thus effectively reducing the generalization gap . Finally , we define the structure of neural networks and introduce a few related quantities . The problem studied in this paper is a multi-class classification task with the number of classes being K. Consider an input vector x ∈ X ⊆ Rd , an L-layer neural network is defined as fW ( x ) = WL ( ... ρ ( W1x ) ... ) ∈ FX 7→R ( 3 ) with W being the set containing all weight matrices , i.e. , W : = { Wi| ∀i ∈ [ L ] } , and the notation ρ ( · ) is used to express any non-negative monotone activation function and we further assume that ρ ( · ) is 1-Lipschitz , which includes popular activation functions such as ReLU applied element-wise on a vector . Moreover , the i-th component of neural networks ’ output is written as f iW ( x ) = [ fW ( x ) ] i and a pairwise margin between i-th and j-th class , denoted as f ijW ( x ) : = f j W ( x ) − f j W ( x ) , is said to be the difference between two classes in output of the neural network . Lastly , we use the notion of zk and ẑk to represent the output vector of the k-th layer ( k ∈ [ L − 1 ] ) under natural and weight perturbed settings respectively , which are zk = ρ ( Wk ( ... ρ ( W1x ) ... ) ) and ẑk = ρ ( Ŵ k ( ... ρ ( Ŵ 1 x ) ... ) ) , where Ŵ i ∈ IB∞Wi ( i ) denotes the perturbed weight matrix bounded by its element-wise ` ∞-norm with radius i for some i ∈ [ k ] .
In this work, the authors theoretically analyze the robustness against weight perturbations in neural networks. Upper bounds of the pairwise class margin for single-layer, all-layer, and selected-layer perturbation are established. Based on the analysis, the authors propose novel robust surrogate loss functions for 0-1 loss and cross-entropy. Furthermore, the authors analyze the Rademacher complexity of the perturbated network with the proposed loss, which leads to generalization bounds based on (Mohri et al. (2018)) and (Bartlett et al. (2017)).
SP:d4689f4057f55060106e5a21480c88330ee0e446
Probabilistic Meta-Learning for Bayesian Optimization
Transfer and meta-learning algorithms leverage evaluations on related tasks in order to significantly speed up learning or optimization on a new problem . For applications that depend on uncertainty estimates , e.g. , in Bayesian optimization , recent probabilistic approaches have shown good performance at test time , but either scale poorly with the number of data points or under-perform with little data on the test task . In this paper , we propose a novel approach to probabilistic transfer learning that uses a generative model for the underlying data distribution and simultaneously learns a latent feature distribution to represent unknown task properties . To enable fast and accurate inference at test-time , we introduce a novel meta-loss that structures the latent space to match the prior used for inference . Together , these contributions ensure that our probabilistic model exhibits high sample-efficiency and provides well-calibrated uncertainty estimates . We evaluate the proposed approach and compare its performance to probabilistic models from the literature on a set of Bayesian optimization transfer-learning tasks . 1 INTRODUCTION . Bayesian optimization ( BO ) is arguably one of the most proven and widely used blackbox optimization frameworks for expensive functions ( Shahriari et al. , 2015 ) with applications that include materials design ( Frazier & Wang , 2016 ) , reinforcement learning ( Metzen et al. , 2015 ) , and automated machine learning ( ML ) ( Hutter et al. , 2019 ) . In practical applications , BO is repeatedly used to solve variations of similar tasks . In these cases , the sample efficiency can be further increased by not starting the optimization from scratch , but rather leveraging previous runs to inform and accelerate the latest one . Several approaches to this emerged under the name of transfer-learning ( Weiss et al. , 2016 ) and meta-learning ( Vanschoren , 2018 ) . Compared to early work by Swersky et al . ( 2013 ) ; Golovin et al . ( 2017 ) , recent publications leverage the representative flexibility of neural networks , which allows for more powerful models and impressive results ( Gordon et al. , 2019 ; Rusu et al. , 2019 ; Garnelo et al. , 2018b ; a ; Zintgraf et al. , 2019 ) . Despite these significant advances , only a small subset of algorithms offers the well-calibrated uncertainty estimates on which BO relies to guide its sampling strategy efficiently . Additionally , BO benefits greatly from a meaningful prior over tasks that quickly converges to the true function to provide the highest sample efficiency . Existing work mostly focuses on deterministic models and , for those providing uncertainty estimates , sample-efficiency at test time is often a challenge . Contributions We set out to close this gap and introduce BAyesian optimization with Neural Networks and Embedding Reasoning ( BaNNER ) , a flexible meta-learning method for BO . We go beyond previous work of Perrone et al . ( 2018 ) and introduce a generative regression model explicitly conditioned on a low-dimensional latent representation for the tasks . This allows our model to ( i ) encode a meaningful prior over tasks and ( ii ) remain highly sample-efficient , since each new task only requires inference over a low-dimensional latent representation . To ensure robust training of our model , we introduce a novel loss function to regularize the latent distribution and optimize our model ’ s hyper-parameters using the available meta-data . We evaluate BaNNER on a set of synthetic benchmarks and two meta-learning problems and compare with the state-of-the-art in the literature . 2 PROBLEM STATEMENT AND BACKGROUND . Our goal is to efficiently optimize an unknown function f ( x , τ ) over a domain x ∈ X for some unknown but fixed task parameters τ that are sampled from an unknown distribution τ ∼ p ( T ) . To this end , at each iteration n we can select function parameters xn and observe a noisy function value yn = f ( xn , τ ) + n , with n drawn i.i.d . from some distribution p . While our method can handle arbitrary noise distributions , we assume a Gaussian distribution , i.e . p = N ( 0 , σ2 ) , for the remainder of the paper . We assume that each evaluation of f is expensive either in terms of monetary cost or time , so that we want to minimize the number of evaluations of f during the optimization process . The most data-efficient class of algorithms for this setting are Bayesian optimization ( BO ) algorithms , which use the observations collected up to iteration n , Dn = { xi , yi } n−1i=1 , in order to infer a posterior belief over the function values f ( x , τ ) . To select parameters xn that are informative about the optimum maxx f ( x , τ ) , BO algorithms define an acquisition function α ( · ) that uses the posterior belief to select parameters as xn = argmaxx α ( p ( f ( x , τ ) | Dn ) . While BO algorithms have been studied extensively , their performance crucially depends on the properties of the statistical model used for f . The two key requirements for BO algorithms to be data-efficient are i ) , that the prior belief over f concentrates quickly on the true function f as we observe data in Dn and ii ) , that the posterior uncertainty estimates are calibrated , so that the model always considers the true function f to be statistically plausible . The latter requirement means that the true function f ( · , τ ) must always be contained in the model ’ s confidence intervals with high probability . Since the task parameters τ are unknown , in general this requires a conservative model that works well for all possible tasks τ . We propose to use meta-learning in order to learn an effective prior ( Fig . 1a ) that can quickly adapt to a new task τ ( Fig . 1b ) . We are given data from T previous tasks τt ∼ p ( T ) with Nt observations Dmetat = { ( xn , t , yn , t } Nt n=1 each . We show the resulting generative model on the left in Fig . 2 . Metalearning aims to distill the information in Dmeta into a model gθ by optimizing the meta-parameters θ . At test time , we then keep these parameters fixed and use the learned model gθ to speed up the optimization of the new function f ( · , τ ) . 3 RELATED WORK . There are several approaches to improve the sample efficiency of BO methods based on information from related tasks . We refer to ( Vanschoren , 2018 ) for a broad review of meta-learning in the context of automated machine learning and focus on the most relevant approaches below . One strategy to improve sample-efficiency is to initialize the BO algorithm with high-quality query points . These initial configurations can be either constructed to be complementary ( Feurer et al. , 2014 ; 2015 ; Lindauer & Hutter , 2018 ) or learned based on data set features ( Kim et al. , 2017 ) . An alternative strategy is to transfer knowledge between tasks by adapting the acquisition function . These approaches balance exploration and exploitation by weighting the usefulness of a given x not only on the current task , but also on the related tasks . This trade-off can either be heuristically motivated ( Wistuba et al. , 2015 ; Wistuba et al. , 2018 ) , or learned directly ( Volpp et al. , 2020 ) . All of these approaches change the BO algorithm , but not the underlying probabilistic model . Most related to our work are methods that focus on alternative ways to model the observations . Several methods build a global Gaussian process ( GP ) models across all tasks ( Swersky et al. , 2013 ; Golovin et al. , 2017 ; Marco et al. , 2017 ; Feurer et al. , 2018 ; Law et al. , 2019 ) , which requires approximations due to the cubic scaling of GPs . A method to avoid this scaling is to use a shared neural network to learn specialized features for Bayesian Linear Regression ( BLR ) . The method , dubbed adaptive BLR ( ABLR ) ( Perrone et al. , 2018 ) , learns a new BLR model for each task based on the shared neural network features . This allows ABLR to quickly adapt to new tasks and scale better than GPs , but limits its predictive power for a small number of test data points . We consider ABLR to be the state-of-the-art for our setting and use it as a baseline in our experiments . The problem of adapting a model to a new problem is not unique to BO , but arises in other fields too . Recent progress in transfer learning ( Weiss et al. , 2016 ) and meta-learning ( Vanschoren , 2018 ) is concerned with the adaptation of a ML model from one or multiple related tasks to a new one . This transfer often focuses on data-efficiency , which makes them similar to BO . While Frameworks for general ( probabilistic ) model adaption ( Finn et al. , 2017 ; 2018 ) exist , our contribution relates to a subset of approaches that directly model latent task distributions ( Gordon et al. , 2019 ; Rusu et al. , 2019 ; Garnelo et al. , 2018b ; a ; Zintgraf et al. , 2019 ) . All of them model the relationship between tasks using the task specific variables , latent variables , and a model that adapts to new tasks by using these latent variables ( often as an input ) . Most of these meta-learning algorithms do not consider active learning as an application and focus on deterministic models gθ . In the following , we propose a method to meta-learn a probabilistic prior model that we can use together with approximate inference in order to estimate a posterior distribution for BO . 4 PROBABILISTIC META-LEARNING FOR BAYESIAN OPTIMIZATION . In this section , we discuss how to approximate f ( x , τ ) with a generative model based on the metadata Dmeta and how to use this model to infer predictions for BO on a new task , given test-data Dn . We use a neural network gθ ( x , z ) to approximate the unknown function f ( x , τ ) . Next to the function inputs x , the network depends on trainable meta-parameters θ shared between all tasks , and an encoding z ∈ Z ⊆ Rd of the task-specific parameters τ . We refer to the latter as task embeddings in the following , since they represent unknown task parameters τ . In addition to being used as additional inputs to the network g , the latent parameter space Z can also include task-dependent network parameters , e.g. , weights of the output layer . Since we do not know τ and p ( T ) , we can not match z to τ directly . Instead , we assume a fixed and known prior distribution p ( Z ) to turn gθ into a generative network . Without loss of generality , we focus on a Gaussian prior p ( Z ) = N ( 0 , I ) in the following . The resulting approximative generative model is shown on the right in Fig . 2 . Meta training The goal of meta-learning is to select appropriate global parameters θ so that for each task τ ∈ T there exists a corresponding latent encoding z ∈ Z with f ( x , τ ) = gθ ( x , z ) . Since we have no information about τ , we train a separate task embedding zt for each task τt by optimizing them jointly with the parameters θ . We can view the resulting model as a variational autoencoder , where we directly optimize over the outputs zt of the encoder , without committing to a specific parametric form . We can optimize the model ’ s predictive performance on the meta-data by maximizing the log-likelihood L ( xn , t , yn , t ; θ , zt ) = log p ( yn , t | gθ ( xn , t , zt ) ) of the parameters and observations for each of the T meta-tasks together with the corresponding task embedding : max θ , z1 , ... , zT T∑ t=1 1 Nt ∑ ( x , y ) ∈Dmetat L ( x , y ; θ , zt ) − λR ( { z1 , . . . , zT } || p ( Z ) ) , ( 1 ) where we rescale the likelihood for each meta-task by Nt , the number of data points per task , to account for imbalanced data which skews the loss towards tasks with many evaluations . Without regularization , this model could easily overfit to each task by placing the task embeddings zt in disjoint areas of the domain . In that case , samples from the Gaussian prior p ( Z ) would lead to function samples with low probability-mass under p ( T ) . To avoid this , we introduce a regularization termR scaled by an appropriate constant λ ∈ R > 0 in order to get a more uniform loss approximation over Z . We discuss the specific choice that we use to enable reliable and efficient inference below . Inference Given the meta-trained generative model , we can make predictions about a new task f ( · , τ ) . That is , after n ≥ 0 noisy observations of function values in Dn , we can infer a posterior belief over the task embeddings , p ( z | Dn , θ ) . While this is generally intractable analytically , approximate inference methods are generally reliable enough to make this tractable . For example , we use Hamiltonian Monte Carlo ( HMC ) ( Neal , 2011 ) in our experiments . Given samples from this posterior belief , we obtain a posterior belief over function values f ( x , τ ) from a monte-carlo approximation of p ( gθ ( x ) | Dn , x , θ ) = ∫ gθ ( x , z ) p ( z | Dn , θ ) ∂z = Ez∼p ( z|Dn , θ ) [ gθ ( x , z ) ] . ( 2 ) We can view this posterior inference as a task-specific adaptation of the parameters z in order to match g to f . In contrast to deterministic meta-learning approaches , here the adaptation does not happen directly through an optimization process such as gradient descent , but through approximate Bayesian inference . This enables us to naturally capture uncertainty depending on the amount of data in Dn that we condition on . Regularizing the Latent space We can only expect the inference over the predictive distribution in ( 2 ) to work well if the two generative models in Fig . 2 encode similar distributions over functions ; that is , if f ( x , τ ) with τ ∼ p ( T ) has a similar distribution as gθ ( x , z ) with z ∼ p ( Z ) for all x ∈ X . This generally requires each sample z ∼ p ( Z ) to be associated with a meaningful function gθ ( x , z ) . In this paper , we achieve this through regularizing zt to be close to the prior distribution p ( Z ) and regularizing the network gθ to be smooth . Regularizing p ( Z ) encourages a meaningful prior over functions where each sample has probability mass under p ( T ) , while the regularization of g ensures that samples from the posterior p ( gθ ( x ) | Dn , x , θ ) vary smoothly across Z . To regularize the task embeddings one might be tempted to use the log-likelihood of the prior p ( Z ) . However , Tolstikhin et al . ( 2018 ) show that this can lead to poor inference results , since a Gaussian prior regularizes ‖zt‖2 , rather than covering the probability mass of p ( Z ) uniformly . Instead , Ghosh et al . ( 2020 ) propose to use a deterministic regularizer during training and use density estimation to determine the prior p ( Z ) . We propose a novel regularizer that is both deterministic ( does not require stochastic approximations ) and regularizes the empirical distribution of zt to a Gaussian prior p ( Z ) = N ( 0 , I ) in a tractable way . We are inspired by the Kolmogorov-Smirnov test for one-dimensional distributions , which we use to compare the empirical cumulative distribution function ( CDF ) of the elements [ zt ] i in zt with the marginal CDFs over the dimensions of the prior p ( Z ) . We show an example in Fig . 5 in the appendix . The empirical CDF is defined as F ( z , d ) = 1T ∑T t=1 I ( [ zt ] d ≤ z ) , where I ( [ zt ] i ≤ z ) is the indicator function that returns one if the ith component of zt is smaller or equal than z and zero otherwise . In addition to the marginals , we account for correlations by regularizing the empirical covariance matrix Cov ( { z1 , . . . , zT } ) to be close to that of p ( Z ) , which is the identity matrix in our Algorithm 1 Probabilistic Meta-learning for Bayesian Optimization 1 : Given meta-data Dmetat for tasks t = 1 , . . . , T 2 : θ ← meta-train by minimizing loss ( 1 ) on the metadata 3 : New , unknown task τ ∼ P ( τ ) , D1 ← ∅ 4 : for iteration n = 1 , . . . do 5 : Approximate predictive distribution p ( gθ ( x ) | D , x , θ ) in ( 2 ) 6 : xn = argmaxα ( p ( gθ ( x ) | x , θ , Dn ) ) . Optimize BO acquisition function 7 : Dn+1 ← Dn ∪ { ( xn , f ( xn , τ ) + n ) } setting . The resulting regularizer , R ( { z1 , . . . , zT } || p ( Z ) ) = d∑ i=1 ( F ( [ zt ] i ) − Φ ( [ zt ] i ) ) 2︸ ︷︷ ︸ Match marginal CDF of p ( Z ) + λc‖I− Cov ( { z1 , . . . , zT } ) ‖2F︸ ︷︷ ︸ Match second moment of p ( Z ) , ( 3 ) trades off the loss for the empirical , marginal CDF of the task embeddings relative to the one for the second moment through a scaling parameter λc . Unlike the original Kolmogorov-Smirnov test , ( 3 ) uses the average distance between the CDFs at the points zt . We found this to lead to more stable training than the original formulation which uses the maximum over Z . In practice , many different tests for assessing multivariate normality exist ( Korkmax et al. , 2014 ) and could be used instead of ( 3 ) . For example , Marida ’ s test ( Mardia , 1970 ) also considers higher-order moments . However , we found it to be too computationally expensive relative to the cheap O ( dT ( log ( T ) + d ) complexity of ( 3 ) and the latter was sufficient to achieve high performance in our experiments . While the log-likelihood term L in ( 1 ) encourages a good fit for each meta-task and the regularization R in ( 3 ) forces the meta-task embeddings conform with the prior p ( Z ) , we also have to ensure that gθ interpolates between the different task embeddings smoothly in order to obtain meaningful functions gθ ( · , z ) for z ∼ p ( z ) that are not part of the task-embeddings during training . A simple trick to enforce smoothness is to add noise to the embeddings during training , which is equivalent to regularizing the Hessian ∂2gθ ( x , z ) / ∂z∂z for Gaussian likelihoods p ( Webb , 1994 ; Bishop , 1995 ; An , 1996 ) . Bayesian optimization algorithms can directly use the predictive distribution ( 2 ) in the acquisition function α in order to select informative parameters xn . Most acquisition functions only depend on the mean and variance of the predictions or samples from the posterior , all of which can be directly computed from ( 2 ) . The overall algorithm is summarized in Algorithm 1 : We first use the meta-data to minimize the regularized meta-loss in Line 2 . In Line 3 we get a new task τ and start without any test data D1 = ∅ . After that , we proceed iteratively and approximate the predictive distribution , select new parameters to use by maximizing BO ’ s acquisition function , evaluate test-task f ( xn , τ ) , and add the data point to our test data set . Selecting hyperparameters Like most machine learning methods , BaNNER depends on hyperparameters that include the regularization constants λ , λc , parameters of the BO acquisition function α , the amount of noise to add for regularization , training-specific hyperparameters like learning-rates and batch-sizes , and inference-specific hyperparameters such as the length and number of the chains that we sample from . In practice , these have to be selected based on the meta-data only , since we typically can not generate additional meta-training data easily or cheaply . For our experiments , we split the metadata into train and validation sets and select hyperparameters by comparing the average log likelihood of the trained models . For BO tasks , we split each validation task randomly into data points that we condition on in ( 2 ) and points that we use to evaluate the likelihood . To efficiently optimize all these parameters we use BOHB ( Falkner et al. , 2018 ) , a highly parallel framework to optimize hyperparameters . To speed up computation , we use BOHB ’ s multi-fidelity capabilities and scale the number of meta-training iterations and validation tasks used to compute the validation loss with the fidelity . This allows us to quickly find promising regions of the hyperparameter search space and focus the compute resources there .
In the paper, a probabilistic method is proposed for Bayesian optimization transfer learning (or meta-learning). A latent representation is modeled separately for each task. The surrogate used in BO will be approximated by a neural network with its input being the test point and the latent representation of the task. The meta-training procedure optimizes the prediction loss over the neural network weight and the latent representations of the source tasks. Additional regularizer is added to induce smooth latent representations. For a new task, predictions are made on the new data point using the surrogate model g_\theta(x,z) with a fully Bayesian treatment. The p(z|D,\theta) is approximated by Hamiltonian Monte Carlo. In the experiments, the proposed method is compared to random search, GP-BO, and adaptive Bayesian linear regression.
SP:967ddfd5afb989c6446dfba55c51d6815b208f94
Probabilistic Meta-Learning for Bayesian Optimization
Transfer and meta-learning algorithms leverage evaluations on related tasks in order to significantly speed up learning or optimization on a new problem . For applications that depend on uncertainty estimates , e.g. , in Bayesian optimization , recent probabilistic approaches have shown good performance at test time , but either scale poorly with the number of data points or under-perform with little data on the test task . In this paper , we propose a novel approach to probabilistic transfer learning that uses a generative model for the underlying data distribution and simultaneously learns a latent feature distribution to represent unknown task properties . To enable fast and accurate inference at test-time , we introduce a novel meta-loss that structures the latent space to match the prior used for inference . Together , these contributions ensure that our probabilistic model exhibits high sample-efficiency and provides well-calibrated uncertainty estimates . We evaluate the proposed approach and compare its performance to probabilistic models from the literature on a set of Bayesian optimization transfer-learning tasks . 1 INTRODUCTION . Bayesian optimization ( BO ) is arguably one of the most proven and widely used blackbox optimization frameworks for expensive functions ( Shahriari et al. , 2015 ) with applications that include materials design ( Frazier & Wang , 2016 ) , reinforcement learning ( Metzen et al. , 2015 ) , and automated machine learning ( ML ) ( Hutter et al. , 2019 ) . In practical applications , BO is repeatedly used to solve variations of similar tasks . In these cases , the sample efficiency can be further increased by not starting the optimization from scratch , but rather leveraging previous runs to inform and accelerate the latest one . Several approaches to this emerged under the name of transfer-learning ( Weiss et al. , 2016 ) and meta-learning ( Vanschoren , 2018 ) . Compared to early work by Swersky et al . ( 2013 ) ; Golovin et al . ( 2017 ) , recent publications leverage the representative flexibility of neural networks , which allows for more powerful models and impressive results ( Gordon et al. , 2019 ; Rusu et al. , 2019 ; Garnelo et al. , 2018b ; a ; Zintgraf et al. , 2019 ) . Despite these significant advances , only a small subset of algorithms offers the well-calibrated uncertainty estimates on which BO relies to guide its sampling strategy efficiently . Additionally , BO benefits greatly from a meaningful prior over tasks that quickly converges to the true function to provide the highest sample efficiency . Existing work mostly focuses on deterministic models and , for those providing uncertainty estimates , sample-efficiency at test time is often a challenge . Contributions We set out to close this gap and introduce BAyesian optimization with Neural Networks and Embedding Reasoning ( BaNNER ) , a flexible meta-learning method for BO . We go beyond previous work of Perrone et al . ( 2018 ) and introduce a generative regression model explicitly conditioned on a low-dimensional latent representation for the tasks . This allows our model to ( i ) encode a meaningful prior over tasks and ( ii ) remain highly sample-efficient , since each new task only requires inference over a low-dimensional latent representation . To ensure robust training of our model , we introduce a novel loss function to regularize the latent distribution and optimize our model ’ s hyper-parameters using the available meta-data . We evaluate BaNNER on a set of synthetic benchmarks and two meta-learning problems and compare with the state-of-the-art in the literature . 2 PROBLEM STATEMENT AND BACKGROUND . Our goal is to efficiently optimize an unknown function f ( x , τ ) over a domain x ∈ X for some unknown but fixed task parameters τ that are sampled from an unknown distribution τ ∼ p ( T ) . To this end , at each iteration n we can select function parameters xn and observe a noisy function value yn = f ( xn , τ ) + n , with n drawn i.i.d . from some distribution p . While our method can handle arbitrary noise distributions , we assume a Gaussian distribution , i.e . p = N ( 0 , σ2 ) , for the remainder of the paper . We assume that each evaluation of f is expensive either in terms of monetary cost or time , so that we want to minimize the number of evaluations of f during the optimization process . The most data-efficient class of algorithms for this setting are Bayesian optimization ( BO ) algorithms , which use the observations collected up to iteration n , Dn = { xi , yi } n−1i=1 , in order to infer a posterior belief over the function values f ( x , τ ) . To select parameters xn that are informative about the optimum maxx f ( x , τ ) , BO algorithms define an acquisition function α ( · ) that uses the posterior belief to select parameters as xn = argmaxx α ( p ( f ( x , τ ) | Dn ) . While BO algorithms have been studied extensively , their performance crucially depends on the properties of the statistical model used for f . The two key requirements for BO algorithms to be data-efficient are i ) , that the prior belief over f concentrates quickly on the true function f as we observe data in Dn and ii ) , that the posterior uncertainty estimates are calibrated , so that the model always considers the true function f to be statistically plausible . The latter requirement means that the true function f ( · , τ ) must always be contained in the model ’ s confidence intervals with high probability . Since the task parameters τ are unknown , in general this requires a conservative model that works well for all possible tasks τ . We propose to use meta-learning in order to learn an effective prior ( Fig . 1a ) that can quickly adapt to a new task τ ( Fig . 1b ) . We are given data from T previous tasks τt ∼ p ( T ) with Nt observations Dmetat = { ( xn , t , yn , t } Nt n=1 each . We show the resulting generative model on the left in Fig . 2 . Metalearning aims to distill the information in Dmeta into a model gθ by optimizing the meta-parameters θ . At test time , we then keep these parameters fixed and use the learned model gθ to speed up the optimization of the new function f ( · , τ ) . 3 RELATED WORK . There are several approaches to improve the sample efficiency of BO methods based on information from related tasks . We refer to ( Vanschoren , 2018 ) for a broad review of meta-learning in the context of automated machine learning and focus on the most relevant approaches below . One strategy to improve sample-efficiency is to initialize the BO algorithm with high-quality query points . These initial configurations can be either constructed to be complementary ( Feurer et al. , 2014 ; 2015 ; Lindauer & Hutter , 2018 ) or learned based on data set features ( Kim et al. , 2017 ) . An alternative strategy is to transfer knowledge between tasks by adapting the acquisition function . These approaches balance exploration and exploitation by weighting the usefulness of a given x not only on the current task , but also on the related tasks . This trade-off can either be heuristically motivated ( Wistuba et al. , 2015 ; Wistuba et al. , 2018 ) , or learned directly ( Volpp et al. , 2020 ) . All of these approaches change the BO algorithm , but not the underlying probabilistic model . Most related to our work are methods that focus on alternative ways to model the observations . Several methods build a global Gaussian process ( GP ) models across all tasks ( Swersky et al. , 2013 ; Golovin et al. , 2017 ; Marco et al. , 2017 ; Feurer et al. , 2018 ; Law et al. , 2019 ) , which requires approximations due to the cubic scaling of GPs . A method to avoid this scaling is to use a shared neural network to learn specialized features for Bayesian Linear Regression ( BLR ) . The method , dubbed adaptive BLR ( ABLR ) ( Perrone et al. , 2018 ) , learns a new BLR model for each task based on the shared neural network features . This allows ABLR to quickly adapt to new tasks and scale better than GPs , but limits its predictive power for a small number of test data points . We consider ABLR to be the state-of-the-art for our setting and use it as a baseline in our experiments . The problem of adapting a model to a new problem is not unique to BO , but arises in other fields too . Recent progress in transfer learning ( Weiss et al. , 2016 ) and meta-learning ( Vanschoren , 2018 ) is concerned with the adaptation of a ML model from one or multiple related tasks to a new one . This transfer often focuses on data-efficiency , which makes them similar to BO . While Frameworks for general ( probabilistic ) model adaption ( Finn et al. , 2017 ; 2018 ) exist , our contribution relates to a subset of approaches that directly model latent task distributions ( Gordon et al. , 2019 ; Rusu et al. , 2019 ; Garnelo et al. , 2018b ; a ; Zintgraf et al. , 2019 ) . All of them model the relationship between tasks using the task specific variables , latent variables , and a model that adapts to new tasks by using these latent variables ( often as an input ) . Most of these meta-learning algorithms do not consider active learning as an application and focus on deterministic models gθ . In the following , we propose a method to meta-learn a probabilistic prior model that we can use together with approximate inference in order to estimate a posterior distribution for BO . 4 PROBABILISTIC META-LEARNING FOR BAYESIAN OPTIMIZATION . In this section , we discuss how to approximate f ( x , τ ) with a generative model based on the metadata Dmeta and how to use this model to infer predictions for BO on a new task , given test-data Dn . We use a neural network gθ ( x , z ) to approximate the unknown function f ( x , τ ) . Next to the function inputs x , the network depends on trainable meta-parameters θ shared between all tasks , and an encoding z ∈ Z ⊆ Rd of the task-specific parameters τ . We refer to the latter as task embeddings in the following , since they represent unknown task parameters τ . In addition to being used as additional inputs to the network g , the latent parameter space Z can also include task-dependent network parameters , e.g. , weights of the output layer . Since we do not know τ and p ( T ) , we can not match z to τ directly . Instead , we assume a fixed and known prior distribution p ( Z ) to turn gθ into a generative network . Without loss of generality , we focus on a Gaussian prior p ( Z ) = N ( 0 , I ) in the following . The resulting approximative generative model is shown on the right in Fig . 2 . Meta training The goal of meta-learning is to select appropriate global parameters θ so that for each task τ ∈ T there exists a corresponding latent encoding z ∈ Z with f ( x , τ ) = gθ ( x , z ) . Since we have no information about τ , we train a separate task embedding zt for each task τt by optimizing them jointly with the parameters θ . We can view the resulting model as a variational autoencoder , where we directly optimize over the outputs zt of the encoder , without committing to a specific parametric form . We can optimize the model ’ s predictive performance on the meta-data by maximizing the log-likelihood L ( xn , t , yn , t ; θ , zt ) = log p ( yn , t | gθ ( xn , t , zt ) ) of the parameters and observations for each of the T meta-tasks together with the corresponding task embedding : max θ , z1 , ... , zT T∑ t=1 1 Nt ∑ ( x , y ) ∈Dmetat L ( x , y ; θ , zt ) − λR ( { z1 , . . . , zT } || p ( Z ) ) , ( 1 ) where we rescale the likelihood for each meta-task by Nt , the number of data points per task , to account for imbalanced data which skews the loss towards tasks with many evaluations . Without regularization , this model could easily overfit to each task by placing the task embeddings zt in disjoint areas of the domain . In that case , samples from the Gaussian prior p ( Z ) would lead to function samples with low probability-mass under p ( T ) . To avoid this , we introduce a regularization termR scaled by an appropriate constant λ ∈ R > 0 in order to get a more uniform loss approximation over Z . We discuss the specific choice that we use to enable reliable and efficient inference below . Inference Given the meta-trained generative model , we can make predictions about a new task f ( · , τ ) . That is , after n ≥ 0 noisy observations of function values in Dn , we can infer a posterior belief over the task embeddings , p ( z | Dn , θ ) . While this is generally intractable analytically , approximate inference methods are generally reliable enough to make this tractable . For example , we use Hamiltonian Monte Carlo ( HMC ) ( Neal , 2011 ) in our experiments . Given samples from this posterior belief , we obtain a posterior belief over function values f ( x , τ ) from a monte-carlo approximation of p ( gθ ( x ) | Dn , x , θ ) = ∫ gθ ( x , z ) p ( z | Dn , θ ) ∂z = Ez∼p ( z|Dn , θ ) [ gθ ( x , z ) ] . ( 2 ) We can view this posterior inference as a task-specific adaptation of the parameters z in order to match g to f . In contrast to deterministic meta-learning approaches , here the adaptation does not happen directly through an optimization process such as gradient descent , but through approximate Bayesian inference . This enables us to naturally capture uncertainty depending on the amount of data in Dn that we condition on . Regularizing the Latent space We can only expect the inference over the predictive distribution in ( 2 ) to work well if the two generative models in Fig . 2 encode similar distributions over functions ; that is , if f ( x , τ ) with τ ∼ p ( T ) has a similar distribution as gθ ( x , z ) with z ∼ p ( Z ) for all x ∈ X . This generally requires each sample z ∼ p ( Z ) to be associated with a meaningful function gθ ( x , z ) . In this paper , we achieve this through regularizing zt to be close to the prior distribution p ( Z ) and regularizing the network gθ to be smooth . Regularizing p ( Z ) encourages a meaningful prior over functions where each sample has probability mass under p ( T ) , while the regularization of g ensures that samples from the posterior p ( gθ ( x ) | Dn , x , θ ) vary smoothly across Z . To regularize the task embeddings one might be tempted to use the log-likelihood of the prior p ( Z ) . However , Tolstikhin et al . ( 2018 ) show that this can lead to poor inference results , since a Gaussian prior regularizes ‖zt‖2 , rather than covering the probability mass of p ( Z ) uniformly . Instead , Ghosh et al . ( 2020 ) propose to use a deterministic regularizer during training and use density estimation to determine the prior p ( Z ) . We propose a novel regularizer that is both deterministic ( does not require stochastic approximations ) and regularizes the empirical distribution of zt to a Gaussian prior p ( Z ) = N ( 0 , I ) in a tractable way . We are inspired by the Kolmogorov-Smirnov test for one-dimensional distributions , which we use to compare the empirical cumulative distribution function ( CDF ) of the elements [ zt ] i in zt with the marginal CDFs over the dimensions of the prior p ( Z ) . We show an example in Fig . 5 in the appendix . The empirical CDF is defined as F ( z , d ) = 1T ∑T t=1 I ( [ zt ] d ≤ z ) , where I ( [ zt ] i ≤ z ) is the indicator function that returns one if the ith component of zt is smaller or equal than z and zero otherwise . In addition to the marginals , we account for correlations by regularizing the empirical covariance matrix Cov ( { z1 , . . . , zT } ) to be close to that of p ( Z ) , which is the identity matrix in our Algorithm 1 Probabilistic Meta-learning for Bayesian Optimization 1 : Given meta-data Dmetat for tasks t = 1 , . . . , T 2 : θ ← meta-train by minimizing loss ( 1 ) on the metadata 3 : New , unknown task τ ∼ P ( τ ) , D1 ← ∅ 4 : for iteration n = 1 , . . . do 5 : Approximate predictive distribution p ( gθ ( x ) | D , x , θ ) in ( 2 ) 6 : xn = argmaxα ( p ( gθ ( x ) | x , θ , Dn ) ) . Optimize BO acquisition function 7 : Dn+1 ← Dn ∪ { ( xn , f ( xn , τ ) + n ) } setting . The resulting regularizer , R ( { z1 , . . . , zT } || p ( Z ) ) = d∑ i=1 ( F ( [ zt ] i ) − Φ ( [ zt ] i ) ) 2︸ ︷︷ ︸ Match marginal CDF of p ( Z ) + λc‖I− Cov ( { z1 , . . . , zT } ) ‖2F︸ ︷︷ ︸ Match second moment of p ( Z ) , ( 3 ) trades off the loss for the empirical , marginal CDF of the task embeddings relative to the one for the second moment through a scaling parameter λc . Unlike the original Kolmogorov-Smirnov test , ( 3 ) uses the average distance between the CDFs at the points zt . We found this to lead to more stable training than the original formulation which uses the maximum over Z . In practice , many different tests for assessing multivariate normality exist ( Korkmax et al. , 2014 ) and could be used instead of ( 3 ) . For example , Marida ’ s test ( Mardia , 1970 ) also considers higher-order moments . However , we found it to be too computationally expensive relative to the cheap O ( dT ( log ( T ) + d ) complexity of ( 3 ) and the latter was sufficient to achieve high performance in our experiments . While the log-likelihood term L in ( 1 ) encourages a good fit for each meta-task and the regularization R in ( 3 ) forces the meta-task embeddings conform with the prior p ( Z ) , we also have to ensure that gθ interpolates between the different task embeddings smoothly in order to obtain meaningful functions gθ ( · , z ) for z ∼ p ( z ) that are not part of the task-embeddings during training . A simple trick to enforce smoothness is to add noise to the embeddings during training , which is equivalent to regularizing the Hessian ∂2gθ ( x , z ) / ∂z∂z for Gaussian likelihoods p ( Webb , 1994 ; Bishop , 1995 ; An , 1996 ) . Bayesian optimization algorithms can directly use the predictive distribution ( 2 ) in the acquisition function α in order to select informative parameters xn . Most acquisition functions only depend on the mean and variance of the predictions or samples from the posterior , all of which can be directly computed from ( 2 ) . The overall algorithm is summarized in Algorithm 1 : We first use the meta-data to minimize the regularized meta-loss in Line 2 . In Line 3 we get a new task τ and start without any test data D1 = ∅ . After that , we proceed iteratively and approximate the predictive distribution , select new parameters to use by maximizing BO ’ s acquisition function , evaluate test-task f ( xn , τ ) , and add the data point to our test data set . Selecting hyperparameters Like most machine learning methods , BaNNER depends on hyperparameters that include the regularization constants λ , λc , parameters of the BO acquisition function α , the amount of noise to add for regularization , training-specific hyperparameters like learning-rates and batch-sizes , and inference-specific hyperparameters such as the length and number of the chains that we sample from . In practice , these have to be selected based on the meta-data only , since we typically can not generate additional meta-training data easily or cheaply . For our experiments , we split the metadata into train and validation sets and select hyperparameters by comparing the average log likelihood of the trained models . For BO tasks , we split each validation task randomly into data points that we condition on in ( 2 ) and points that we use to evaluate the likelihood . To efficiently optimize all these parameters we use BOHB ( Falkner et al. , 2018 ) , a highly parallel framework to optimize hyperparameters . To speed up computation , we use BOHB ’ s multi-fidelity capabilities and scale the number of meta-training iterations and validation tasks used to compute the validation loss with the fidelity . This allows us to quickly find promising regions of the hyperparameter search space and focus the compute resources there .
The paper proposes BaNNER, a new transfer learning approach to accelerate hyperparameter optimization based on related tasks. This is based on a generative model learning the data and task distributions. A number of experiments against standard BO and random search, as well as against ABLR, the most closely related transfer learning baseline, indicate that the proposed approach tends to find a good hyperparameter configuration more quickly.
SP:967ddfd5afb989c6446dfba55c51d6815b208f94
Probabilistic Meta-Learning for Bayesian Optimization
Transfer and meta-learning algorithms leverage evaluations on related tasks in order to significantly speed up learning or optimization on a new problem . For applications that depend on uncertainty estimates , e.g. , in Bayesian optimization , recent probabilistic approaches have shown good performance at test time , but either scale poorly with the number of data points or under-perform with little data on the test task . In this paper , we propose a novel approach to probabilistic transfer learning that uses a generative model for the underlying data distribution and simultaneously learns a latent feature distribution to represent unknown task properties . To enable fast and accurate inference at test-time , we introduce a novel meta-loss that structures the latent space to match the prior used for inference . Together , these contributions ensure that our probabilistic model exhibits high sample-efficiency and provides well-calibrated uncertainty estimates . We evaluate the proposed approach and compare its performance to probabilistic models from the literature on a set of Bayesian optimization transfer-learning tasks . 1 INTRODUCTION . Bayesian optimization ( BO ) is arguably one of the most proven and widely used blackbox optimization frameworks for expensive functions ( Shahriari et al. , 2015 ) with applications that include materials design ( Frazier & Wang , 2016 ) , reinforcement learning ( Metzen et al. , 2015 ) , and automated machine learning ( ML ) ( Hutter et al. , 2019 ) . In practical applications , BO is repeatedly used to solve variations of similar tasks . In these cases , the sample efficiency can be further increased by not starting the optimization from scratch , but rather leveraging previous runs to inform and accelerate the latest one . Several approaches to this emerged under the name of transfer-learning ( Weiss et al. , 2016 ) and meta-learning ( Vanschoren , 2018 ) . Compared to early work by Swersky et al . ( 2013 ) ; Golovin et al . ( 2017 ) , recent publications leverage the representative flexibility of neural networks , which allows for more powerful models and impressive results ( Gordon et al. , 2019 ; Rusu et al. , 2019 ; Garnelo et al. , 2018b ; a ; Zintgraf et al. , 2019 ) . Despite these significant advances , only a small subset of algorithms offers the well-calibrated uncertainty estimates on which BO relies to guide its sampling strategy efficiently . Additionally , BO benefits greatly from a meaningful prior over tasks that quickly converges to the true function to provide the highest sample efficiency . Existing work mostly focuses on deterministic models and , for those providing uncertainty estimates , sample-efficiency at test time is often a challenge . Contributions We set out to close this gap and introduce BAyesian optimization with Neural Networks and Embedding Reasoning ( BaNNER ) , a flexible meta-learning method for BO . We go beyond previous work of Perrone et al . ( 2018 ) and introduce a generative regression model explicitly conditioned on a low-dimensional latent representation for the tasks . This allows our model to ( i ) encode a meaningful prior over tasks and ( ii ) remain highly sample-efficient , since each new task only requires inference over a low-dimensional latent representation . To ensure robust training of our model , we introduce a novel loss function to regularize the latent distribution and optimize our model ’ s hyper-parameters using the available meta-data . We evaluate BaNNER on a set of synthetic benchmarks and two meta-learning problems and compare with the state-of-the-art in the literature . 2 PROBLEM STATEMENT AND BACKGROUND . Our goal is to efficiently optimize an unknown function f ( x , τ ) over a domain x ∈ X for some unknown but fixed task parameters τ that are sampled from an unknown distribution τ ∼ p ( T ) . To this end , at each iteration n we can select function parameters xn and observe a noisy function value yn = f ( xn , τ ) + n , with n drawn i.i.d . from some distribution p . While our method can handle arbitrary noise distributions , we assume a Gaussian distribution , i.e . p = N ( 0 , σ2 ) , for the remainder of the paper . We assume that each evaluation of f is expensive either in terms of monetary cost or time , so that we want to minimize the number of evaluations of f during the optimization process . The most data-efficient class of algorithms for this setting are Bayesian optimization ( BO ) algorithms , which use the observations collected up to iteration n , Dn = { xi , yi } n−1i=1 , in order to infer a posterior belief over the function values f ( x , τ ) . To select parameters xn that are informative about the optimum maxx f ( x , τ ) , BO algorithms define an acquisition function α ( · ) that uses the posterior belief to select parameters as xn = argmaxx α ( p ( f ( x , τ ) | Dn ) . While BO algorithms have been studied extensively , their performance crucially depends on the properties of the statistical model used for f . The two key requirements for BO algorithms to be data-efficient are i ) , that the prior belief over f concentrates quickly on the true function f as we observe data in Dn and ii ) , that the posterior uncertainty estimates are calibrated , so that the model always considers the true function f to be statistically plausible . The latter requirement means that the true function f ( · , τ ) must always be contained in the model ’ s confidence intervals with high probability . Since the task parameters τ are unknown , in general this requires a conservative model that works well for all possible tasks τ . We propose to use meta-learning in order to learn an effective prior ( Fig . 1a ) that can quickly adapt to a new task τ ( Fig . 1b ) . We are given data from T previous tasks τt ∼ p ( T ) with Nt observations Dmetat = { ( xn , t , yn , t } Nt n=1 each . We show the resulting generative model on the left in Fig . 2 . Metalearning aims to distill the information in Dmeta into a model gθ by optimizing the meta-parameters θ . At test time , we then keep these parameters fixed and use the learned model gθ to speed up the optimization of the new function f ( · , τ ) . 3 RELATED WORK . There are several approaches to improve the sample efficiency of BO methods based on information from related tasks . We refer to ( Vanschoren , 2018 ) for a broad review of meta-learning in the context of automated machine learning and focus on the most relevant approaches below . One strategy to improve sample-efficiency is to initialize the BO algorithm with high-quality query points . These initial configurations can be either constructed to be complementary ( Feurer et al. , 2014 ; 2015 ; Lindauer & Hutter , 2018 ) or learned based on data set features ( Kim et al. , 2017 ) . An alternative strategy is to transfer knowledge between tasks by adapting the acquisition function . These approaches balance exploration and exploitation by weighting the usefulness of a given x not only on the current task , but also on the related tasks . This trade-off can either be heuristically motivated ( Wistuba et al. , 2015 ; Wistuba et al. , 2018 ) , or learned directly ( Volpp et al. , 2020 ) . All of these approaches change the BO algorithm , but not the underlying probabilistic model . Most related to our work are methods that focus on alternative ways to model the observations . Several methods build a global Gaussian process ( GP ) models across all tasks ( Swersky et al. , 2013 ; Golovin et al. , 2017 ; Marco et al. , 2017 ; Feurer et al. , 2018 ; Law et al. , 2019 ) , which requires approximations due to the cubic scaling of GPs . A method to avoid this scaling is to use a shared neural network to learn specialized features for Bayesian Linear Regression ( BLR ) . The method , dubbed adaptive BLR ( ABLR ) ( Perrone et al. , 2018 ) , learns a new BLR model for each task based on the shared neural network features . This allows ABLR to quickly adapt to new tasks and scale better than GPs , but limits its predictive power for a small number of test data points . We consider ABLR to be the state-of-the-art for our setting and use it as a baseline in our experiments . The problem of adapting a model to a new problem is not unique to BO , but arises in other fields too . Recent progress in transfer learning ( Weiss et al. , 2016 ) and meta-learning ( Vanschoren , 2018 ) is concerned with the adaptation of a ML model from one or multiple related tasks to a new one . This transfer often focuses on data-efficiency , which makes them similar to BO . While Frameworks for general ( probabilistic ) model adaption ( Finn et al. , 2017 ; 2018 ) exist , our contribution relates to a subset of approaches that directly model latent task distributions ( Gordon et al. , 2019 ; Rusu et al. , 2019 ; Garnelo et al. , 2018b ; a ; Zintgraf et al. , 2019 ) . All of them model the relationship between tasks using the task specific variables , latent variables , and a model that adapts to new tasks by using these latent variables ( often as an input ) . Most of these meta-learning algorithms do not consider active learning as an application and focus on deterministic models gθ . In the following , we propose a method to meta-learn a probabilistic prior model that we can use together with approximate inference in order to estimate a posterior distribution for BO . 4 PROBABILISTIC META-LEARNING FOR BAYESIAN OPTIMIZATION . In this section , we discuss how to approximate f ( x , τ ) with a generative model based on the metadata Dmeta and how to use this model to infer predictions for BO on a new task , given test-data Dn . We use a neural network gθ ( x , z ) to approximate the unknown function f ( x , τ ) . Next to the function inputs x , the network depends on trainable meta-parameters θ shared between all tasks , and an encoding z ∈ Z ⊆ Rd of the task-specific parameters τ . We refer to the latter as task embeddings in the following , since they represent unknown task parameters τ . In addition to being used as additional inputs to the network g , the latent parameter space Z can also include task-dependent network parameters , e.g. , weights of the output layer . Since we do not know τ and p ( T ) , we can not match z to τ directly . Instead , we assume a fixed and known prior distribution p ( Z ) to turn gθ into a generative network . Without loss of generality , we focus on a Gaussian prior p ( Z ) = N ( 0 , I ) in the following . The resulting approximative generative model is shown on the right in Fig . 2 . Meta training The goal of meta-learning is to select appropriate global parameters θ so that for each task τ ∈ T there exists a corresponding latent encoding z ∈ Z with f ( x , τ ) = gθ ( x , z ) . Since we have no information about τ , we train a separate task embedding zt for each task τt by optimizing them jointly with the parameters θ . We can view the resulting model as a variational autoencoder , where we directly optimize over the outputs zt of the encoder , without committing to a specific parametric form . We can optimize the model ’ s predictive performance on the meta-data by maximizing the log-likelihood L ( xn , t , yn , t ; θ , zt ) = log p ( yn , t | gθ ( xn , t , zt ) ) of the parameters and observations for each of the T meta-tasks together with the corresponding task embedding : max θ , z1 , ... , zT T∑ t=1 1 Nt ∑ ( x , y ) ∈Dmetat L ( x , y ; θ , zt ) − λR ( { z1 , . . . , zT } || p ( Z ) ) , ( 1 ) where we rescale the likelihood for each meta-task by Nt , the number of data points per task , to account for imbalanced data which skews the loss towards tasks with many evaluations . Without regularization , this model could easily overfit to each task by placing the task embeddings zt in disjoint areas of the domain . In that case , samples from the Gaussian prior p ( Z ) would lead to function samples with low probability-mass under p ( T ) . To avoid this , we introduce a regularization termR scaled by an appropriate constant λ ∈ R > 0 in order to get a more uniform loss approximation over Z . We discuss the specific choice that we use to enable reliable and efficient inference below . Inference Given the meta-trained generative model , we can make predictions about a new task f ( · , τ ) . That is , after n ≥ 0 noisy observations of function values in Dn , we can infer a posterior belief over the task embeddings , p ( z | Dn , θ ) . While this is generally intractable analytically , approximate inference methods are generally reliable enough to make this tractable . For example , we use Hamiltonian Monte Carlo ( HMC ) ( Neal , 2011 ) in our experiments . Given samples from this posterior belief , we obtain a posterior belief over function values f ( x , τ ) from a monte-carlo approximation of p ( gθ ( x ) | Dn , x , θ ) = ∫ gθ ( x , z ) p ( z | Dn , θ ) ∂z = Ez∼p ( z|Dn , θ ) [ gθ ( x , z ) ] . ( 2 ) We can view this posterior inference as a task-specific adaptation of the parameters z in order to match g to f . In contrast to deterministic meta-learning approaches , here the adaptation does not happen directly through an optimization process such as gradient descent , but through approximate Bayesian inference . This enables us to naturally capture uncertainty depending on the amount of data in Dn that we condition on . Regularizing the Latent space We can only expect the inference over the predictive distribution in ( 2 ) to work well if the two generative models in Fig . 2 encode similar distributions over functions ; that is , if f ( x , τ ) with τ ∼ p ( T ) has a similar distribution as gθ ( x , z ) with z ∼ p ( Z ) for all x ∈ X . This generally requires each sample z ∼ p ( Z ) to be associated with a meaningful function gθ ( x , z ) . In this paper , we achieve this through regularizing zt to be close to the prior distribution p ( Z ) and regularizing the network gθ to be smooth . Regularizing p ( Z ) encourages a meaningful prior over functions where each sample has probability mass under p ( T ) , while the regularization of g ensures that samples from the posterior p ( gθ ( x ) | Dn , x , θ ) vary smoothly across Z . To regularize the task embeddings one might be tempted to use the log-likelihood of the prior p ( Z ) . However , Tolstikhin et al . ( 2018 ) show that this can lead to poor inference results , since a Gaussian prior regularizes ‖zt‖2 , rather than covering the probability mass of p ( Z ) uniformly . Instead , Ghosh et al . ( 2020 ) propose to use a deterministic regularizer during training and use density estimation to determine the prior p ( Z ) . We propose a novel regularizer that is both deterministic ( does not require stochastic approximations ) and regularizes the empirical distribution of zt to a Gaussian prior p ( Z ) = N ( 0 , I ) in a tractable way . We are inspired by the Kolmogorov-Smirnov test for one-dimensional distributions , which we use to compare the empirical cumulative distribution function ( CDF ) of the elements [ zt ] i in zt with the marginal CDFs over the dimensions of the prior p ( Z ) . We show an example in Fig . 5 in the appendix . The empirical CDF is defined as F ( z , d ) = 1T ∑T t=1 I ( [ zt ] d ≤ z ) , where I ( [ zt ] i ≤ z ) is the indicator function that returns one if the ith component of zt is smaller or equal than z and zero otherwise . In addition to the marginals , we account for correlations by regularizing the empirical covariance matrix Cov ( { z1 , . . . , zT } ) to be close to that of p ( Z ) , which is the identity matrix in our Algorithm 1 Probabilistic Meta-learning for Bayesian Optimization 1 : Given meta-data Dmetat for tasks t = 1 , . . . , T 2 : θ ← meta-train by minimizing loss ( 1 ) on the metadata 3 : New , unknown task τ ∼ P ( τ ) , D1 ← ∅ 4 : for iteration n = 1 , . . . do 5 : Approximate predictive distribution p ( gθ ( x ) | D , x , θ ) in ( 2 ) 6 : xn = argmaxα ( p ( gθ ( x ) | x , θ , Dn ) ) . Optimize BO acquisition function 7 : Dn+1 ← Dn ∪ { ( xn , f ( xn , τ ) + n ) } setting . The resulting regularizer , R ( { z1 , . . . , zT } || p ( Z ) ) = d∑ i=1 ( F ( [ zt ] i ) − Φ ( [ zt ] i ) ) 2︸ ︷︷ ︸ Match marginal CDF of p ( Z ) + λc‖I− Cov ( { z1 , . . . , zT } ) ‖2F︸ ︷︷ ︸ Match second moment of p ( Z ) , ( 3 ) trades off the loss for the empirical , marginal CDF of the task embeddings relative to the one for the second moment through a scaling parameter λc . Unlike the original Kolmogorov-Smirnov test , ( 3 ) uses the average distance between the CDFs at the points zt . We found this to lead to more stable training than the original formulation which uses the maximum over Z . In practice , many different tests for assessing multivariate normality exist ( Korkmax et al. , 2014 ) and could be used instead of ( 3 ) . For example , Marida ’ s test ( Mardia , 1970 ) also considers higher-order moments . However , we found it to be too computationally expensive relative to the cheap O ( dT ( log ( T ) + d ) complexity of ( 3 ) and the latter was sufficient to achieve high performance in our experiments . While the log-likelihood term L in ( 1 ) encourages a good fit for each meta-task and the regularization R in ( 3 ) forces the meta-task embeddings conform with the prior p ( Z ) , we also have to ensure that gθ interpolates between the different task embeddings smoothly in order to obtain meaningful functions gθ ( · , z ) for z ∼ p ( z ) that are not part of the task-embeddings during training . A simple trick to enforce smoothness is to add noise to the embeddings during training , which is equivalent to regularizing the Hessian ∂2gθ ( x , z ) / ∂z∂z for Gaussian likelihoods p ( Webb , 1994 ; Bishop , 1995 ; An , 1996 ) . Bayesian optimization algorithms can directly use the predictive distribution ( 2 ) in the acquisition function α in order to select informative parameters xn . Most acquisition functions only depend on the mean and variance of the predictions or samples from the posterior , all of which can be directly computed from ( 2 ) . The overall algorithm is summarized in Algorithm 1 : We first use the meta-data to minimize the regularized meta-loss in Line 2 . In Line 3 we get a new task τ and start without any test data D1 = ∅ . After that , we proceed iteratively and approximate the predictive distribution , select new parameters to use by maximizing BO ’ s acquisition function , evaluate test-task f ( xn , τ ) , and add the data point to our test data set . Selecting hyperparameters Like most machine learning methods , BaNNER depends on hyperparameters that include the regularization constants λ , λc , parameters of the BO acquisition function α , the amount of noise to add for regularization , training-specific hyperparameters like learning-rates and batch-sizes , and inference-specific hyperparameters such as the length and number of the chains that we sample from . In practice , these have to be selected based on the meta-data only , since we typically can not generate additional meta-training data easily or cheaply . For our experiments , we split the metadata into train and validation sets and select hyperparameters by comparing the average log likelihood of the trained models . For BO tasks , we split each validation task randomly into data points that we condition on in ( 2 ) and points that we use to evaluate the likelihood . To efficiently optimize all these parameters we use BOHB ( Falkner et al. , 2018 ) , a highly parallel framework to optimize hyperparameters . To speed up computation , we use BOHB ’ s multi-fidelity capabilities and scale the number of meta-training iterations and validation tasks used to compute the validation loss with the fidelity . This allows us to quickly find promising regions of the hyperparameter search space and focus the compute resources there .
In this paper, the authors introduce a technique for multitask Bayesian optimization based on meta learning. In general, there are two broad approaches to multi task learning in Bayesian optimization: sharing information between tasks by modelling the correlation between tasks (e.g., Swersky et al 2013), and sharing information between tasks via global weight sharing across over some embedding (e.g., Perrone et al., 2018). This paper falls in to the latter approach, learning a meta learning style task embedding (eqn. 1) to be able to make predictions over a new task given auxiliary task data (eqn. 2).
SP:967ddfd5afb989c6446dfba55c51d6815b208f94
Forward Prediction for Physical Reasoning
1 INTRODUCTION . When presented with a picture of a Rube Goldberg machine , we can predict how the machine works . We do so by using our intuitive understanding of concepts such as force , mass , energy , collisions , etc. , to imagine how the machine state would evolve once released . This ability allows us to solve real world physical-reasoning tasks , such as how to hit a billiards cue such that the ball ends up in the pocket , or how to balance the weight of two children on a see-saw . In contrast , physical-reasoning abilities of machine-learning models have largely been limited to closed domains such as predicting dynamics of multi-body gravitational systems ( Battaglia et al. , 2016 ) , stability of block towers ( Lerer et al. , 2016 ) , or physical plausibility of observed dynamics ( Riochet et al. , 2018 ) . In this work , we explore the use of imaginative , forward-prediction approaches to solve complex physical-reasoning puzzles . We study modern object-based ( Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2020 ; Watters et al. , 2017 ) and pixel-based ( Finn et al. , 2016 ; Ye et al. , 2019 ; Hafner et al. , 2020 ) forward-prediction models in simple search-based agents on the PHYRE benchmark ( Bakhtin et al. , 2019 ) . PHYRE tasks involve placing one or two balls in a 2D world , such that the world reaches a state with a particular property ( e.g. , two balls are touching ) after being played forward . PHYRE tasks are very challenging because small changes in the action ( or the world ) can have a very large effect on the efficacy of an action ; see Figure 1 for an example . Moreover , PHYRE tests models ’ ability to generalize to completely new physical environments at test time , a significantly harder task than prior work that mostly varies number or properties of objects in the same environment . As a result , physical-reasoning agents may struggle even when their forward-prediction model works well . Nevertheless , our best agents substantially outperform the prior state-of-the-art on PHYRE . Specifically , we find that forward-prediction models can improve the performance of physical-reasoning agents when the models are trained on tasks that are very similar to the tasks that need to be solved at test time . However , we find forward-prediction based agents struggle to generalize to truly unseen tasks , presumably , because small deviations in forward predictions tend to compound over time . We also observe that better forward prediction does not always lead to better physical-reasoning performance on PHYRE ( c.f . Buesing et al . ( 2018 ) for similar observations in RL ) . In particular , we find that object-based forward-prediction models make more accurate forward predictions but pixel-based models are more helpful in physical reasoning . This observation may be the result of two key advantages of models using pixel-based state representations . First , it is easier to determine whether a task is solved in a pixel-based representation than in an object-based one , in fully observable 2D environments like PHYRE . Second , pixel-based models facilitate end-to-end training of the forward-prediction model and the task-solution model in a way that object-based models do not in the absence of a differentiable renderer ( Liu et al. , 2019 ; Loper & Black , 2014 ) . 2 RELATED WORK . Our study builds on a large body of prior research on forward prediction and physical reasoning . We discuss most closely related work in this section and report additional prior work in Appendix B . Forward prediction models attempt to predict the future state of objects in the world based on observations of past states . Such models operate either on object-based ( proprioceptive ) representations or on pixel-based state representations . A popular class of object-based models use graph neural networks to model interactions between objects ( Kipf et al. , 2018 ; Battaglia et al. , 2016 ) , for example , to simulate environments with thousands of particles ( Sanchez-Gonzalez et al. , 2020 ; Li et al. , 2019 ) . Another class of object-based models explicitly represents the Hamiltonian or Lagrangian of the physical system ( Greydanus et al. , 2019 ; Cranmer et al. , 2020 ; Chen et al. , 2019 ) . While promising , such models are currently limited to simple point objects and physical systems that conserve energy . Hence , they can not currently be used on PHYRE , which contains dissipative forces and extended objects . Modern pixel-based forward-prediction models extract state representations by applying a convolutional network on the observed frame ( s ) ( Watters et al. , 2017 ; Kipf et al. , 2020 ) or on object segments ( Ye et al. , 2019 ; Janner et al. , 2019 ) . The models perform forward prediction on the resulting state representation using graph neural networks ( Kipf et al. , 2020 ; Ye et al. , 2019 ; Li et al. , 2020 ) , recurrent neural networks ( Xingjian et al. , 2015 ; Hochreiter & Schmidhuber , 1997 ; Cho et al. , 2014 ; Finn et al. , 2016 ) , or a physics engine ( Wu et al. , 2017 ) . The models can be trained to predict object state ( Watters et al. , 2017 ) , perform pixel reconstruction ( Villegas et al. , 2017 ; Ye et al. , 2019 ) , transform the previous frames ( Ye et al. , 2018 ; 2019 ; Finn et al. , 2016 ) , or produce a contrastive state representation ( Kipf et al. , 2020 ; Hafner et al. , 2020 ) . Physical reasoning tasks gauge a system ’ s ability to intuitively reason about physical phenomena ( Battaglia et al. , 2013 ; Kubricht et al. , 2017 ) . Prior work has developed models that predict whether physical structures are stable ( Lerer et al. , 2016 ; Groth et al. , 2018 ; Li et al. , 2016 ) , predict whether physical phenomena are plausible ( Riochet et al. , 2018 ) , describe or answer questions about physical systems ( Yi et al. , 2020 ; Rajani et al. , 2020 ) , perform counterfactual prediction in physical worlds ( Baradel et al. , 2020 ) , predict effect of forces ( Mottaghi et al. , 2016 ; Wang et al. , 2018 ) , or solve physical puzzles/games ( Allen et al. , 2020 ; Bakhtin et al. , 2019 ; Du & Narasimhan , 2019 ) . Unlike other physical reasoning tasks , physical-puzzle benchmarks such as PHYRE ( Bakhtin et al. , 2019 ) and Tools ( Allen et al. , 2020 ) incorporate a full physics simulator , and contain a large set of physical environments to study generalization . This makes them particularly suitable for studying the effectiveness of forward prediction for physical reasoning , and we adopt the PHYRE benchmark in our study for that reason . Inferring object representations involve techniques like generative models and attention mechanisms to decompose scenes into objects ( Eslami et al. , 2016 ; Greff et al. , 2019 ; Burgess et al. , 2019 ; Engelcke et al. , 2019 ) . Many techniques also leverage the motion information for better decomposition or to implicitly learn object dynamics ( Kipf et al. , 2020 ; van Steenkiste et al. , 2018 ; Crawford & Pineau , 2020 ; Kosiorek et al. , 2018 ) . While relevant to our exploration of pixel-based methods as well , we leverage the simplicity of PHYRE visual world to extract object-like representations simply using connected component algorithm in our approaches ( c.f . STN in Section 4.1 ) . However , more sophisticated approaches could help further improve the performance , and would be especially useful for more visually complex and 3D environments . 3 PHYRE BENCHMARK . In PHYRE , each task consists of an initial state that is a 256× 256 image . Colors indicate object properties ; for instance , black objects are static while gray objects are dynamic and neither are involved in the goal state . PHYRE defines two task tiers ( B and 2B ) that differ in their action space . An action involves placing one ball ( in the B tier ) or two balls ( in the 2B tier ) in the image . Balls are parameterized by their position and radius , which determine the ball ’ s mass . An action solves the task if the blue or purple object touches the green object ( the goal state ) for a minimum of three seconds when the simulation is rolled out . Figure 1 illustrates the challenging nature of PHYRE tasks : small variations can change incorrect actions ( Figure 1 ( a ) and ( c ) ) into a correct solution ( Figure 1 ( b ) ) . Each tier in PHYRE contains 25 task templates . A task template contains 100 tasks that are structurally similar but that differ in the initial positions of the objects . Performance on PHYRE is measured in two settings . The within-template setting defines a train-test split over tasks , such that training and test tasks can contain different instantiations of the same template . The cross-template setting splits across templates , such that training and test tasks never correspond to the same template . A PHYRE agent can make multiple attempts at solving a task . The performance of the agent is measured by the area under the success curve ( AUCCESS ; ( Bakhtin et al. , 2019 ) ) , which ranges from 0 to 100 and is higher when the agent needs fewer attempts to solve a task . Performance is averaged over 10 random splits of tasks or templates . In addition to AUCCESS , we also measure a forward-prediction accuracy ( FPA ) that does not consider whether an action solves a task . We define FPA as the percentage of pixels that match the ground-truth in a 10-second rollout at 1 frame per second ( fps ) ; we only consider pixels that correspond to dynamic objects when computing forward-prediction accuracy . Please refer to Appendix E for exact implementation details . 4 METHODS . We develop physical-reasoning agents for PHYRE that use learned forward-prediction models in a search strategy to find actions that solve a task . The search strategy maximizes the score of a task-solution model that , given a world state , predicts whether that state will lead to a task solution . Figure 2 illustrates how our forward-prediction and task-solution models are combined . We describe both types of models , as well as the search strategy we use , separately below . 4.1 FORWARD-PREDICTION MODELS . At time t , a forward-prediction model F aims to predict the next state , x̂t+1 , of a physical system based on a series of τ past states of that system . F consists of a state encoder e , a forward-dynamics model f , and a state decoder d. The past states { xt−τ , . . . , xt } are first encoded into latent representations { zt−τ , . . . , zt } using a learned encoder e with parameters θe , i.e. , zt = e ( xt ; θe ) . The latent representations are then passed into the forward-dynamics model f with parameters θf : f ( { xt−τ , . . . , xt } , { zt−τ , . . . , zt } ; θf ) → ẑt+1 . Finally , the predicted future latent representation is decoded using the decoder d with parameters θd : d ( ẑt+1 ; θd ) → x̂t+1 . We learn the model parameters Θ = ( θe , θf , θd ) on a large training set of observations of the system ’ s dynamics . We experiment with forward-prediction models that use either object-based or pixel-based state representations . Object-based models . We experiment with two object-based forward-prediction models that capture interactions between objects : interaction networks ( Battaglia et al. , 2016 ) and transformers ( Vaswani et al. , 2017 ) . Both object-based forward-prediction models represent the system ’ s state as a set of tuples that contain object type ( ball , stick , etc . ) , location , size , color , and orientation . The models are trained by minimizing the mean squared error between the predicted and observed state . • Interaction networks ( IN ; Battaglia et al . ( 2016 ) ) maintain a vector representation for each object in the system at time t. Each vector captures information about the object ’ s type , position , and velocity . A relationship is computed for each ordered pair of objects , designating the first object as the sender and the second as the receiver of the relation . The relation is characterized by the concatenation of the two objects ’ feature vectors and a one-hot encoding representing the sender object ’ s attribute of static or dynamic . The dynamics model embeds the relations into “ effects ” per object using a multilayer perceptron ( MLP ) . The effects exerted on an object are summed into a single effect per object . This aggregated effect is concatenated with the object ’ s previous state vector , from a particular temporal offset , along with a placeholder for external effects , e.g. , gravity . The result is passed through another MLP to predict velocity of the object . We use two interaction networks with different temporal offsets ( Watters et al. , 2017 ) , and aggregate the results in an MLP to generate the final velocity prediction . The decoder then sums the object ’ s predicted velocity with the previous position to obtain the new position of the object . • Transformers ( Tx ; Vaswani et al . ( 2017 ) ) also maintain a representation per object : they encode each object ’ s state using a 2-layer MLP . In contrast to IN , the dynamics model f in Tx is a Transformer that uses self-attention layers over the latent representation to predict the future state . We add a sinusoidal temporal position encoding ( Vaswani et al. , 2017 ) of time t to the features of each object . The resulting representation is fed into a Transformer encoder with 6 layers and 8 heads . The output representation is decoded using a MLP and added to the previous state to obtain the future state prediction . Pixel-based models . In contrast to object-based models , pixel-based forward-prediction models do not assume direct access to the attribute values of the objects . Instead , they operate on images depicting the object configuration , and maintain a single , global world state that is extracted by an image encoder . Our image encoder e is a ResNet-18 network ( He et al. , 2016 ) that is clipped at the res4 block . Objects in PHYRE can have seven different colors ; hence , the input of the network consists of seven channels with binary values that indicate object presence , consistent with prior work ( Bakhtin et al. , 2019 ) . The representations extracted from the past τ frames are concatenated before being input into the two models we study . • Spatial transformer networks ( STN ; ( Jaderberg et al. , 2015 ) ) split the input frame into segments by detecting objects ( Ye et al. , 2019 ) , and then encode each object using the encoder e. Specifically , we use a simple connected components algorithm ( Weaver , 1985 ) to split each frame channel into object segments . The dynamics model concatenates the object channels for the τ input frames , and predicts a rotation and translation for each channel corresponding to the last frame using a small convolutional network . The decoder applies the predicted transformation to each channel . The resulting channels are combined into a single frame prediction by summing them . Inspired by modern keypoint localizers ( He et al. , 2017 ) , we train STNs by minimizing the spatial crossentropy , which sums the cross-entropies of H×W softmax predictions over all seven channels . • Deconvolutional networks ( Dec ) directly predict the pixels in the next frame using a deconvolutional network that does not rely on a segmentation of the input frame ( s ) . The representations for the last τ frames are concatenated along the channel dimension , and passed through a small convolutional network to generate a latent representation for the t+ 1th frame . Latent represen- tation ẑt+1 is then decoded to pixels using a deconvolutional network , implemented as series of five transposed-convolution and ( bilinear ) upsampling layers , with intermediate ReLU activation functions . We found Decs are best trained by minimizing the per-pixel cross-entropy , which sums the cross-entropy of seven-way softmax predictions at each pixel .
This paper investigates the performance of several state-of-the-art forward-prediction models in the complex physical-reasoning tasks of the PHYRE benchmark. The authors have provided thorough evaluations of the models by ablating on different ways of representing the state (object-based or pixel-based), forms of model class (Interaction network, Transformers, Spatial transformer networks, etc.), and specific evaluations settings (within-template or cross-template), from which they made several interesting observations. For example, forward predictors with better pixel accuracy do not necessarily lead to better physical-reasoning performance. Their best-performing model also sets a new state-of-the-art on the PHYRE benchmark.
SP:0fbc071cfafc8162c5a47c06af4234df08b388f8
Forward Prediction for Physical Reasoning
1 INTRODUCTION . When presented with a picture of a Rube Goldberg machine , we can predict how the machine works . We do so by using our intuitive understanding of concepts such as force , mass , energy , collisions , etc. , to imagine how the machine state would evolve once released . This ability allows us to solve real world physical-reasoning tasks , such as how to hit a billiards cue such that the ball ends up in the pocket , or how to balance the weight of two children on a see-saw . In contrast , physical-reasoning abilities of machine-learning models have largely been limited to closed domains such as predicting dynamics of multi-body gravitational systems ( Battaglia et al. , 2016 ) , stability of block towers ( Lerer et al. , 2016 ) , or physical plausibility of observed dynamics ( Riochet et al. , 2018 ) . In this work , we explore the use of imaginative , forward-prediction approaches to solve complex physical-reasoning puzzles . We study modern object-based ( Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2020 ; Watters et al. , 2017 ) and pixel-based ( Finn et al. , 2016 ; Ye et al. , 2019 ; Hafner et al. , 2020 ) forward-prediction models in simple search-based agents on the PHYRE benchmark ( Bakhtin et al. , 2019 ) . PHYRE tasks involve placing one or two balls in a 2D world , such that the world reaches a state with a particular property ( e.g. , two balls are touching ) after being played forward . PHYRE tasks are very challenging because small changes in the action ( or the world ) can have a very large effect on the efficacy of an action ; see Figure 1 for an example . Moreover , PHYRE tests models ’ ability to generalize to completely new physical environments at test time , a significantly harder task than prior work that mostly varies number or properties of objects in the same environment . As a result , physical-reasoning agents may struggle even when their forward-prediction model works well . Nevertheless , our best agents substantially outperform the prior state-of-the-art on PHYRE . Specifically , we find that forward-prediction models can improve the performance of physical-reasoning agents when the models are trained on tasks that are very similar to the tasks that need to be solved at test time . However , we find forward-prediction based agents struggle to generalize to truly unseen tasks , presumably , because small deviations in forward predictions tend to compound over time . We also observe that better forward prediction does not always lead to better physical-reasoning performance on PHYRE ( c.f . Buesing et al . ( 2018 ) for similar observations in RL ) . In particular , we find that object-based forward-prediction models make more accurate forward predictions but pixel-based models are more helpful in physical reasoning . This observation may be the result of two key advantages of models using pixel-based state representations . First , it is easier to determine whether a task is solved in a pixel-based representation than in an object-based one , in fully observable 2D environments like PHYRE . Second , pixel-based models facilitate end-to-end training of the forward-prediction model and the task-solution model in a way that object-based models do not in the absence of a differentiable renderer ( Liu et al. , 2019 ; Loper & Black , 2014 ) . 2 RELATED WORK . Our study builds on a large body of prior research on forward prediction and physical reasoning . We discuss most closely related work in this section and report additional prior work in Appendix B . Forward prediction models attempt to predict the future state of objects in the world based on observations of past states . Such models operate either on object-based ( proprioceptive ) representations or on pixel-based state representations . A popular class of object-based models use graph neural networks to model interactions between objects ( Kipf et al. , 2018 ; Battaglia et al. , 2016 ) , for example , to simulate environments with thousands of particles ( Sanchez-Gonzalez et al. , 2020 ; Li et al. , 2019 ) . Another class of object-based models explicitly represents the Hamiltonian or Lagrangian of the physical system ( Greydanus et al. , 2019 ; Cranmer et al. , 2020 ; Chen et al. , 2019 ) . While promising , such models are currently limited to simple point objects and physical systems that conserve energy . Hence , they can not currently be used on PHYRE , which contains dissipative forces and extended objects . Modern pixel-based forward-prediction models extract state representations by applying a convolutional network on the observed frame ( s ) ( Watters et al. , 2017 ; Kipf et al. , 2020 ) or on object segments ( Ye et al. , 2019 ; Janner et al. , 2019 ) . The models perform forward prediction on the resulting state representation using graph neural networks ( Kipf et al. , 2020 ; Ye et al. , 2019 ; Li et al. , 2020 ) , recurrent neural networks ( Xingjian et al. , 2015 ; Hochreiter & Schmidhuber , 1997 ; Cho et al. , 2014 ; Finn et al. , 2016 ) , or a physics engine ( Wu et al. , 2017 ) . The models can be trained to predict object state ( Watters et al. , 2017 ) , perform pixel reconstruction ( Villegas et al. , 2017 ; Ye et al. , 2019 ) , transform the previous frames ( Ye et al. , 2018 ; 2019 ; Finn et al. , 2016 ) , or produce a contrastive state representation ( Kipf et al. , 2020 ; Hafner et al. , 2020 ) . Physical reasoning tasks gauge a system ’ s ability to intuitively reason about physical phenomena ( Battaglia et al. , 2013 ; Kubricht et al. , 2017 ) . Prior work has developed models that predict whether physical structures are stable ( Lerer et al. , 2016 ; Groth et al. , 2018 ; Li et al. , 2016 ) , predict whether physical phenomena are plausible ( Riochet et al. , 2018 ) , describe or answer questions about physical systems ( Yi et al. , 2020 ; Rajani et al. , 2020 ) , perform counterfactual prediction in physical worlds ( Baradel et al. , 2020 ) , predict effect of forces ( Mottaghi et al. , 2016 ; Wang et al. , 2018 ) , or solve physical puzzles/games ( Allen et al. , 2020 ; Bakhtin et al. , 2019 ; Du & Narasimhan , 2019 ) . Unlike other physical reasoning tasks , physical-puzzle benchmarks such as PHYRE ( Bakhtin et al. , 2019 ) and Tools ( Allen et al. , 2020 ) incorporate a full physics simulator , and contain a large set of physical environments to study generalization . This makes them particularly suitable for studying the effectiveness of forward prediction for physical reasoning , and we adopt the PHYRE benchmark in our study for that reason . Inferring object representations involve techniques like generative models and attention mechanisms to decompose scenes into objects ( Eslami et al. , 2016 ; Greff et al. , 2019 ; Burgess et al. , 2019 ; Engelcke et al. , 2019 ) . Many techniques also leverage the motion information for better decomposition or to implicitly learn object dynamics ( Kipf et al. , 2020 ; van Steenkiste et al. , 2018 ; Crawford & Pineau , 2020 ; Kosiorek et al. , 2018 ) . While relevant to our exploration of pixel-based methods as well , we leverage the simplicity of PHYRE visual world to extract object-like representations simply using connected component algorithm in our approaches ( c.f . STN in Section 4.1 ) . However , more sophisticated approaches could help further improve the performance , and would be especially useful for more visually complex and 3D environments . 3 PHYRE BENCHMARK . In PHYRE , each task consists of an initial state that is a 256× 256 image . Colors indicate object properties ; for instance , black objects are static while gray objects are dynamic and neither are involved in the goal state . PHYRE defines two task tiers ( B and 2B ) that differ in their action space . An action involves placing one ball ( in the B tier ) or two balls ( in the 2B tier ) in the image . Balls are parameterized by their position and radius , which determine the ball ’ s mass . An action solves the task if the blue or purple object touches the green object ( the goal state ) for a minimum of three seconds when the simulation is rolled out . Figure 1 illustrates the challenging nature of PHYRE tasks : small variations can change incorrect actions ( Figure 1 ( a ) and ( c ) ) into a correct solution ( Figure 1 ( b ) ) . Each tier in PHYRE contains 25 task templates . A task template contains 100 tasks that are structurally similar but that differ in the initial positions of the objects . Performance on PHYRE is measured in two settings . The within-template setting defines a train-test split over tasks , such that training and test tasks can contain different instantiations of the same template . The cross-template setting splits across templates , such that training and test tasks never correspond to the same template . A PHYRE agent can make multiple attempts at solving a task . The performance of the agent is measured by the area under the success curve ( AUCCESS ; ( Bakhtin et al. , 2019 ) ) , which ranges from 0 to 100 and is higher when the agent needs fewer attempts to solve a task . Performance is averaged over 10 random splits of tasks or templates . In addition to AUCCESS , we also measure a forward-prediction accuracy ( FPA ) that does not consider whether an action solves a task . We define FPA as the percentage of pixels that match the ground-truth in a 10-second rollout at 1 frame per second ( fps ) ; we only consider pixels that correspond to dynamic objects when computing forward-prediction accuracy . Please refer to Appendix E for exact implementation details . 4 METHODS . We develop physical-reasoning agents for PHYRE that use learned forward-prediction models in a search strategy to find actions that solve a task . The search strategy maximizes the score of a task-solution model that , given a world state , predicts whether that state will lead to a task solution . Figure 2 illustrates how our forward-prediction and task-solution models are combined . We describe both types of models , as well as the search strategy we use , separately below . 4.1 FORWARD-PREDICTION MODELS . At time t , a forward-prediction model F aims to predict the next state , x̂t+1 , of a physical system based on a series of τ past states of that system . F consists of a state encoder e , a forward-dynamics model f , and a state decoder d. The past states { xt−τ , . . . , xt } are first encoded into latent representations { zt−τ , . . . , zt } using a learned encoder e with parameters θe , i.e. , zt = e ( xt ; θe ) . The latent representations are then passed into the forward-dynamics model f with parameters θf : f ( { xt−τ , . . . , xt } , { zt−τ , . . . , zt } ; θf ) → ẑt+1 . Finally , the predicted future latent representation is decoded using the decoder d with parameters θd : d ( ẑt+1 ; θd ) → x̂t+1 . We learn the model parameters Θ = ( θe , θf , θd ) on a large training set of observations of the system ’ s dynamics . We experiment with forward-prediction models that use either object-based or pixel-based state representations . Object-based models . We experiment with two object-based forward-prediction models that capture interactions between objects : interaction networks ( Battaglia et al. , 2016 ) and transformers ( Vaswani et al. , 2017 ) . Both object-based forward-prediction models represent the system ’ s state as a set of tuples that contain object type ( ball , stick , etc . ) , location , size , color , and orientation . The models are trained by minimizing the mean squared error between the predicted and observed state . • Interaction networks ( IN ; Battaglia et al . ( 2016 ) ) maintain a vector representation for each object in the system at time t. Each vector captures information about the object ’ s type , position , and velocity . A relationship is computed for each ordered pair of objects , designating the first object as the sender and the second as the receiver of the relation . The relation is characterized by the concatenation of the two objects ’ feature vectors and a one-hot encoding representing the sender object ’ s attribute of static or dynamic . The dynamics model embeds the relations into “ effects ” per object using a multilayer perceptron ( MLP ) . The effects exerted on an object are summed into a single effect per object . This aggregated effect is concatenated with the object ’ s previous state vector , from a particular temporal offset , along with a placeholder for external effects , e.g. , gravity . The result is passed through another MLP to predict velocity of the object . We use two interaction networks with different temporal offsets ( Watters et al. , 2017 ) , and aggregate the results in an MLP to generate the final velocity prediction . The decoder then sums the object ’ s predicted velocity with the previous position to obtain the new position of the object . • Transformers ( Tx ; Vaswani et al . ( 2017 ) ) also maintain a representation per object : they encode each object ’ s state using a 2-layer MLP . In contrast to IN , the dynamics model f in Tx is a Transformer that uses self-attention layers over the latent representation to predict the future state . We add a sinusoidal temporal position encoding ( Vaswani et al. , 2017 ) of time t to the features of each object . The resulting representation is fed into a Transformer encoder with 6 layers and 8 heads . The output representation is decoded using a MLP and added to the previous state to obtain the future state prediction . Pixel-based models . In contrast to object-based models , pixel-based forward-prediction models do not assume direct access to the attribute values of the objects . Instead , they operate on images depicting the object configuration , and maintain a single , global world state that is extracted by an image encoder . Our image encoder e is a ResNet-18 network ( He et al. , 2016 ) that is clipped at the res4 block . Objects in PHYRE can have seven different colors ; hence , the input of the network consists of seven channels with binary values that indicate object presence , consistent with prior work ( Bakhtin et al. , 2019 ) . The representations extracted from the past τ frames are concatenated before being input into the two models we study . • Spatial transformer networks ( STN ; ( Jaderberg et al. , 2015 ) ) split the input frame into segments by detecting objects ( Ye et al. , 2019 ) , and then encode each object using the encoder e. Specifically , we use a simple connected components algorithm ( Weaver , 1985 ) to split each frame channel into object segments . The dynamics model concatenates the object channels for the τ input frames , and predicts a rotation and translation for each channel corresponding to the last frame using a small convolutional network . The decoder applies the predicted transformation to each channel . The resulting channels are combined into a single frame prediction by summing them . Inspired by modern keypoint localizers ( He et al. , 2017 ) , we train STNs by minimizing the spatial crossentropy , which sums the cross-entropies of H×W softmax predictions over all seven channels . • Deconvolutional networks ( Dec ) directly predict the pixels in the next frame using a deconvolutional network that does not rely on a segmentation of the input frame ( s ) . The representations for the last τ frames are concatenated along the channel dimension , and passed through a small convolutional network to generate a latent representation for the t+ 1th frame . Latent represen- tation ẑt+1 is then decoded to pixels using a deconvolutional network , implemented as series of five transposed-convolution and ( bilinear ) upsampling layers , with intermediate ReLU activation functions . We found Decs are best trained by minimizing the per-pixel cross-entropy , which sums the cross-entropy of seven-way softmax predictions at each pixel .
This paper discusses the importance of forward prediction in physical reasoning, and particularly in the PHYRE benchmark: a dataset of physical tasks where the agent is asked to place a ball of a chosen radius in a 2d environment. The authors build a classifier that, given an initial state, predicts the probability of success in a given task. `Given the classifier, one can solve PHYRE tasks by sampling actions uniformly at random, and using actions that achieve good scores under the classifier. The classifier consists of an encoder, dynamics model, decoder, and a final classifier. The authors then evaluate two types of dynamics models (interaction nets and transformers) that act on two different types of representations (either images or object states).
SP:0fbc071cfafc8162c5a47c06af4234df08b388f8
Forward Prediction for Physical Reasoning
1 INTRODUCTION . When presented with a picture of a Rube Goldberg machine , we can predict how the machine works . We do so by using our intuitive understanding of concepts such as force , mass , energy , collisions , etc. , to imagine how the machine state would evolve once released . This ability allows us to solve real world physical-reasoning tasks , such as how to hit a billiards cue such that the ball ends up in the pocket , or how to balance the weight of two children on a see-saw . In contrast , physical-reasoning abilities of machine-learning models have largely been limited to closed domains such as predicting dynamics of multi-body gravitational systems ( Battaglia et al. , 2016 ) , stability of block towers ( Lerer et al. , 2016 ) , or physical plausibility of observed dynamics ( Riochet et al. , 2018 ) . In this work , we explore the use of imaginative , forward-prediction approaches to solve complex physical-reasoning puzzles . We study modern object-based ( Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2020 ; Watters et al. , 2017 ) and pixel-based ( Finn et al. , 2016 ; Ye et al. , 2019 ; Hafner et al. , 2020 ) forward-prediction models in simple search-based agents on the PHYRE benchmark ( Bakhtin et al. , 2019 ) . PHYRE tasks involve placing one or two balls in a 2D world , such that the world reaches a state with a particular property ( e.g. , two balls are touching ) after being played forward . PHYRE tasks are very challenging because small changes in the action ( or the world ) can have a very large effect on the efficacy of an action ; see Figure 1 for an example . Moreover , PHYRE tests models ’ ability to generalize to completely new physical environments at test time , a significantly harder task than prior work that mostly varies number or properties of objects in the same environment . As a result , physical-reasoning agents may struggle even when their forward-prediction model works well . Nevertheless , our best agents substantially outperform the prior state-of-the-art on PHYRE . Specifically , we find that forward-prediction models can improve the performance of physical-reasoning agents when the models are trained on tasks that are very similar to the tasks that need to be solved at test time . However , we find forward-prediction based agents struggle to generalize to truly unseen tasks , presumably , because small deviations in forward predictions tend to compound over time . We also observe that better forward prediction does not always lead to better physical-reasoning performance on PHYRE ( c.f . Buesing et al . ( 2018 ) for similar observations in RL ) . In particular , we find that object-based forward-prediction models make more accurate forward predictions but pixel-based models are more helpful in physical reasoning . This observation may be the result of two key advantages of models using pixel-based state representations . First , it is easier to determine whether a task is solved in a pixel-based representation than in an object-based one , in fully observable 2D environments like PHYRE . Second , pixel-based models facilitate end-to-end training of the forward-prediction model and the task-solution model in a way that object-based models do not in the absence of a differentiable renderer ( Liu et al. , 2019 ; Loper & Black , 2014 ) . 2 RELATED WORK . Our study builds on a large body of prior research on forward prediction and physical reasoning . We discuss most closely related work in this section and report additional prior work in Appendix B . Forward prediction models attempt to predict the future state of objects in the world based on observations of past states . Such models operate either on object-based ( proprioceptive ) representations or on pixel-based state representations . A popular class of object-based models use graph neural networks to model interactions between objects ( Kipf et al. , 2018 ; Battaglia et al. , 2016 ) , for example , to simulate environments with thousands of particles ( Sanchez-Gonzalez et al. , 2020 ; Li et al. , 2019 ) . Another class of object-based models explicitly represents the Hamiltonian or Lagrangian of the physical system ( Greydanus et al. , 2019 ; Cranmer et al. , 2020 ; Chen et al. , 2019 ) . While promising , such models are currently limited to simple point objects and physical systems that conserve energy . Hence , they can not currently be used on PHYRE , which contains dissipative forces and extended objects . Modern pixel-based forward-prediction models extract state representations by applying a convolutional network on the observed frame ( s ) ( Watters et al. , 2017 ; Kipf et al. , 2020 ) or on object segments ( Ye et al. , 2019 ; Janner et al. , 2019 ) . The models perform forward prediction on the resulting state representation using graph neural networks ( Kipf et al. , 2020 ; Ye et al. , 2019 ; Li et al. , 2020 ) , recurrent neural networks ( Xingjian et al. , 2015 ; Hochreiter & Schmidhuber , 1997 ; Cho et al. , 2014 ; Finn et al. , 2016 ) , or a physics engine ( Wu et al. , 2017 ) . The models can be trained to predict object state ( Watters et al. , 2017 ) , perform pixel reconstruction ( Villegas et al. , 2017 ; Ye et al. , 2019 ) , transform the previous frames ( Ye et al. , 2018 ; 2019 ; Finn et al. , 2016 ) , or produce a contrastive state representation ( Kipf et al. , 2020 ; Hafner et al. , 2020 ) . Physical reasoning tasks gauge a system ’ s ability to intuitively reason about physical phenomena ( Battaglia et al. , 2013 ; Kubricht et al. , 2017 ) . Prior work has developed models that predict whether physical structures are stable ( Lerer et al. , 2016 ; Groth et al. , 2018 ; Li et al. , 2016 ) , predict whether physical phenomena are plausible ( Riochet et al. , 2018 ) , describe or answer questions about physical systems ( Yi et al. , 2020 ; Rajani et al. , 2020 ) , perform counterfactual prediction in physical worlds ( Baradel et al. , 2020 ) , predict effect of forces ( Mottaghi et al. , 2016 ; Wang et al. , 2018 ) , or solve physical puzzles/games ( Allen et al. , 2020 ; Bakhtin et al. , 2019 ; Du & Narasimhan , 2019 ) . Unlike other physical reasoning tasks , physical-puzzle benchmarks such as PHYRE ( Bakhtin et al. , 2019 ) and Tools ( Allen et al. , 2020 ) incorporate a full physics simulator , and contain a large set of physical environments to study generalization . This makes them particularly suitable for studying the effectiveness of forward prediction for physical reasoning , and we adopt the PHYRE benchmark in our study for that reason . Inferring object representations involve techniques like generative models and attention mechanisms to decompose scenes into objects ( Eslami et al. , 2016 ; Greff et al. , 2019 ; Burgess et al. , 2019 ; Engelcke et al. , 2019 ) . Many techniques also leverage the motion information for better decomposition or to implicitly learn object dynamics ( Kipf et al. , 2020 ; van Steenkiste et al. , 2018 ; Crawford & Pineau , 2020 ; Kosiorek et al. , 2018 ) . While relevant to our exploration of pixel-based methods as well , we leverage the simplicity of PHYRE visual world to extract object-like representations simply using connected component algorithm in our approaches ( c.f . STN in Section 4.1 ) . However , more sophisticated approaches could help further improve the performance , and would be especially useful for more visually complex and 3D environments . 3 PHYRE BENCHMARK . In PHYRE , each task consists of an initial state that is a 256× 256 image . Colors indicate object properties ; for instance , black objects are static while gray objects are dynamic and neither are involved in the goal state . PHYRE defines two task tiers ( B and 2B ) that differ in their action space . An action involves placing one ball ( in the B tier ) or two balls ( in the 2B tier ) in the image . Balls are parameterized by their position and radius , which determine the ball ’ s mass . An action solves the task if the blue or purple object touches the green object ( the goal state ) for a minimum of three seconds when the simulation is rolled out . Figure 1 illustrates the challenging nature of PHYRE tasks : small variations can change incorrect actions ( Figure 1 ( a ) and ( c ) ) into a correct solution ( Figure 1 ( b ) ) . Each tier in PHYRE contains 25 task templates . A task template contains 100 tasks that are structurally similar but that differ in the initial positions of the objects . Performance on PHYRE is measured in two settings . The within-template setting defines a train-test split over tasks , such that training and test tasks can contain different instantiations of the same template . The cross-template setting splits across templates , such that training and test tasks never correspond to the same template . A PHYRE agent can make multiple attempts at solving a task . The performance of the agent is measured by the area under the success curve ( AUCCESS ; ( Bakhtin et al. , 2019 ) ) , which ranges from 0 to 100 and is higher when the agent needs fewer attempts to solve a task . Performance is averaged over 10 random splits of tasks or templates . In addition to AUCCESS , we also measure a forward-prediction accuracy ( FPA ) that does not consider whether an action solves a task . We define FPA as the percentage of pixels that match the ground-truth in a 10-second rollout at 1 frame per second ( fps ) ; we only consider pixels that correspond to dynamic objects when computing forward-prediction accuracy . Please refer to Appendix E for exact implementation details . 4 METHODS . We develop physical-reasoning agents for PHYRE that use learned forward-prediction models in a search strategy to find actions that solve a task . The search strategy maximizes the score of a task-solution model that , given a world state , predicts whether that state will lead to a task solution . Figure 2 illustrates how our forward-prediction and task-solution models are combined . We describe both types of models , as well as the search strategy we use , separately below . 4.1 FORWARD-PREDICTION MODELS . At time t , a forward-prediction model F aims to predict the next state , x̂t+1 , of a physical system based on a series of τ past states of that system . F consists of a state encoder e , a forward-dynamics model f , and a state decoder d. The past states { xt−τ , . . . , xt } are first encoded into latent representations { zt−τ , . . . , zt } using a learned encoder e with parameters θe , i.e. , zt = e ( xt ; θe ) . The latent representations are then passed into the forward-dynamics model f with parameters θf : f ( { xt−τ , . . . , xt } , { zt−τ , . . . , zt } ; θf ) → ẑt+1 . Finally , the predicted future latent representation is decoded using the decoder d with parameters θd : d ( ẑt+1 ; θd ) → x̂t+1 . We learn the model parameters Θ = ( θe , θf , θd ) on a large training set of observations of the system ’ s dynamics . We experiment with forward-prediction models that use either object-based or pixel-based state representations . Object-based models . We experiment with two object-based forward-prediction models that capture interactions between objects : interaction networks ( Battaglia et al. , 2016 ) and transformers ( Vaswani et al. , 2017 ) . Both object-based forward-prediction models represent the system ’ s state as a set of tuples that contain object type ( ball , stick , etc . ) , location , size , color , and orientation . The models are trained by minimizing the mean squared error between the predicted and observed state . • Interaction networks ( IN ; Battaglia et al . ( 2016 ) ) maintain a vector representation for each object in the system at time t. Each vector captures information about the object ’ s type , position , and velocity . A relationship is computed for each ordered pair of objects , designating the first object as the sender and the second as the receiver of the relation . The relation is characterized by the concatenation of the two objects ’ feature vectors and a one-hot encoding representing the sender object ’ s attribute of static or dynamic . The dynamics model embeds the relations into “ effects ” per object using a multilayer perceptron ( MLP ) . The effects exerted on an object are summed into a single effect per object . This aggregated effect is concatenated with the object ’ s previous state vector , from a particular temporal offset , along with a placeholder for external effects , e.g. , gravity . The result is passed through another MLP to predict velocity of the object . We use two interaction networks with different temporal offsets ( Watters et al. , 2017 ) , and aggregate the results in an MLP to generate the final velocity prediction . The decoder then sums the object ’ s predicted velocity with the previous position to obtain the new position of the object . • Transformers ( Tx ; Vaswani et al . ( 2017 ) ) also maintain a representation per object : they encode each object ’ s state using a 2-layer MLP . In contrast to IN , the dynamics model f in Tx is a Transformer that uses self-attention layers over the latent representation to predict the future state . We add a sinusoidal temporal position encoding ( Vaswani et al. , 2017 ) of time t to the features of each object . The resulting representation is fed into a Transformer encoder with 6 layers and 8 heads . The output representation is decoded using a MLP and added to the previous state to obtain the future state prediction . Pixel-based models . In contrast to object-based models , pixel-based forward-prediction models do not assume direct access to the attribute values of the objects . Instead , they operate on images depicting the object configuration , and maintain a single , global world state that is extracted by an image encoder . Our image encoder e is a ResNet-18 network ( He et al. , 2016 ) that is clipped at the res4 block . Objects in PHYRE can have seven different colors ; hence , the input of the network consists of seven channels with binary values that indicate object presence , consistent with prior work ( Bakhtin et al. , 2019 ) . The representations extracted from the past τ frames are concatenated before being input into the two models we study . • Spatial transformer networks ( STN ; ( Jaderberg et al. , 2015 ) ) split the input frame into segments by detecting objects ( Ye et al. , 2019 ) , and then encode each object using the encoder e. Specifically , we use a simple connected components algorithm ( Weaver , 1985 ) to split each frame channel into object segments . The dynamics model concatenates the object channels for the τ input frames , and predicts a rotation and translation for each channel corresponding to the last frame using a small convolutional network . The decoder applies the predicted transformation to each channel . The resulting channels are combined into a single frame prediction by summing them . Inspired by modern keypoint localizers ( He et al. , 2017 ) , we train STNs by minimizing the spatial crossentropy , which sums the cross-entropies of H×W softmax predictions over all seven channels . • Deconvolutional networks ( Dec ) directly predict the pixels in the next frame using a deconvolutional network that does not rely on a segmentation of the input frame ( s ) . The representations for the last τ frames are concatenated along the channel dimension , and passed through a small convolutional network to generate a latent representation for the t+ 1th frame . Latent represen- tation ẑt+1 is then decoded to pixels using a deconvolutional network , implemented as series of five transposed-convolution and ( bilinear ) upsampling layers , with intermediate ReLU activation functions . We found Decs are best trained by minimizing the per-pixel cross-entropy , which sums the cross-entropy of seven-way softmax predictions at each pixel .
This work investigates how a forward prediction model helps the physical reasoning task. The authors propose two variants of forward prediction model, i.e., object-based and pixel-based. The authors also design a classification model, taking predicted results as inputs, to evaluate the efficiency of the prediction model. Task-related metric, i.e., FPA, is proposed to assess the performance. An interesting conclusion, indicated by the authors, is that an accurate predictor does not necessary help the success of physical reasoning.
SP:0fbc071cfafc8162c5a47c06af4234df08b388f8
Learning to Represent Action Values as a Hypergraph on the Action Vertices
1 INTRODUCTION . Representation learning methods have helped shape recent progress in RL by enabling a capacity for learning good representations of state . This is in spite of the fact that , traditionally , representation learning was less often explored in the RL context . As such , the de facto representation learning techniques which are widely used in RL were developed under other machine learning paradigms ( Bengio et al. , 2013 ) . Nevertheless , RL brings some unique problems to the topic of representation learning , with exciting headway being made in identifying and exploring such topics . Action-value estimation is a critical component of the RL paradigm ( Sutton & Barto , 2018 ) . Hence , how to effectively learn estimators for action value from training samples is one of the major problems studied in RL . We set out to study this problem through the lens of representation learning , focusing particularly on learning representations of action in multi-dimensional discrete action spaces . While action values are conditioned on both state and action and as such good representations of both would be beneficial , there has been comparatively little research on learning action representations . We frame this problem as learning a decomposition of the action-value function that is structured in such a way to leverage the combinatorial structure of multi-dimensional discrete action spaces . This structure is an inductive bias which we incorporate in the form of architectural assumptions . We present this approach as a framework to flexibly build architectures for learning representations of multi-dimensional discrete actions by leveraging various orders of their underlying sub-action combinations . Our architectures can be combined in succession with any other architecture for learning state representations and trained end-to-end using backpropagation , without imposing any change to the RL algorithm . We remark that designing representation learning methods by incorporating some form of structural inductive biases is highly common in deep learning , resulting in highly-publicised architectures such as convolutional , recurrent , and graph networks ( Battaglia et al. , 2018 ) . We first demonstrate the effectiveness of our approach in illustrative , structured prediction problems . Then , we argue for the ubiquity of similar structures and test our approach in standard RL problems . ∗Correspondence to : Arash Tavakoli < a.tavakoli @ imperial.ac.uk > . Our results advocate for the general usefulness of leveraging the combinatorial structure of multidimensional discrete action spaces , especially in problems with larger action spaces . 2 BACKGROUND . 2.1 REINFORCEMENT LEARNING . We consider the RL problem in which the interaction of an agent and the environment is modelled as a Markov decision process ( MDP ) ( S , A , P , R , S0 ) , where S denotes the state space , A the action space , P the state-transition distribution , R the reward distribution , and S0 the initial-state distribution ( Sutton & Barto , 2018 ) . At each step t the agent observes a state st ∈S and produces an action at∈A drawn from its policy π ( . | st ) . The agent then transitions to and observes the next state st+1∈S , drawn from P ( . | st , at ) , and receives a reward rt+1 , drawn from R ( . | st , at , st+1 ) . The standard MDP formulation generally abstracts away the combination of sub-actions that are activated when an action at is chosen . That is , if a problem has an Nv-dimensional action space , each action at maps onto an Nv-tuple ( a1t , a 2 t , . . . , a Nv t ) , where each a i t is a sub-action from the ith sub-action space . Therefore , the action space could have an underlying combinatorial structure where the set of actions is formed as a Cartesian product of the sub-action spaces . To make this explicit , we express the action space as A .= A1 ×A2 × · · · ×ANv , where each Ai is a finite set of sub-actions . Furthermore , we amend our notation for the actions at into at ( in bold ) to reflect that actions are generally combinations of several sub-actions . Within our framework , we refer to each sub-action spaceAi as an action vertex . As such , the cardinality of the set of action vertices is equal to the number of action dimensions Nv . Given a policy π that maps states onto distributions over the actions , the discounted sum of future rewards under π is denoted by the random variable Zπ ( s , a ) = ∑∞ t=0 γ trt+1 , where s0 = s , a0 = a , st+1∼P ( . | st , at ) , rt+1∼R ( . | st , at , st+1 ) , at∼π ( . | st ) , and 0≤ γ≤ 1 is a discount factor . The action-value function is defined as Qπ ( s , a ) = E [ Zπ ( s , a ) ] . Evaluating the action-value function Qπ of a policy π is referred to as a prediction problem . In a control problem the objective is to find an optimal policy π∗ which maximises the action-value function . The thesis of this paper applies to any method for prediction or control provided that they involve estimating an action-value function . A canonical example of such a method for control is Q-learning ( Watkins , 1989 ; Watkins & Dayan , 1992 ) which iteratively improves an estimate Q of the optimal action-value function Q∗ via Q ( st , at ) ← Q ( st , at ) + α ( rt+1 + γmax a′ Q ( st+1 , a ′ ) −Q ( st , at ) ) , ( 1 ) where 0 ≤ α ≤ 1 is a learning rate . The action-value function is typically approximated using a parameterised function Qθ , where θ is a vector of parameters , and trained by minimising a sequence of squared temporal-difference errors δ2t . = ( rt+1 + γmax a′ Qθ ( st+1 , a ′ ) −Qθ ( st , at ) ) 2 ( 2 ) over samples ( st , at , rt+1 , st+1 ) . Deep Q-networks ( DQN ) ( Mnih et al. , 2015 ) combine Q-learning with deep neural networks to achieve human-level performance in Atari 2600 . 2.2 DEFINITION OF HYPERGRAPH . A hypergraph ( Berge , 1989 ) is a generalisation of a graph in which an edge , also known as a hyperedge , can join any number of vertices . Let V = { A1 , A2 , . . . , ANv } be a finite set representing the set of action vertices Ai . A hypergraph on V is a family of subsets or hyperedges H = { E1 , E2 , . . . , ENe } such that Ej 6= ∅ ( j = 1 , 2 , . . . , Ne ) , ( 3 ) ∪N e j=1 Ej = V. ( 4 ) According to Eq . ( 3 ) , each hyperedge Ej is a member of E = P ( V ) \∅ , where P ( V ) , called the powerset of V , is the set of possible subsets on V . The rank r of a hypergraph is defined as the maximum cardinality of any of its hyperedges . We define a c-hyperedge , where c∈ { 1 , 2 , . . . , Nv } , as a hyperedge with cardinality or order c. The number of possible c-hyperedges on V is given by the binomial coefficient ( Nv c ) . We define a c-uniform hypergraph as one with only c-hyperedges . As a special case , a c-complete hypergraph , denoted Kc , is one with all possible c-hyperedges . 3 ACTION HYPERGRAPH NETWORKS FRAMEWORK . We now describe our framework using the example in Fig . 1 . Consider the sample physical system of Fig . 1a with six action vertices ( solid circles ) . A sample hypergraph is depicted for this system with four hyperedges ( dashed shapes ) , featuring a 1-hyperedge , two 2-hyperedges , and a 3-hyperedge . We remark that this set of hyperedges constitutes a hypergraph as there are no empty hyperedges ( Eq . ( 3 ) ) and the union of hyperedges spans the set of action vertices ( Eq . ( 4 ) ) . We wish to enable learning a representation of each hyperedge in an arbitrary hypergraph . To achieve this , we create a parameterised function UEj ( e.g . a neural network ) for each hyperedge Ej which receives a state representation ψ ( s ) as input and returns as many values as the possible combinations of the sub-actions for the action vertices enclosed by its respective hyperedge . In other words , UEj has as many outputs as the cardinality of a Cartesian product of the action vertices in Ej . Each such hyperedge-specific function UEj is a building block of our action hypergraph networks framework . 1 Figure 1b depicts the block corresponding to the 3-hyperedge from the hypergraph of Fig . 1a . We remark that for any action a = ( a1 , a2 , . . . , aN v ) from the action space A , each block has only one output that corresponds to a and , thus , contributes exactly one value as a representation of its respective hyperedge at the given action . This output UEj ( ψ ( s ) , aEj ) is identified by aEj which denotes the combination of sub-actions in a that correspond to the action vertices enclosed by Ej . We can realise an architecture within our framework by composing several such building blocks , one for each hyperedge in a hypergraph of our choosing . Figure 1c shows an instance architecture corresponding to the sample hypergraph of Fig . 1a . The forward view through this architecture is as follows . A shared representation of the input state s is fed into multiple blocks , each of which features a unique hyperedge . Then , a representation vector of size Ne is obtained for each action a , where Ne is the number of hyperedges or blocks . These action-specific representations are then mixed ( on an action-by-action basis ) using a function f ( e.g . a fixed non-parametric function or a neural network ) . The output of this mixing function is our estimator for action value at the stateaction pair ( s , a ) . Concretely , Q ( s , a ) . = f ( UE1 ( ψ ( s ) , aE1 ) , UE2 ( ψ ( s ) , aE2 ) , . . . , UENe ( ψ ( s ) , aENe ) ) . ( 5 ) While only a single output from each block is relevant for an action , the reverse is not the case . That is , an output from a block generally contributes to more than a single action ’ s value estimate . In fact , the lower the cardinality of a hyperedge , the larger the number of actions ’ value estimates to which a block output contributes . This can be thought of as a form of combinatorial generalisation . 1Throughout this paper we assume linear units for the block outputs . However , other activation functions could be more useful depending on the choice of mixing function or the task . Particularly , action value can be estimated for an insufficiently-explored or unexplored action by mixing the action ’ s corresponding representations which have been trained as parts of other actions . Moreover , this structure enables a capacity for learning faster on lower-order hyperedges by receiving more updates and slower on higher-order ones by receiving less updates . This is a desirable intrinsic property as , ideally , we would wish to learn representations that exhaust their capacity for representing action values using lower-order hyperedges before they resort to higher-order ones .
This work focuses on learning action representations for problems involving high-dimensional action spaces. The aim is to build a flexible and general methodology for learning representations of multidimensional actions that can be combined with existing architectures (which mostly focus on learning state representations). The ideas initially suggested in Sharma et al (2017) have been generalized and refined in this work leading to impressive empirical results.
SP:12cb2675bf50cbb33187941a81e0f25af862b756
Learning to Represent Action Values as a Hypergraph on the Action Vertices
1 INTRODUCTION . Representation learning methods have helped shape recent progress in RL by enabling a capacity for learning good representations of state . This is in spite of the fact that , traditionally , representation learning was less often explored in the RL context . As such , the de facto representation learning techniques which are widely used in RL were developed under other machine learning paradigms ( Bengio et al. , 2013 ) . Nevertheless , RL brings some unique problems to the topic of representation learning , with exciting headway being made in identifying and exploring such topics . Action-value estimation is a critical component of the RL paradigm ( Sutton & Barto , 2018 ) . Hence , how to effectively learn estimators for action value from training samples is one of the major problems studied in RL . We set out to study this problem through the lens of representation learning , focusing particularly on learning representations of action in multi-dimensional discrete action spaces . While action values are conditioned on both state and action and as such good representations of both would be beneficial , there has been comparatively little research on learning action representations . We frame this problem as learning a decomposition of the action-value function that is structured in such a way to leverage the combinatorial structure of multi-dimensional discrete action spaces . This structure is an inductive bias which we incorporate in the form of architectural assumptions . We present this approach as a framework to flexibly build architectures for learning representations of multi-dimensional discrete actions by leveraging various orders of their underlying sub-action combinations . Our architectures can be combined in succession with any other architecture for learning state representations and trained end-to-end using backpropagation , without imposing any change to the RL algorithm . We remark that designing representation learning methods by incorporating some form of structural inductive biases is highly common in deep learning , resulting in highly-publicised architectures such as convolutional , recurrent , and graph networks ( Battaglia et al. , 2018 ) . We first demonstrate the effectiveness of our approach in illustrative , structured prediction problems . Then , we argue for the ubiquity of similar structures and test our approach in standard RL problems . ∗Correspondence to : Arash Tavakoli < a.tavakoli @ imperial.ac.uk > . Our results advocate for the general usefulness of leveraging the combinatorial structure of multidimensional discrete action spaces , especially in problems with larger action spaces . 2 BACKGROUND . 2.1 REINFORCEMENT LEARNING . We consider the RL problem in which the interaction of an agent and the environment is modelled as a Markov decision process ( MDP ) ( S , A , P , R , S0 ) , where S denotes the state space , A the action space , P the state-transition distribution , R the reward distribution , and S0 the initial-state distribution ( Sutton & Barto , 2018 ) . At each step t the agent observes a state st ∈S and produces an action at∈A drawn from its policy π ( . | st ) . The agent then transitions to and observes the next state st+1∈S , drawn from P ( . | st , at ) , and receives a reward rt+1 , drawn from R ( . | st , at , st+1 ) . The standard MDP formulation generally abstracts away the combination of sub-actions that are activated when an action at is chosen . That is , if a problem has an Nv-dimensional action space , each action at maps onto an Nv-tuple ( a1t , a 2 t , . . . , a Nv t ) , where each a i t is a sub-action from the ith sub-action space . Therefore , the action space could have an underlying combinatorial structure where the set of actions is formed as a Cartesian product of the sub-action spaces . To make this explicit , we express the action space as A .= A1 ×A2 × · · · ×ANv , where each Ai is a finite set of sub-actions . Furthermore , we amend our notation for the actions at into at ( in bold ) to reflect that actions are generally combinations of several sub-actions . Within our framework , we refer to each sub-action spaceAi as an action vertex . As such , the cardinality of the set of action vertices is equal to the number of action dimensions Nv . Given a policy π that maps states onto distributions over the actions , the discounted sum of future rewards under π is denoted by the random variable Zπ ( s , a ) = ∑∞ t=0 γ trt+1 , where s0 = s , a0 = a , st+1∼P ( . | st , at ) , rt+1∼R ( . | st , at , st+1 ) , at∼π ( . | st ) , and 0≤ γ≤ 1 is a discount factor . The action-value function is defined as Qπ ( s , a ) = E [ Zπ ( s , a ) ] . Evaluating the action-value function Qπ of a policy π is referred to as a prediction problem . In a control problem the objective is to find an optimal policy π∗ which maximises the action-value function . The thesis of this paper applies to any method for prediction or control provided that they involve estimating an action-value function . A canonical example of such a method for control is Q-learning ( Watkins , 1989 ; Watkins & Dayan , 1992 ) which iteratively improves an estimate Q of the optimal action-value function Q∗ via Q ( st , at ) ← Q ( st , at ) + α ( rt+1 + γmax a′ Q ( st+1 , a ′ ) −Q ( st , at ) ) , ( 1 ) where 0 ≤ α ≤ 1 is a learning rate . The action-value function is typically approximated using a parameterised function Qθ , where θ is a vector of parameters , and trained by minimising a sequence of squared temporal-difference errors δ2t . = ( rt+1 + γmax a′ Qθ ( st+1 , a ′ ) −Qθ ( st , at ) ) 2 ( 2 ) over samples ( st , at , rt+1 , st+1 ) . Deep Q-networks ( DQN ) ( Mnih et al. , 2015 ) combine Q-learning with deep neural networks to achieve human-level performance in Atari 2600 . 2.2 DEFINITION OF HYPERGRAPH . A hypergraph ( Berge , 1989 ) is a generalisation of a graph in which an edge , also known as a hyperedge , can join any number of vertices . Let V = { A1 , A2 , . . . , ANv } be a finite set representing the set of action vertices Ai . A hypergraph on V is a family of subsets or hyperedges H = { E1 , E2 , . . . , ENe } such that Ej 6= ∅ ( j = 1 , 2 , . . . , Ne ) , ( 3 ) ∪N e j=1 Ej = V. ( 4 ) According to Eq . ( 3 ) , each hyperedge Ej is a member of E = P ( V ) \∅ , where P ( V ) , called the powerset of V , is the set of possible subsets on V . The rank r of a hypergraph is defined as the maximum cardinality of any of its hyperedges . We define a c-hyperedge , where c∈ { 1 , 2 , . . . , Nv } , as a hyperedge with cardinality or order c. The number of possible c-hyperedges on V is given by the binomial coefficient ( Nv c ) . We define a c-uniform hypergraph as one with only c-hyperedges . As a special case , a c-complete hypergraph , denoted Kc , is one with all possible c-hyperedges . 3 ACTION HYPERGRAPH NETWORKS FRAMEWORK . We now describe our framework using the example in Fig . 1 . Consider the sample physical system of Fig . 1a with six action vertices ( solid circles ) . A sample hypergraph is depicted for this system with four hyperedges ( dashed shapes ) , featuring a 1-hyperedge , two 2-hyperedges , and a 3-hyperedge . We remark that this set of hyperedges constitutes a hypergraph as there are no empty hyperedges ( Eq . ( 3 ) ) and the union of hyperedges spans the set of action vertices ( Eq . ( 4 ) ) . We wish to enable learning a representation of each hyperedge in an arbitrary hypergraph . To achieve this , we create a parameterised function UEj ( e.g . a neural network ) for each hyperedge Ej which receives a state representation ψ ( s ) as input and returns as many values as the possible combinations of the sub-actions for the action vertices enclosed by its respective hyperedge . In other words , UEj has as many outputs as the cardinality of a Cartesian product of the action vertices in Ej . Each such hyperedge-specific function UEj is a building block of our action hypergraph networks framework . 1 Figure 1b depicts the block corresponding to the 3-hyperedge from the hypergraph of Fig . 1a . We remark that for any action a = ( a1 , a2 , . . . , aN v ) from the action space A , each block has only one output that corresponds to a and , thus , contributes exactly one value as a representation of its respective hyperedge at the given action . This output UEj ( ψ ( s ) , aEj ) is identified by aEj which denotes the combination of sub-actions in a that correspond to the action vertices enclosed by Ej . We can realise an architecture within our framework by composing several such building blocks , one for each hyperedge in a hypergraph of our choosing . Figure 1c shows an instance architecture corresponding to the sample hypergraph of Fig . 1a . The forward view through this architecture is as follows . A shared representation of the input state s is fed into multiple blocks , each of which features a unique hyperedge . Then , a representation vector of size Ne is obtained for each action a , where Ne is the number of hyperedges or blocks . These action-specific representations are then mixed ( on an action-by-action basis ) using a function f ( e.g . a fixed non-parametric function or a neural network ) . The output of this mixing function is our estimator for action value at the stateaction pair ( s , a ) . Concretely , Q ( s , a ) . = f ( UE1 ( ψ ( s ) , aE1 ) , UE2 ( ψ ( s ) , aE2 ) , . . . , UENe ( ψ ( s ) , aENe ) ) . ( 5 ) While only a single output from each block is relevant for an action , the reverse is not the case . That is , an output from a block generally contributes to more than a single action ’ s value estimate . In fact , the lower the cardinality of a hyperedge , the larger the number of actions ’ value estimates to which a block output contributes . This can be thought of as a form of combinatorial generalisation . 1Throughout this paper we assume linear units for the block outputs . However , other activation functions could be more useful depending on the choice of mixing function or the task . Particularly , action value can be estimated for an insufficiently-explored or unexplored action by mixing the action ’ s corresponding representations which have been trained as parts of other actions . Moreover , this structure enables a capacity for learning faster on lower-order hyperedges by receiving more updates and slower on higher-order ones by receiving less updates . This is a desirable intrinsic property as , ideally , we would wish to learn representations that exhaust their capacity for representing action values using lower-order hyperedges before they resort to higher-order ones .
The paper considers the problem of representation learning of actions, i.e., learning a decomposition of action-value function in multidimensional action spaces using hypergraphs. The key idea is to represent the actions as a hypergraph and learn a representation for each hyperedge in an arbitrary hypergraph. Consequently, the architecture conduits of a neural network for each hyperedge that are then combined using a mixing function. The choice of mixing function appears to be dependent on the problem -- for instance, it could be an universal mixer such as a neural network or it could be a simple summation. The key impact of this architecture could be in the bandit problem setting with very large action spaces. Empirical results on a few atari games (29) and simulated physical control benchmarks clearly demonstrate the superiority of the approach.
SP:12cb2675bf50cbb33187941a81e0f25af862b756
Learning to Represent Action Values as a Hypergraph on the Action Vertices
1 INTRODUCTION . Representation learning methods have helped shape recent progress in RL by enabling a capacity for learning good representations of state . This is in spite of the fact that , traditionally , representation learning was less often explored in the RL context . As such , the de facto representation learning techniques which are widely used in RL were developed under other machine learning paradigms ( Bengio et al. , 2013 ) . Nevertheless , RL brings some unique problems to the topic of representation learning , with exciting headway being made in identifying and exploring such topics . Action-value estimation is a critical component of the RL paradigm ( Sutton & Barto , 2018 ) . Hence , how to effectively learn estimators for action value from training samples is one of the major problems studied in RL . We set out to study this problem through the lens of representation learning , focusing particularly on learning representations of action in multi-dimensional discrete action spaces . While action values are conditioned on both state and action and as such good representations of both would be beneficial , there has been comparatively little research on learning action representations . We frame this problem as learning a decomposition of the action-value function that is structured in such a way to leverage the combinatorial structure of multi-dimensional discrete action spaces . This structure is an inductive bias which we incorporate in the form of architectural assumptions . We present this approach as a framework to flexibly build architectures for learning representations of multi-dimensional discrete actions by leveraging various orders of their underlying sub-action combinations . Our architectures can be combined in succession with any other architecture for learning state representations and trained end-to-end using backpropagation , without imposing any change to the RL algorithm . We remark that designing representation learning methods by incorporating some form of structural inductive biases is highly common in deep learning , resulting in highly-publicised architectures such as convolutional , recurrent , and graph networks ( Battaglia et al. , 2018 ) . We first demonstrate the effectiveness of our approach in illustrative , structured prediction problems . Then , we argue for the ubiquity of similar structures and test our approach in standard RL problems . ∗Correspondence to : Arash Tavakoli < a.tavakoli @ imperial.ac.uk > . Our results advocate for the general usefulness of leveraging the combinatorial structure of multidimensional discrete action spaces , especially in problems with larger action spaces . 2 BACKGROUND . 2.1 REINFORCEMENT LEARNING . We consider the RL problem in which the interaction of an agent and the environment is modelled as a Markov decision process ( MDP ) ( S , A , P , R , S0 ) , where S denotes the state space , A the action space , P the state-transition distribution , R the reward distribution , and S0 the initial-state distribution ( Sutton & Barto , 2018 ) . At each step t the agent observes a state st ∈S and produces an action at∈A drawn from its policy π ( . | st ) . The agent then transitions to and observes the next state st+1∈S , drawn from P ( . | st , at ) , and receives a reward rt+1 , drawn from R ( . | st , at , st+1 ) . The standard MDP formulation generally abstracts away the combination of sub-actions that are activated when an action at is chosen . That is , if a problem has an Nv-dimensional action space , each action at maps onto an Nv-tuple ( a1t , a 2 t , . . . , a Nv t ) , where each a i t is a sub-action from the ith sub-action space . Therefore , the action space could have an underlying combinatorial structure where the set of actions is formed as a Cartesian product of the sub-action spaces . To make this explicit , we express the action space as A .= A1 ×A2 × · · · ×ANv , where each Ai is a finite set of sub-actions . Furthermore , we amend our notation for the actions at into at ( in bold ) to reflect that actions are generally combinations of several sub-actions . Within our framework , we refer to each sub-action spaceAi as an action vertex . As such , the cardinality of the set of action vertices is equal to the number of action dimensions Nv . Given a policy π that maps states onto distributions over the actions , the discounted sum of future rewards under π is denoted by the random variable Zπ ( s , a ) = ∑∞ t=0 γ trt+1 , where s0 = s , a0 = a , st+1∼P ( . | st , at ) , rt+1∼R ( . | st , at , st+1 ) , at∼π ( . | st ) , and 0≤ γ≤ 1 is a discount factor . The action-value function is defined as Qπ ( s , a ) = E [ Zπ ( s , a ) ] . Evaluating the action-value function Qπ of a policy π is referred to as a prediction problem . In a control problem the objective is to find an optimal policy π∗ which maximises the action-value function . The thesis of this paper applies to any method for prediction or control provided that they involve estimating an action-value function . A canonical example of such a method for control is Q-learning ( Watkins , 1989 ; Watkins & Dayan , 1992 ) which iteratively improves an estimate Q of the optimal action-value function Q∗ via Q ( st , at ) ← Q ( st , at ) + α ( rt+1 + γmax a′ Q ( st+1 , a ′ ) −Q ( st , at ) ) , ( 1 ) where 0 ≤ α ≤ 1 is a learning rate . The action-value function is typically approximated using a parameterised function Qθ , where θ is a vector of parameters , and trained by minimising a sequence of squared temporal-difference errors δ2t . = ( rt+1 + γmax a′ Qθ ( st+1 , a ′ ) −Qθ ( st , at ) ) 2 ( 2 ) over samples ( st , at , rt+1 , st+1 ) . Deep Q-networks ( DQN ) ( Mnih et al. , 2015 ) combine Q-learning with deep neural networks to achieve human-level performance in Atari 2600 . 2.2 DEFINITION OF HYPERGRAPH . A hypergraph ( Berge , 1989 ) is a generalisation of a graph in which an edge , also known as a hyperedge , can join any number of vertices . Let V = { A1 , A2 , . . . , ANv } be a finite set representing the set of action vertices Ai . A hypergraph on V is a family of subsets or hyperedges H = { E1 , E2 , . . . , ENe } such that Ej 6= ∅ ( j = 1 , 2 , . . . , Ne ) , ( 3 ) ∪N e j=1 Ej = V. ( 4 ) According to Eq . ( 3 ) , each hyperedge Ej is a member of E = P ( V ) \∅ , where P ( V ) , called the powerset of V , is the set of possible subsets on V . The rank r of a hypergraph is defined as the maximum cardinality of any of its hyperedges . We define a c-hyperedge , where c∈ { 1 , 2 , . . . , Nv } , as a hyperedge with cardinality or order c. The number of possible c-hyperedges on V is given by the binomial coefficient ( Nv c ) . We define a c-uniform hypergraph as one with only c-hyperedges . As a special case , a c-complete hypergraph , denoted Kc , is one with all possible c-hyperedges . 3 ACTION HYPERGRAPH NETWORKS FRAMEWORK . We now describe our framework using the example in Fig . 1 . Consider the sample physical system of Fig . 1a with six action vertices ( solid circles ) . A sample hypergraph is depicted for this system with four hyperedges ( dashed shapes ) , featuring a 1-hyperedge , two 2-hyperedges , and a 3-hyperedge . We remark that this set of hyperedges constitutes a hypergraph as there are no empty hyperedges ( Eq . ( 3 ) ) and the union of hyperedges spans the set of action vertices ( Eq . ( 4 ) ) . We wish to enable learning a representation of each hyperedge in an arbitrary hypergraph . To achieve this , we create a parameterised function UEj ( e.g . a neural network ) for each hyperedge Ej which receives a state representation ψ ( s ) as input and returns as many values as the possible combinations of the sub-actions for the action vertices enclosed by its respective hyperedge . In other words , UEj has as many outputs as the cardinality of a Cartesian product of the action vertices in Ej . Each such hyperedge-specific function UEj is a building block of our action hypergraph networks framework . 1 Figure 1b depicts the block corresponding to the 3-hyperedge from the hypergraph of Fig . 1a . We remark that for any action a = ( a1 , a2 , . . . , aN v ) from the action space A , each block has only one output that corresponds to a and , thus , contributes exactly one value as a representation of its respective hyperedge at the given action . This output UEj ( ψ ( s ) , aEj ) is identified by aEj which denotes the combination of sub-actions in a that correspond to the action vertices enclosed by Ej . We can realise an architecture within our framework by composing several such building blocks , one for each hyperedge in a hypergraph of our choosing . Figure 1c shows an instance architecture corresponding to the sample hypergraph of Fig . 1a . The forward view through this architecture is as follows . A shared representation of the input state s is fed into multiple blocks , each of which features a unique hyperedge . Then , a representation vector of size Ne is obtained for each action a , where Ne is the number of hyperedges or blocks . These action-specific representations are then mixed ( on an action-by-action basis ) using a function f ( e.g . a fixed non-parametric function or a neural network ) . The output of this mixing function is our estimator for action value at the stateaction pair ( s , a ) . Concretely , Q ( s , a ) . = f ( UE1 ( ψ ( s ) , aE1 ) , UE2 ( ψ ( s ) , aE2 ) , . . . , UENe ( ψ ( s ) , aENe ) ) . ( 5 ) While only a single output from each block is relevant for an action , the reverse is not the case . That is , an output from a block generally contributes to more than a single action ’ s value estimate . In fact , the lower the cardinality of a hyperedge , the larger the number of actions ’ value estimates to which a block output contributes . This can be thought of as a form of combinatorial generalisation . 1Throughout this paper we assume linear units for the block outputs . However , other activation functions could be more useful depending on the choice of mixing function or the task . Particularly , action value can be estimated for an insufficiently-explored or unexplored action by mixing the action ’ s corresponding representations which have been trained as parts of other actions . Moreover , this structure enables a capacity for learning faster on lower-order hyperedges by receiving more updates and slower on higher-order ones by receiving less updates . This is a desirable intrinsic property as , ideally , we would wish to learn representations that exhaust their capacity for representing action values using lower-order hyperedges before they resort to higher-order ones .
This paper incorporates a concept called hypergraph network into reinforcement learning. The idea of hypergraph is to extend edge to hyperedge where a set of vertices can be considered at the same time. This seems natural for scenarios like continuous action control with multi-dimension action space. From experimental results this proposed action hypergraph networks outperform several existing baselines.
SP:12cb2675bf50cbb33187941a81e0f25af862b756
Truly Deterministic Policy Optimization
In this paper , we present a policy gradient method that avoids exploratory noise injection and performs policy search over the deterministic landscape . By avoiding noise injection all sources of estimation variance can be eliminated in systems with deterministic dynamics ( up to the initial state distribution ) . Since deterministic policy regularization is impossible using traditional non-metric measures such as the KL divergence , we derive a Wasserstein-based quadratic model for our purposes . We state conditions on the system model under which it is possible to establish a monotonic policy improvement guarantee , propose a surrogate function for policy gradient estimation , and show that it is possible to compute exact advantage estimates if both the state transition model and the policy are deterministic . Finally , we describe two novel robotic control environments—one with non-local rewards in the frequency domain and the other with a long horizon ( 8000 time-steps ) — for which our policy gradient method ( TDPO ) significantly outperforms existing methods ( PPO , TRPO , DDPG , and TD3 ) . Policy Gradient ( PG ) methods can be broadly characterized by three defining elements : the policy gradient estimator , the regularization measures , and the exploration profile . For gradient estimation , episodic ( Williams , 1992 ) , importance-sampling-based ( Schulman et al. , 2015a ) , and deterministic ( Silver et al. , 2014 ) gradients are some of the most common estimation oracles . As for regularization measures , either an Euclidean distance within the parameter space ( Williams , 1992 ; Silver et al. , 2014 ; Lillicrap et al. , 2015 ) , or dimensionally consistent non-metric measures ( Schulman et al. , 2015a ; Kakade & Langford , 2002 ; Schulman et al. , 2017 ; Kakade , 2002 ; Wu et al. , 2017 ) have been frequently adapted . Common exploration profiles include Gaussian ( Schulman et al. , 2015a ) and stochastic processes ( Lillicrap et al. , 2015 ) . These elements form the basis of many model-free and stochastic policy optimization methods successfully capable of learning high-dimensional policy parameters . Both stochastic and deterministic policy search can be useful in applications . A stochastic policy has the effect of smoothing or filtering the policy landscape , which is desirable for optimization . Searching through stochastic policies has enabled the effective control of challenging environments under a general framework ( Schulman et al. , 2015a ; 2017 ) . The same method could either learn robotic movements or play basic games ( 1 ) with minimal domain-specific knowledge , ( 2 ) regardless of function approximation classes , and ( 3 ) with less human intervention ( ignoring reward engineering and hyper-parameter tuning ) ( Duan et al. , 2016 ) . Using stochasticity for exploration , although it imposes approximations and variance , has provided a robust way to actively search for higher rewards . Despite many successes , there are practical environments which remain challenging for current policy gradient methods . For example , non-local rewards ( e.g. , those defined in the frequency domain ) , long time horizons , and naturally-resonant environments all occur in realistic robotic systems ( Kuo & Golnaraghi , 2002 ; Meirovitch , 1975 ; Preumont & Seto , 2008 ) but can present issues for policy gradient search . To tackle challenging environments such as these , this paper considers policy gradient methods based on deterministic policies and deterministic gradient estimates , which could offer advantages by allowing the estimation of global reward gradients on long horizons without the need to inject noise into the system for exploration . To facilitate a dimensionally consistent and low-variance deterministic policy search , a compatible policy gradient estimator and a metric measure for regularization should be employed . For gradient estimation we focus on Vine estimators ( Schulman et al. , 2015a ) , which can be easily applied to deterministic policies . As a metric measure we use the Wasserstein distance , which can measure meaningful distances between deterministic policy functions that have non- overlapping supports ( in contrast to the Kullback-Liebler ( KL ) divergence and the Total Variation ( TV ) distance ) . The Wasserstein metric has seen substantial recent application in a variety of machine-learning domains , such as the successful stable learning of generative adversarial models ( Arjovsky et al. , 2017 ) . Theoretically , this metric has been studied in the context of Lipschitz-continuous Markov decision processes in reinforcement learning ( Hinderer , 2005 ; Ferns et al. , 2012 ) . Pirotta et al . ( 2015 ) defined a policy gradient method using the Wasserestein distance by relying on Lipschitz continuity assumptions with respect to the policy gradient itself . Furthermore , for Lipschitz-continuous Markov decision processes , Asadi et al . ( 2018 ) and Rachelson & Lagoudakis ( 2010 ) used the Wasserstein distance to derive model-based value-iteration and policy-iteration methods , respectively . On a more practical note , Pacchiano et al . ( 2019 ) utilized Wasserstein regularization for behavior-guided stochastic policy optimization . Moreover , Abdullah et al . ( 2019 ) has proposed another robust stochastic policy gradient formulation . Estimating the Wasserstein distance for general distributions is more complicated than typical KL-divergences ( Villani , 2008 ) . This fact constitutes and emphasizes the contributions of Abdullah et al . ( 2019 ) and Pacchiano et al . ( 2019 ) . However , for our deterministic observation-conditional policies , closed-form computation of Wasserstein distances is possible without any approximation . Existing deterministic policy gradient methods ( e.g. , DDPG and TD3 ) use deterministic policies ( Silver et al. , 2014 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ) , meaning that they learn a deterministic policy function from states to actions . However , such methods still use stochastic search ( i.e. , they add stochastic noise to their deterministic actions to force exploration during policy search ) . In contrast , we will be interested in a method which not only uses deterministic policies , but also uses deterministic search ( i.e. , without constant stochastic noise injection ) . We call this new method truly deterministic policy optimization ( TDPO ) and it may have lower estimation variances and better scalability to long horizons , as we will show in numerical examples . Scalability to long horizons is one of the most challenging aspects for policy gradient methods that use stochastic search . This issue is sometimes referred to as the curse of horizon in reinforcement learning ( Liu et al. , 2018 ) . General worst-case analyses suggests that the sample complexity of reinforcement learning is exponential with respect to the horizon length ( Kakade et al. , 2003 ; Kearns et al. , 2000 ; 2002 ) . Deriving polynomial lower-bounds for the sample complexity of reinforcement learning methods is still an open problem ( Jiang & Agarwal , 2018 ) . Lower-bounding the sample complexity of reinforcement learning for long horizons under different settings and simplifying assumptions has been a topic of theoretical research ( Dann & Brunskill , 2015 ; Wang et al. , 2020 ) . Some recent work has examined the scalability of importance sampling gradient estimators to long horizons in terms of both theoretical and practical estimator variances ( Liu et al. , 2018 ; Kallus & Uehara , 2019 ; 2020 ) . All in all , long horizons are challenging for all reinforcement learning methods , especially the ones suffering from excessive estimation variance due to the use of stochastic policies for exploration , and our truly deterministic method may have advantages in this respect . In this paper we focus on continuous-domain robotic environments with reset capability to previously visited states . The main contributions of this work are : ( 1 ) we introduce a Deterministic Vine ( DeVine ) policy gradient estimator which avoids constant exploratory noise injection ; ( 2 ) we derive a novel deterministically-compatible surrogate function and provide monotonic payoff improvement guarantees ; ( 3 ) we show how to use the DeVine policy gradient estimator with the Wasserstein-based surrogate in a practical algorithm ( TDPO : Truly Deterministic Policy Optimization ) ; ( 4 ) we illustrate the robustness of the TDPO policy search process in robotic control environments with non-local rewards , long horizons , and/or resonant frequencies . 1 BACKGROUND . MDP preliminaries . An infinite-horizon discounted Markov decision process ( MDP ) is specified by ( S , A , P , R , µ , γ ) , where S is the state space , A is the action space , P : S × A → ∆ ( S ) is the transition dynamics , R : S × A → [ 0 , Rmax ] is the reward function , γ ∈ [ 0 , 1 ) is the discount factor , and µ ( s ) is the initial state distribution of interest ( where ∆ ( F ) denotes the set of all probability distributions over F , otherwise known as the Credal set of F ) . The transition dynamics P is defined as an operator which produces a distribution over the state space for the next state s′ ∼ P ( s , a ) . The transition dynamics can be easily generalized to take distributions of states or actions as input ( i.e. , by having P defined as P : ∆ ( S ) ×A → ∆ ( S ) or P : S ×∆ ( A ) → ∆ ( S ) ) . We may abuse the notation and replace δs and δa by s and a , where δs and δa are the deterministic distributions concentrated at the state s and action a , respectively . A policy π : S → ∆ ( A ) specifies a distribution over actions for each state , and induces trajectories from a given starting state s as follows : s1 = s , a1 ∼ π ( s1 ) , r1 = R ( s1 , a1 ) , s2 ∼ P ( s2 , a2 ) , a2 ∼ π ( s2 ) , etc . We will denote trajectories as state-action tuples τ = ( s1 , a1 , s2 , a2 , . . . ) . One can generalize the dynamics ( 1 ) by using a policy instead of an action distribution P ( µs , π ) : = Es∼µs [ Ea∼π ( s ) [ P ( s , a ) ] ] , and ( 2 ) by introducing the t-step transition dynamics recursively as Pt ( µs , π ) : = P ( Pt−1 ( µs , π ) , π ) with P0 ( µs , π ) : = µs , where µs is a distribution over S. The visitation frequency can then be defined as ρπµ : = ( 1− γ ) ∑∞ t=1 γ t−1Pt−1 ( µ , π ) . Table 2 of the appendix summarizes all MDP notation . The value function of π is defined as V π ( s ) : = E [ ∑∞ t=1 γ t−1rt | s1 = s ; π ] . Similarly , one can define Qπ ( s , a ) by conditioning on the first action . The advantage function can then be defined as their difference ( i.e . Aπ ( s , a ) : = Qπ ( s , a ) − V π ( s ) ) . Generally , one can define the advantage/value of one policy with respect to another using Aπ ( s , π′ ) : = E [ Qπ ( s , a ) − V π ( s ) | a ∼ π′ ( ·|s ) ] and Qπ ( s , π′ ) : = E [ Qπ ( s , a ) | a ∼ π′ ( ·|s ) ] . Finally , the payoff of a policy ηπ : = E [ V π ( s ) ; s ∼ µ ] is the average value over the initial states distribution of the MDP . Probabilistic and mathematical notations . Sometimes we refer to ∫ f ( x ) g ( x ) dx integrals as 〈f , g〉x Hilbert space inner products . Assuming that ζ and ν are two probabilistic densities , the Kulback-Liebler ( KL ) divergence is DKL ( ζ|ν ) : = 〈ζ ( x ) , log ( ζ ( x ) ν ( x ) ) 〉x , the Total-Variation ( TV ) distance is TV ( ζ , ν ) = : 12 〈|ζ ( x ) − ν ( x ) | , 1〉x , and the Wasserstein distance is W ( ζ , ν ) = infγ∈Γ ( ζ , ν ) 〈‖x − y‖ , γ ( x , y ) 〉x , y where Γ ( ζ , ν ) is the set of couplings for ζ and ν . We define Lip ( f ( x , y ) ; x ) : = supx ‖∇xf ( x , y ) ‖2 and assume the existence of Lip ( Qπ ( s , a ) ; a ) and ‖Lip ( ∇sQπ ( s , a ) ; a ) ‖2 constants . Under this notation , the Rubinstein-Kantrovich ( RK ) duality states that the |〈ζ ( x ) − ν ( x ) , f ( x ) 〉x| ≤W ( ζ , ν ) · Lip ( f ; x ) bound is tight for all f . For brevity , we may abuse the notation and denote supsW ( π1 ( ·|s ) , π2 ( ·|s ) ) with W ( π1 , π2 ) ( and similarly for other measures ) . For parameterized policies , we define∇πf ( π ) : = ∇θf ( π ) where π is parameterized by the vector θ . Table 1 of the appendix summarizes all these mathematical definitions . Policy gradient preliminaries . The advantage decomposition lemma provides insight into the relationship between payoff improvements and advantages ( Kakade & Langford , 2002 ) . That is , ηπ2 − ηπ1 = 1 1− γ · Es∼ρπ2µ [ A π1 ( s , π2 ) ] . ( 1 ) We will denote the current and the candidate next policy as π1 and π2 , respectively . Taking derivatives of both sides with respect to π2 at π1 yields ∇π2ηπ2 = 1 1− γ [ 〈∇π2ρπ2µ ( · ) , Aπ1 ( · , π1 ) 〉+ 〈ρπ1µ ( · ) , ∇π2Aπ1 ( · , π2 ) 〉 ] . ( 2 ) Since π1 does not have any advantage over itself ( i.e. , Aπ1 ( · , π1 ) = 0 ) , the first term is zero . Thus , the Policy Gradient ( PG ) theorem is derived as ∇π2ηπ2 ∣∣∣ π2=π1 = 1 1− γ · Es∼ρπ1µ [ ∇π2A π1 ( s , π2 ) ] ∣∣∣ π2=π1 . ( 3 ) For policy iteration with function approximation , we assume π2 and π1 to be parameterized by θ2 and θ1 , respectively . One can view the PG theorem as a Taylor expansion of the payoff at θ1 . Conservative Policy Iteration ( CPI ) ( Kakade & Langford , 2002 ) was one of the early dimensionally consistent methods with a surrogate of the form Lπ1 ( π2 ) = ηπ1 + 11−γ · Es∼ρπ1µ [ A π1 ( s , π2 ) ] − C 2 TV 2 ( π1 , π2 ) . The C coefficient guarantees non-decreasing payoffs . However , CPI is limited to linear function approximation classes due to the update rule πnew ← ( 1− α ) πold + απ′ . This lead to the design of the Trust Region Policy Optimization ( TRPO ) ( Schulman et al. , 2015a ) algorithm . TRPO exchanged the bounded squared TV distance with the KL divergence by lower bounding it using the Pinsker inequality . This made TRPO closer to the Natural Policy Gradient algorithm ( Kakade , 2002 ) , and for Gaussian policies the modified terms had similar Taylor expansions within small trust regions . Confined trust regions are a stable way of making large updates and avoiding pessimistic coefficients . For gradient estimates , TRPO used Importance Sampling ( IS ) with a baseline shift : ∇θ2Es∼ρπ1µ [ A π1 ( s , π2 ) ] ∣∣∣ θ2=θ1 = ∇θ2E s∼ρπ1µ a∼π1 ( ·|s ) [ Qπ1 ( s , a ) π2 ( a|s ) π1 ( a|s ) ] ∣∣∣ θ2=θ1 . ( 4 ) While empirical E [ Aπ1 ( s , π2 ) ] and E [ Qπ1 ( s , π2 ) ] estimates yield identical variances in principle , the importance sampling estimator in ( 4 ) imposes larger variances . Later , Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2015b ) proposed utilizing the Generalized Advantage Estimation ( GAE ) method for variance reduction and incorporated first-order smoothing like ADAM ( Kingma & Ba , 2014 ) . GAE employed Temporal-Difference ( TD ) learning ( Bhatnagar et al. , 2009 ) for variance reduction . Although TD-learning was not theoretically guaranteed to converge and could add bias , it improved the estimation accuracy . As an alternative to importance sampling , deterministic policy gradient estimators were also utilized in an actor-critic fashion . Deep Deterministic Policy Gradient ( DDPG ) ( Lillicrap et al. , 2015 ) generalized deterministic gradients by employing Approximate Dynamic Programming ( ADP ) ( Mnih et al. , 2015 ) for variance reduction . Twin Delayed Deterministic Policy Gradient ( TD3 ) ( Fujimoto et al. , 2018 ) improved DDPG ’ s approximation to build an even better policy optimization method . Although both methods used deterministic policies , they still performed stochastic search by adding stochastic noise to the deterministic policies to force exploration . Other lines of stochastic policy optimization were later proposed . Wu et al . ( 2017 ) used a Kroneckerfactored approximation for curvatures . Haarnoja et al . ( 2018 ) proposed a maximum entropy actorcritic method for stochastic policy optimization .
The paper proposes a deterministic policy gradient method using the Wasserstein distance to quantify the difference of deterministic policies. It also introduces a new deterministic estimator for the policy gradient with theoretical justification. The paper uses a similar path as TRPO to first introduce a surrogate objective then replace the complex term by a tractable term for practical performance. The method has been shown to work well under long-horizon and non-local reward environments whereas existing methods struggle to solve.
SP:1676af08ba2395fab80517e4ebc780a221431592
Truly Deterministic Policy Optimization
In this paper , we present a policy gradient method that avoids exploratory noise injection and performs policy search over the deterministic landscape . By avoiding noise injection all sources of estimation variance can be eliminated in systems with deterministic dynamics ( up to the initial state distribution ) . Since deterministic policy regularization is impossible using traditional non-metric measures such as the KL divergence , we derive a Wasserstein-based quadratic model for our purposes . We state conditions on the system model under which it is possible to establish a monotonic policy improvement guarantee , propose a surrogate function for policy gradient estimation , and show that it is possible to compute exact advantage estimates if both the state transition model and the policy are deterministic . Finally , we describe two novel robotic control environments—one with non-local rewards in the frequency domain and the other with a long horizon ( 8000 time-steps ) — for which our policy gradient method ( TDPO ) significantly outperforms existing methods ( PPO , TRPO , DDPG , and TD3 ) . Policy Gradient ( PG ) methods can be broadly characterized by three defining elements : the policy gradient estimator , the regularization measures , and the exploration profile . For gradient estimation , episodic ( Williams , 1992 ) , importance-sampling-based ( Schulman et al. , 2015a ) , and deterministic ( Silver et al. , 2014 ) gradients are some of the most common estimation oracles . As for regularization measures , either an Euclidean distance within the parameter space ( Williams , 1992 ; Silver et al. , 2014 ; Lillicrap et al. , 2015 ) , or dimensionally consistent non-metric measures ( Schulman et al. , 2015a ; Kakade & Langford , 2002 ; Schulman et al. , 2017 ; Kakade , 2002 ; Wu et al. , 2017 ) have been frequently adapted . Common exploration profiles include Gaussian ( Schulman et al. , 2015a ) and stochastic processes ( Lillicrap et al. , 2015 ) . These elements form the basis of many model-free and stochastic policy optimization methods successfully capable of learning high-dimensional policy parameters . Both stochastic and deterministic policy search can be useful in applications . A stochastic policy has the effect of smoothing or filtering the policy landscape , which is desirable for optimization . Searching through stochastic policies has enabled the effective control of challenging environments under a general framework ( Schulman et al. , 2015a ; 2017 ) . The same method could either learn robotic movements or play basic games ( 1 ) with minimal domain-specific knowledge , ( 2 ) regardless of function approximation classes , and ( 3 ) with less human intervention ( ignoring reward engineering and hyper-parameter tuning ) ( Duan et al. , 2016 ) . Using stochasticity for exploration , although it imposes approximations and variance , has provided a robust way to actively search for higher rewards . Despite many successes , there are practical environments which remain challenging for current policy gradient methods . For example , non-local rewards ( e.g. , those defined in the frequency domain ) , long time horizons , and naturally-resonant environments all occur in realistic robotic systems ( Kuo & Golnaraghi , 2002 ; Meirovitch , 1975 ; Preumont & Seto , 2008 ) but can present issues for policy gradient search . To tackle challenging environments such as these , this paper considers policy gradient methods based on deterministic policies and deterministic gradient estimates , which could offer advantages by allowing the estimation of global reward gradients on long horizons without the need to inject noise into the system for exploration . To facilitate a dimensionally consistent and low-variance deterministic policy search , a compatible policy gradient estimator and a metric measure for regularization should be employed . For gradient estimation we focus on Vine estimators ( Schulman et al. , 2015a ) , which can be easily applied to deterministic policies . As a metric measure we use the Wasserstein distance , which can measure meaningful distances between deterministic policy functions that have non- overlapping supports ( in contrast to the Kullback-Liebler ( KL ) divergence and the Total Variation ( TV ) distance ) . The Wasserstein metric has seen substantial recent application in a variety of machine-learning domains , such as the successful stable learning of generative adversarial models ( Arjovsky et al. , 2017 ) . Theoretically , this metric has been studied in the context of Lipschitz-continuous Markov decision processes in reinforcement learning ( Hinderer , 2005 ; Ferns et al. , 2012 ) . Pirotta et al . ( 2015 ) defined a policy gradient method using the Wasserestein distance by relying on Lipschitz continuity assumptions with respect to the policy gradient itself . Furthermore , for Lipschitz-continuous Markov decision processes , Asadi et al . ( 2018 ) and Rachelson & Lagoudakis ( 2010 ) used the Wasserstein distance to derive model-based value-iteration and policy-iteration methods , respectively . On a more practical note , Pacchiano et al . ( 2019 ) utilized Wasserstein regularization for behavior-guided stochastic policy optimization . Moreover , Abdullah et al . ( 2019 ) has proposed another robust stochastic policy gradient formulation . Estimating the Wasserstein distance for general distributions is more complicated than typical KL-divergences ( Villani , 2008 ) . This fact constitutes and emphasizes the contributions of Abdullah et al . ( 2019 ) and Pacchiano et al . ( 2019 ) . However , for our deterministic observation-conditional policies , closed-form computation of Wasserstein distances is possible without any approximation . Existing deterministic policy gradient methods ( e.g. , DDPG and TD3 ) use deterministic policies ( Silver et al. , 2014 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ) , meaning that they learn a deterministic policy function from states to actions . However , such methods still use stochastic search ( i.e. , they add stochastic noise to their deterministic actions to force exploration during policy search ) . In contrast , we will be interested in a method which not only uses deterministic policies , but also uses deterministic search ( i.e. , without constant stochastic noise injection ) . We call this new method truly deterministic policy optimization ( TDPO ) and it may have lower estimation variances and better scalability to long horizons , as we will show in numerical examples . Scalability to long horizons is one of the most challenging aspects for policy gradient methods that use stochastic search . This issue is sometimes referred to as the curse of horizon in reinforcement learning ( Liu et al. , 2018 ) . General worst-case analyses suggests that the sample complexity of reinforcement learning is exponential with respect to the horizon length ( Kakade et al. , 2003 ; Kearns et al. , 2000 ; 2002 ) . Deriving polynomial lower-bounds for the sample complexity of reinforcement learning methods is still an open problem ( Jiang & Agarwal , 2018 ) . Lower-bounding the sample complexity of reinforcement learning for long horizons under different settings and simplifying assumptions has been a topic of theoretical research ( Dann & Brunskill , 2015 ; Wang et al. , 2020 ) . Some recent work has examined the scalability of importance sampling gradient estimators to long horizons in terms of both theoretical and practical estimator variances ( Liu et al. , 2018 ; Kallus & Uehara , 2019 ; 2020 ) . All in all , long horizons are challenging for all reinforcement learning methods , especially the ones suffering from excessive estimation variance due to the use of stochastic policies for exploration , and our truly deterministic method may have advantages in this respect . In this paper we focus on continuous-domain robotic environments with reset capability to previously visited states . The main contributions of this work are : ( 1 ) we introduce a Deterministic Vine ( DeVine ) policy gradient estimator which avoids constant exploratory noise injection ; ( 2 ) we derive a novel deterministically-compatible surrogate function and provide monotonic payoff improvement guarantees ; ( 3 ) we show how to use the DeVine policy gradient estimator with the Wasserstein-based surrogate in a practical algorithm ( TDPO : Truly Deterministic Policy Optimization ) ; ( 4 ) we illustrate the robustness of the TDPO policy search process in robotic control environments with non-local rewards , long horizons , and/or resonant frequencies . 1 BACKGROUND . MDP preliminaries . An infinite-horizon discounted Markov decision process ( MDP ) is specified by ( S , A , P , R , µ , γ ) , where S is the state space , A is the action space , P : S × A → ∆ ( S ) is the transition dynamics , R : S × A → [ 0 , Rmax ] is the reward function , γ ∈ [ 0 , 1 ) is the discount factor , and µ ( s ) is the initial state distribution of interest ( where ∆ ( F ) denotes the set of all probability distributions over F , otherwise known as the Credal set of F ) . The transition dynamics P is defined as an operator which produces a distribution over the state space for the next state s′ ∼ P ( s , a ) . The transition dynamics can be easily generalized to take distributions of states or actions as input ( i.e. , by having P defined as P : ∆ ( S ) ×A → ∆ ( S ) or P : S ×∆ ( A ) → ∆ ( S ) ) . We may abuse the notation and replace δs and δa by s and a , where δs and δa are the deterministic distributions concentrated at the state s and action a , respectively . A policy π : S → ∆ ( A ) specifies a distribution over actions for each state , and induces trajectories from a given starting state s as follows : s1 = s , a1 ∼ π ( s1 ) , r1 = R ( s1 , a1 ) , s2 ∼ P ( s2 , a2 ) , a2 ∼ π ( s2 ) , etc . We will denote trajectories as state-action tuples τ = ( s1 , a1 , s2 , a2 , . . . ) . One can generalize the dynamics ( 1 ) by using a policy instead of an action distribution P ( µs , π ) : = Es∼µs [ Ea∼π ( s ) [ P ( s , a ) ] ] , and ( 2 ) by introducing the t-step transition dynamics recursively as Pt ( µs , π ) : = P ( Pt−1 ( µs , π ) , π ) with P0 ( µs , π ) : = µs , where µs is a distribution over S. The visitation frequency can then be defined as ρπµ : = ( 1− γ ) ∑∞ t=1 γ t−1Pt−1 ( µ , π ) . Table 2 of the appendix summarizes all MDP notation . The value function of π is defined as V π ( s ) : = E [ ∑∞ t=1 γ t−1rt | s1 = s ; π ] . Similarly , one can define Qπ ( s , a ) by conditioning on the first action . The advantage function can then be defined as their difference ( i.e . Aπ ( s , a ) : = Qπ ( s , a ) − V π ( s ) ) . Generally , one can define the advantage/value of one policy with respect to another using Aπ ( s , π′ ) : = E [ Qπ ( s , a ) − V π ( s ) | a ∼ π′ ( ·|s ) ] and Qπ ( s , π′ ) : = E [ Qπ ( s , a ) | a ∼ π′ ( ·|s ) ] . Finally , the payoff of a policy ηπ : = E [ V π ( s ) ; s ∼ µ ] is the average value over the initial states distribution of the MDP . Probabilistic and mathematical notations . Sometimes we refer to ∫ f ( x ) g ( x ) dx integrals as 〈f , g〉x Hilbert space inner products . Assuming that ζ and ν are two probabilistic densities , the Kulback-Liebler ( KL ) divergence is DKL ( ζ|ν ) : = 〈ζ ( x ) , log ( ζ ( x ) ν ( x ) ) 〉x , the Total-Variation ( TV ) distance is TV ( ζ , ν ) = : 12 〈|ζ ( x ) − ν ( x ) | , 1〉x , and the Wasserstein distance is W ( ζ , ν ) = infγ∈Γ ( ζ , ν ) 〈‖x − y‖ , γ ( x , y ) 〉x , y where Γ ( ζ , ν ) is the set of couplings for ζ and ν . We define Lip ( f ( x , y ) ; x ) : = supx ‖∇xf ( x , y ) ‖2 and assume the existence of Lip ( Qπ ( s , a ) ; a ) and ‖Lip ( ∇sQπ ( s , a ) ; a ) ‖2 constants . Under this notation , the Rubinstein-Kantrovich ( RK ) duality states that the |〈ζ ( x ) − ν ( x ) , f ( x ) 〉x| ≤W ( ζ , ν ) · Lip ( f ; x ) bound is tight for all f . For brevity , we may abuse the notation and denote supsW ( π1 ( ·|s ) , π2 ( ·|s ) ) with W ( π1 , π2 ) ( and similarly for other measures ) . For parameterized policies , we define∇πf ( π ) : = ∇θf ( π ) where π is parameterized by the vector θ . Table 1 of the appendix summarizes all these mathematical definitions . Policy gradient preliminaries . The advantage decomposition lemma provides insight into the relationship between payoff improvements and advantages ( Kakade & Langford , 2002 ) . That is , ηπ2 − ηπ1 = 1 1− γ · Es∼ρπ2µ [ A π1 ( s , π2 ) ] . ( 1 ) We will denote the current and the candidate next policy as π1 and π2 , respectively . Taking derivatives of both sides with respect to π2 at π1 yields ∇π2ηπ2 = 1 1− γ [ 〈∇π2ρπ2µ ( · ) , Aπ1 ( · , π1 ) 〉+ 〈ρπ1µ ( · ) , ∇π2Aπ1 ( · , π2 ) 〉 ] . ( 2 ) Since π1 does not have any advantage over itself ( i.e. , Aπ1 ( · , π1 ) = 0 ) , the first term is zero . Thus , the Policy Gradient ( PG ) theorem is derived as ∇π2ηπ2 ∣∣∣ π2=π1 = 1 1− γ · Es∼ρπ1µ [ ∇π2A π1 ( s , π2 ) ] ∣∣∣ π2=π1 . ( 3 ) For policy iteration with function approximation , we assume π2 and π1 to be parameterized by θ2 and θ1 , respectively . One can view the PG theorem as a Taylor expansion of the payoff at θ1 . Conservative Policy Iteration ( CPI ) ( Kakade & Langford , 2002 ) was one of the early dimensionally consistent methods with a surrogate of the form Lπ1 ( π2 ) = ηπ1 + 11−γ · Es∼ρπ1µ [ A π1 ( s , π2 ) ] − C 2 TV 2 ( π1 , π2 ) . The C coefficient guarantees non-decreasing payoffs . However , CPI is limited to linear function approximation classes due to the update rule πnew ← ( 1− α ) πold + απ′ . This lead to the design of the Trust Region Policy Optimization ( TRPO ) ( Schulman et al. , 2015a ) algorithm . TRPO exchanged the bounded squared TV distance with the KL divergence by lower bounding it using the Pinsker inequality . This made TRPO closer to the Natural Policy Gradient algorithm ( Kakade , 2002 ) , and for Gaussian policies the modified terms had similar Taylor expansions within small trust regions . Confined trust regions are a stable way of making large updates and avoiding pessimistic coefficients . For gradient estimates , TRPO used Importance Sampling ( IS ) with a baseline shift : ∇θ2Es∼ρπ1µ [ A π1 ( s , π2 ) ] ∣∣∣ θ2=θ1 = ∇θ2E s∼ρπ1µ a∼π1 ( ·|s ) [ Qπ1 ( s , a ) π2 ( a|s ) π1 ( a|s ) ] ∣∣∣ θ2=θ1 . ( 4 ) While empirical E [ Aπ1 ( s , π2 ) ] and E [ Qπ1 ( s , π2 ) ] estimates yield identical variances in principle , the importance sampling estimator in ( 4 ) imposes larger variances . Later , Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2015b ) proposed utilizing the Generalized Advantage Estimation ( GAE ) method for variance reduction and incorporated first-order smoothing like ADAM ( Kingma & Ba , 2014 ) . GAE employed Temporal-Difference ( TD ) learning ( Bhatnagar et al. , 2009 ) for variance reduction . Although TD-learning was not theoretically guaranteed to converge and could add bias , it improved the estimation accuracy . As an alternative to importance sampling , deterministic policy gradient estimators were also utilized in an actor-critic fashion . Deep Deterministic Policy Gradient ( DDPG ) ( Lillicrap et al. , 2015 ) generalized deterministic gradients by employing Approximate Dynamic Programming ( ADP ) ( Mnih et al. , 2015 ) for variance reduction . Twin Delayed Deterministic Policy Gradient ( TD3 ) ( Fujimoto et al. , 2018 ) improved DDPG ’ s approximation to build an even better policy optimization method . Although both methods used deterministic policies , they still performed stochastic search by adding stochastic noise to the deterministic policies to force exploration . Other lines of stochastic policy optimization were later proposed . Wu et al . ( 2017 ) used a Kroneckerfactored approximation for curvatures . Haarnoja et al . ( 2018 ) proposed a maximum entropy actorcritic method for stochastic policy optimization .
This paper introduces a policy gradient method based on deterministic policies and deterministic gradient estimates. By assuming such a deterministic setting, the authors show that the proposed technique can estimate gradients on long-horizon tasks without the need to inject noise into the system for exploration. The authors propose using a Wasserstein-based model to perform regularization in this particular setting involving deterministic policies. They also establish the conditions under which it is possible to guarantee monotonic policy improvement.
SP:1676af08ba2395fab80517e4ebc780a221431592
Truly Deterministic Policy Optimization
In this paper , we present a policy gradient method that avoids exploratory noise injection and performs policy search over the deterministic landscape . By avoiding noise injection all sources of estimation variance can be eliminated in systems with deterministic dynamics ( up to the initial state distribution ) . Since deterministic policy regularization is impossible using traditional non-metric measures such as the KL divergence , we derive a Wasserstein-based quadratic model for our purposes . We state conditions on the system model under which it is possible to establish a monotonic policy improvement guarantee , propose a surrogate function for policy gradient estimation , and show that it is possible to compute exact advantage estimates if both the state transition model and the policy are deterministic . Finally , we describe two novel robotic control environments—one with non-local rewards in the frequency domain and the other with a long horizon ( 8000 time-steps ) — for which our policy gradient method ( TDPO ) significantly outperforms existing methods ( PPO , TRPO , DDPG , and TD3 ) . Policy Gradient ( PG ) methods can be broadly characterized by three defining elements : the policy gradient estimator , the regularization measures , and the exploration profile . For gradient estimation , episodic ( Williams , 1992 ) , importance-sampling-based ( Schulman et al. , 2015a ) , and deterministic ( Silver et al. , 2014 ) gradients are some of the most common estimation oracles . As for regularization measures , either an Euclidean distance within the parameter space ( Williams , 1992 ; Silver et al. , 2014 ; Lillicrap et al. , 2015 ) , or dimensionally consistent non-metric measures ( Schulman et al. , 2015a ; Kakade & Langford , 2002 ; Schulman et al. , 2017 ; Kakade , 2002 ; Wu et al. , 2017 ) have been frequently adapted . Common exploration profiles include Gaussian ( Schulman et al. , 2015a ) and stochastic processes ( Lillicrap et al. , 2015 ) . These elements form the basis of many model-free and stochastic policy optimization methods successfully capable of learning high-dimensional policy parameters . Both stochastic and deterministic policy search can be useful in applications . A stochastic policy has the effect of smoothing or filtering the policy landscape , which is desirable for optimization . Searching through stochastic policies has enabled the effective control of challenging environments under a general framework ( Schulman et al. , 2015a ; 2017 ) . The same method could either learn robotic movements or play basic games ( 1 ) with minimal domain-specific knowledge , ( 2 ) regardless of function approximation classes , and ( 3 ) with less human intervention ( ignoring reward engineering and hyper-parameter tuning ) ( Duan et al. , 2016 ) . Using stochasticity for exploration , although it imposes approximations and variance , has provided a robust way to actively search for higher rewards . Despite many successes , there are practical environments which remain challenging for current policy gradient methods . For example , non-local rewards ( e.g. , those defined in the frequency domain ) , long time horizons , and naturally-resonant environments all occur in realistic robotic systems ( Kuo & Golnaraghi , 2002 ; Meirovitch , 1975 ; Preumont & Seto , 2008 ) but can present issues for policy gradient search . To tackle challenging environments such as these , this paper considers policy gradient methods based on deterministic policies and deterministic gradient estimates , which could offer advantages by allowing the estimation of global reward gradients on long horizons without the need to inject noise into the system for exploration . To facilitate a dimensionally consistent and low-variance deterministic policy search , a compatible policy gradient estimator and a metric measure for regularization should be employed . For gradient estimation we focus on Vine estimators ( Schulman et al. , 2015a ) , which can be easily applied to deterministic policies . As a metric measure we use the Wasserstein distance , which can measure meaningful distances between deterministic policy functions that have non- overlapping supports ( in contrast to the Kullback-Liebler ( KL ) divergence and the Total Variation ( TV ) distance ) . The Wasserstein metric has seen substantial recent application in a variety of machine-learning domains , such as the successful stable learning of generative adversarial models ( Arjovsky et al. , 2017 ) . Theoretically , this metric has been studied in the context of Lipschitz-continuous Markov decision processes in reinforcement learning ( Hinderer , 2005 ; Ferns et al. , 2012 ) . Pirotta et al . ( 2015 ) defined a policy gradient method using the Wasserestein distance by relying on Lipschitz continuity assumptions with respect to the policy gradient itself . Furthermore , for Lipschitz-continuous Markov decision processes , Asadi et al . ( 2018 ) and Rachelson & Lagoudakis ( 2010 ) used the Wasserstein distance to derive model-based value-iteration and policy-iteration methods , respectively . On a more practical note , Pacchiano et al . ( 2019 ) utilized Wasserstein regularization for behavior-guided stochastic policy optimization . Moreover , Abdullah et al . ( 2019 ) has proposed another robust stochastic policy gradient formulation . Estimating the Wasserstein distance for general distributions is more complicated than typical KL-divergences ( Villani , 2008 ) . This fact constitutes and emphasizes the contributions of Abdullah et al . ( 2019 ) and Pacchiano et al . ( 2019 ) . However , for our deterministic observation-conditional policies , closed-form computation of Wasserstein distances is possible without any approximation . Existing deterministic policy gradient methods ( e.g. , DDPG and TD3 ) use deterministic policies ( Silver et al. , 2014 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ) , meaning that they learn a deterministic policy function from states to actions . However , such methods still use stochastic search ( i.e. , they add stochastic noise to their deterministic actions to force exploration during policy search ) . In contrast , we will be interested in a method which not only uses deterministic policies , but also uses deterministic search ( i.e. , without constant stochastic noise injection ) . We call this new method truly deterministic policy optimization ( TDPO ) and it may have lower estimation variances and better scalability to long horizons , as we will show in numerical examples . Scalability to long horizons is one of the most challenging aspects for policy gradient methods that use stochastic search . This issue is sometimes referred to as the curse of horizon in reinforcement learning ( Liu et al. , 2018 ) . General worst-case analyses suggests that the sample complexity of reinforcement learning is exponential with respect to the horizon length ( Kakade et al. , 2003 ; Kearns et al. , 2000 ; 2002 ) . Deriving polynomial lower-bounds for the sample complexity of reinforcement learning methods is still an open problem ( Jiang & Agarwal , 2018 ) . Lower-bounding the sample complexity of reinforcement learning for long horizons under different settings and simplifying assumptions has been a topic of theoretical research ( Dann & Brunskill , 2015 ; Wang et al. , 2020 ) . Some recent work has examined the scalability of importance sampling gradient estimators to long horizons in terms of both theoretical and practical estimator variances ( Liu et al. , 2018 ; Kallus & Uehara , 2019 ; 2020 ) . All in all , long horizons are challenging for all reinforcement learning methods , especially the ones suffering from excessive estimation variance due to the use of stochastic policies for exploration , and our truly deterministic method may have advantages in this respect . In this paper we focus on continuous-domain robotic environments with reset capability to previously visited states . The main contributions of this work are : ( 1 ) we introduce a Deterministic Vine ( DeVine ) policy gradient estimator which avoids constant exploratory noise injection ; ( 2 ) we derive a novel deterministically-compatible surrogate function and provide monotonic payoff improvement guarantees ; ( 3 ) we show how to use the DeVine policy gradient estimator with the Wasserstein-based surrogate in a practical algorithm ( TDPO : Truly Deterministic Policy Optimization ) ; ( 4 ) we illustrate the robustness of the TDPO policy search process in robotic control environments with non-local rewards , long horizons , and/or resonant frequencies . 1 BACKGROUND . MDP preliminaries . An infinite-horizon discounted Markov decision process ( MDP ) is specified by ( S , A , P , R , µ , γ ) , where S is the state space , A is the action space , P : S × A → ∆ ( S ) is the transition dynamics , R : S × A → [ 0 , Rmax ] is the reward function , γ ∈ [ 0 , 1 ) is the discount factor , and µ ( s ) is the initial state distribution of interest ( where ∆ ( F ) denotes the set of all probability distributions over F , otherwise known as the Credal set of F ) . The transition dynamics P is defined as an operator which produces a distribution over the state space for the next state s′ ∼ P ( s , a ) . The transition dynamics can be easily generalized to take distributions of states or actions as input ( i.e. , by having P defined as P : ∆ ( S ) ×A → ∆ ( S ) or P : S ×∆ ( A ) → ∆ ( S ) ) . We may abuse the notation and replace δs and δa by s and a , where δs and δa are the deterministic distributions concentrated at the state s and action a , respectively . A policy π : S → ∆ ( A ) specifies a distribution over actions for each state , and induces trajectories from a given starting state s as follows : s1 = s , a1 ∼ π ( s1 ) , r1 = R ( s1 , a1 ) , s2 ∼ P ( s2 , a2 ) , a2 ∼ π ( s2 ) , etc . We will denote trajectories as state-action tuples τ = ( s1 , a1 , s2 , a2 , . . . ) . One can generalize the dynamics ( 1 ) by using a policy instead of an action distribution P ( µs , π ) : = Es∼µs [ Ea∼π ( s ) [ P ( s , a ) ] ] , and ( 2 ) by introducing the t-step transition dynamics recursively as Pt ( µs , π ) : = P ( Pt−1 ( µs , π ) , π ) with P0 ( µs , π ) : = µs , where µs is a distribution over S. The visitation frequency can then be defined as ρπµ : = ( 1− γ ) ∑∞ t=1 γ t−1Pt−1 ( µ , π ) . Table 2 of the appendix summarizes all MDP notation . The value function of π is defined as V π ( s ) : = E [ ∑∞ t=1 γ t−1rt | s1 = s ; π ] . Similarly , one can define Qπ ( s , a ) by conditioning on the first action . The advantage function can then be defined as their difference ( i.e . Aπ ( s , a ) : = Qπ ( s , a ) − V π ( s ) ) . Generally , one can define the advantage/value of one policy with respect to another using Aπ ( s , π′ ) : = E [ Qπ ( s , a ) − V π ( s ) | a ∼ π′ ( ·|s ) ] and Qπ ( s , π′ ) : = E [ Qπ ( s , a ) | a ∼ π′ ( ·|s ) ] . Finally , the payoff of a policy ηπ : = E [ V π ( s ) ; s ∼ µ ] is the average value over the initial states distribution of the MDP . Probabilistic and mathematical notations . Sometimes we refer to ∫ f ( x ) g ( x ) dx integrals as 〈f , g〉x Hilbert space inner products . Assuming that ζ and ν are two probabilistic densities , the Kulback-Liebler ( KL ) divergence is DKL ( ζ|ν ) : = 〈ζ ( x ) , log ( ζ ( x ) ν ( x ) ) 〉x , the Total-Variation ( TV ) distance is TV ( ζ , ν ) = : 12 〈|ζ ( x ) − ν ( x ) | , 1〉x , and the Wasserstein distance is W ( ζ , ν ) = infγ∈Γ ( ζ , ν ) 〈‖x − y‖ , γ ( x , y ) 〉x , y where Γ ( ζ , ν ) is the set of couplings for ζ and ν . We define Lip ( f ( x , y ) ; x ) : = supx ‖∇xf ( x , y ) ‖2 and assume the existence of Lip ( Qπ ( s , a ) ; a ) and ‖Lip ( ∇sQπ ( s , a ) ; a ) ‖2 constants . Under this notation , the Rubinstein-Kantrovich ( RK ) duality states that the |〈ζ ( x ) − ν ( x ) , f ( x ) 〉x| ≤W ( ζ , ν ) · Lip ( f ; x ) bound is tight for all f . For brevity , we may abuse the notation and denote supsW ( π1 ( ·|s ) , π2 ( ·|s ) ) with W ( π1 , π2 ) ( and similarly for other measures ) . For parameterized policies , we define∇πf ( π ) : = ∇θf ( π ) where π is parameterized by the vector θ . Table 1 of the appendix summarizes all these mathematical definitions . Policy gradient preliminaries . The advantage decomposition lemma provides insight into the relationship between payoff improvements and advantages ( Kakade & Langford , 2002 ) . That is , ηπ2 − ηπ1 = 1 1− γ · Es∼ρπ2µ [ A π1 ( s , π2 ) ] . ( 1 ) We will denote the current and the candidate next policy as π1 and π2 , respectively . Taking derivatives of both sides with respect to π2 at π1 yields ∇π2ηπ2 = 1 1− γ [ 〈∇π2ρπ2µ ( · ) , Aπ1 ( · , π1 ) 〉+ 〈ρπ1µ ( · ) , ∇π2Aπ1 ( · , π2 ) 〉 ] . ( 2 ) Since π1 does not have any advantage over itself ( i.e. , Aπ1 ( · , π1 ) = 0 ) , the first term is zero . Thus , the Policy Gradient ( PG ) theorem is derived as ∇π2ηπ2 ∣∣∣ π2=π1 = 1 1− γ · Es∼ρπ1µ [ ∇π2A π1 ( s , π2 ) ] ∣∣∣ π2=π1 . ( 3 ) For policy iteration with function approximation , we assume π2 and π1 to be parameterized by θ2 and θ1 , respectively . One can view the PG theorem as a Taylor expansion of the payoff at θ1 . Conservative Policy Iteration ( CPI ) ( Kakade & Langford , 2002 ) was one of the early dimensionally consistent methods with a surrogate of the form Lπ1 ( π2 ) = ηπ1 + 11−γ · Es∼ρπ1µ [ A π1 ( s , π2 ) ] − C 2 TV 2 ( π1 , π2 ) . The C coefficient guarantees non-decreasing payoffs . However , CPI is limited to linear function approximation classes due to the update rule πnew ← ( 1− α ) πold + απ′ . This lead to the design of the Trust Region Policy Optimization ( TRPO ) ( Schulman et al. , 2015a ) algorithm . TRPO exchanged the bounded squared TV distance with the KL divergence by lower bounding it using the Pinsker inequality . This made TRPO closer to the Natural Policy Gradient algorithm ( Kakade , 2002 ) , and for Gaussian policies the modified terms had similar Taylor expansions within small trust regions . Confined trust regions are a stable way of making large updates and avoiding pessimistic coefficients . For gradient estimates , TRPO used Importance Sampling ( IS ) with a baseline shift : ∇θ2Es∼ρπ1µ [ A π1 ( s , π2 ) ] ∣∣∣ θ2=θ1 = ∇θ2E s∼ρπ1µ a∼π1 ( ·|s ) [ Qπ1 ( s , a ) π2 ( a|s ) π1 ( a|s ) ] ∣∣∣ θ2=θ1 . ( 4 ) While empirical E [ Aπ1 ( s , π2 ) ] and E [ Qπ1 ( s , π2 ) ] estimates yield identical variances in principle , the importance sampling estimator in ( 4 ) imposes larger variances . Later , Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2015b ) proposed utilizing the Generalized Advantage Estimation ( GAE ) method for variance reduction and incorporated first-order smoothing like ADAM ( Kingma & Ba , 2014 ) . GAE employed Temporal-Difference ( TD ) learning ( Bhatnagar et al. , 2009 ) for variance reduction . Although TD-learning was not theoretically guaranteed to converge and could add bias , it improved the estimation accuracy . As an alternative to importance sampling , deterministic policy gradient estimators were also utilized in an actor-critic fashion . Deep Deterministic Policy Gradient ( DDPG ) ( Lillicrap et al. , 2015 ) generalized deterministic gradients by employing Approximate Dynamic Programming ( ADP ) ( Mnih et al. , 2015 ) for variance reduction . Twin Delayed Deterministic Policy Gradient ( TD3 ) ( Fujimoto et al. , 2018 ) improved DDPG ’ s approximation to build an even better policy optimization method . Although both methods used deterministic policies , they still performed stochastic search by adding stochastic noise to the deterministic policies to force exploration . Other lines of stochastic policy optimization were later proposed . Wu et al . ( 2017 ) used a Kroneckerfactored approximation for curvatures . Haarnoja et al . ( 2018 ) proposed a maximum entropy actorcritic method for stochastic policy optimization .
This paper proposes a new deterministic policy gradient method (TDPO). The main idea and its derivations are based on the use of a deterministic Vine (DeVine) gradient estimator and the Wasserstein metric. The paper shows that a closed-form computation of Wasserstein distance can be derived without any approximation on the deterministic policies. A monotonic policy improvement guarantee is provided. Deterministic Vine (DeVine) is proposed as an optimization method for the proposed surrogate loss function, which is also inspired by the TRPO's surrogate loss. The proposed method is evaluated on two new robotic control domains that are proposed by the authors. The comparisons are against PPO, TRPO, DDPG, and TD3. Additional experiment results on Open AI Gym environments are provided in Appendix.
SP:1676af08ba2395fab80517e4ebc780a221431592
Effective Subspace Indexing via Interpolation on Stiefel and Grassmann manifolds
1 INTRODUCTION . Subspace selection algorithms have been successful in many application problems related to dimension reduction ( Zhou et al . ( 2010 ) , Bian & Tao ( 2011 ) , Si et al . ( 2010 ) , Zhang et al . ( 2009 ) ) , with applications including , e.g. , human face recognition ( Fu & Huang ( 2008 ) ) , speech and gait recognition ( Tao et al . ( 2007 ) ) , etc .. The classical approaches of subspace selection in dimension reduction include algorithms like Principle Component Analysis ( PCA , see Jolliffe ( 2002 ) ) and Linear Discriminant Analysis ( LDA , see Belhumeur et al . ( 1997 ) , Tao et al . ( 2009 ) ) . They are looking for globally linear subspace models . Therefore , they fail to estimate the nonlinearity of the intrinsic data manifold , and ignore the local variation of the data ( Saul & Roweis ( 2003 ) , Strassen ( 1969 ) ) . Consequently , these globally linear models are often ineffective for search problems on large scale image data sets . To resolve this difficulty , nonlinear algorithms such as kernel algorithms ( Ham et al . ( 2004 ) ) and manifold learning algorithms ( Belkin et al . ( 2006 ) , Guan et al . ( 2011 ) ) are proposed . However , even though these nonlinear methods significantly improve the recognition performance , they face a serious computational challenge dealing with large-scale data sets due to the complexity of matrix decomposition at the size of the number of training samples . Here we propose a simple method , Subspace Indexing Model with Interpolation ( SIM-I ) , that produces from a given data set a piece-wise linear , locality-aware and globally nonlinear model of low-dimensional embedding . SIM-I is constructed via two steps : in the first step we build a piecewise linear affinity-aware subspace model under a given partition of the data set ; in the second step we interpolate between several adjacent linear subspace models constructed previously using the “ center of mass ” calculation on Stiefel and Grassmann manifolds ( Edleman et al . ( 1999 ) , Kaneko et al . ( 2013 ) , Marrinan et al . ( 2014 ) ) . The interpolation step outputs a “ smoothed ” version ( Figure 1 ) of the original piece-wise linear model , and can be regarded as a regularization process . Compared to previously mentioned subspace methods , SIM-I enjoys the following advantages : ( 1 ) it captures the global nonlinearity and thus the local fluctuations of the data set ; ( 2 ) it is computationally feasible to large-scale data sets since it avoids the complexity in matrix decomposition at the size of the number of training samples ; ( 3 ) it includes a regularization step via interpolating between several adjacent pieces of subspace models . Numerical experiments on PCA recovery task for SIFT data set and classification tasks via nearest-neighbor method for MNIST and CIFAR-10 data sets further validate the effectiveness of SIM-I . 2 PIECE-WISE LINEAR LOCALITY PRESERVING PROJECTION ( LPP ) MODEL . If an image data point x ∈ RD is represented as a vector in a very high-dimensional space , then we want to find a low-dimensional embedding y = f ( x ) ∈ Rd , d < < D such that the embedding function f retains some meaningful properties of the original image data set , ideally close to its intrinsic dimension . If we restrict ourselves to linear maps of the form y = WTx ∈ Rd , where the D × d projection matrix W = ( wij ) 1≤i≤D,1≤j≤d ( assuming full rank ) , then such a procedure is called a locally linear low-dimensional embedding ( see Roweis & Saulm ( 2000 ) ; Van Der Maaten et al . ( 2009 ) ) . The target is to search for a “ good ” projection matrix W , such that the projection x 7→ y = WTx must preserve certain locality in the data set ( this is called a Locality Preserving Projection , or LPP projection , see He & Niyogi ( 2003 ) ) . The locality is interpreted as a kind of intrinsic relative geometric relations between the data points in the original high-dimensional space , usually represented by the affinity matrix S = ( sij ) 1≤i , j≤n ( which is a symmetric matrix with non-negative terms ) . As an example , given unlabelled data points x1 , ... , xn ∈ RD , we can take sij = exp ( −‖xi−xj‖ 2 2σ2 ) when ‖xi − xj‖ < ε and sij = 0 otherwise . Here σ > 0 and ε > 0 is a small threshold parameter , and ‖xi−xj‖ is the Euclidean norm in RD . Based on the affinity matrix S = ( sij ) , the search for the projection matrix W can be formulated as the following optimization problem min W φ ( W ) = 1 2 n∑ i , j=1 sij‖yi − yj‖2 , ( 1 ) in which yi = WTxi and yj = WTxj and the norm ‖yi − yj‖ is taken in the projected space Rd . Usually when ‖xi − xj‖ is large , the affinity sij will be small , and vice versa . Thus ( 1 ) is seeking for the embedding matrix W such that close pairs of image points xi and xj will be mapped to close pairs of embeddings yi = WTxi and yj = WTxj , and vice versa . This helps to preserve the local geometry of the data set , a.k.a the locality . To solve ( 1 ) , we introduce a weighted fully-connected graph G where the vertex set consists of all data points x1 , ... , xn and the weight on the edge connecting xi and xj is given by sij ≥ 0 . Consider the diagonal matrix D = diag ( D11 , ... , Dnn ) where Dii = n∑ j=1 sij , and we then introduce the graph Laplacian L = D − S. Then the minimization problem ( 1 ) , together with the normalization constraint n∑ i=1 Diiy2i = 1 , reduces to the following generalized eigenvalue problem ( see He & Niyogi ( 2003 ) ) XLXTw = λXDXTw , ( 2 ) where X = [ x1 , ... , xn ] ∈ RD×n . Assume we have obtained an increasing family of eigenvalues 0 = λ0 < λ1 ≤ ... ≤ λn−1 . Let the corresponding eigenvectors be w0 , w1 , ... , wn−1 . Then the low-dimensional embedding matrix can be taken as W = [ w1 , ... , wd ] ( see He et al . ( 2005 ) ) . By choosing different affinity matrices S = ( sij ) , the above LPP framework includes many commonly seen practical examples . For example , if the data x1 , ... , xn are not labelled , then we can take sij = 1 n and ( 2 ) produces the classical Principle Component Analysis ( PCA ) . For labelled data forming subsets X1 , ... , Xm with same labels in each subset , we can take sij = 1 nk when xi , xj ∈ Xk , and sij = 0 other-wise . Here nk is the cardinality of Xk . This will produce Linear Discriminant Analysis ( LDA ) . The detailed justifications of these connections can be found in He et al . ( 2005 ) . Given an input data set X = { x1 , ... , xn } where each xi ∈ RD , either labelled or unlabelled , we can apply a k-d tree ( Bentley ( 1975 ) , Wang et al . ( 2011 ) ) based partition scheme to divide the whole data set X into non-overlapping subsets C1 , ... , C2h where h is the depth of the tree . Conventional subspace selection algorithms could be applied on the whole sample space before the whole space is partitioned and indexed . For example , we can first apply a PCA to X , which selects the first d bases [ a1 , ... , ad ] with largest variance . Based on these bases , the covariance information obtained from global PCA is utilized in the indexing as follows : ( 1 ) we project all sample points x1 , ... , xn onto the maximum variance basis a1 , then we find the median value m1 of the projected samples , and split the whole collection of data along a1 at m1 , i.e. , split the current node into left and right children ; ( 2 ) starting from level i = 2 , for each left and right child , project the whole collection of data along the i-th maximum variance basis ai , find the median value mi , and split all the children at mi ; ( 3 ) increase the level from i to i+ 1 and repeat ( 2 ) until i = h reaches the bottom of the tree . We collect all the 2h children at level i = h and obtain the disjoint subsets C1 , ... , C2h . Each subset Ck , k = 1 , 2 , ... , 2h consists of a family of input data in RD . Based on them , using the above LPP framework , for each Ck , a low-dimensional embedding matrix Wk ∈ RD×d can be constructed . In this way , over the whole data set X , we have constructed a piece-wise linear low-dimensional embedding model f ( x ) : RD → Rd ( see Figure 1 ( a ) ) where x ∈ X . This model is given by the linear embedding matrices W1 , ... , W2h ∈ RD×d . The above model construction can be regarded as a training process from the data set X . For a given test data point x ∈ RD , not included in X , we can find the closest subset Ck ( x ) to it , by selecting the index k = k ( x ) ∈ { 1 , ... , 2h } with the smallest distance ‖x−mk ( x ) ‖ . Here mk is the mean among all data points in the subset Ck . With the subset Ck ( x ) chosen , we map the test point x ∈ RD to its low-dimensional embedding f ( x ) = WTk ( x ) x ∈ R d. Such a procedure extended the piece-wise linear embedding model f ( x ) : RD → Rd to all testing data points in RD . 3 CALCULATING THE “ CENTER OF MASS ” ON STIEFEL AND GRASSMANN MANIFOLDS . Subspace Indexing ( Wang et al . ( 2011 ) ) provides a d-dimensional representation of the data set { x1 , ... , xn } by the subspace span ( w1 , ... , wd ) = { WTx , x ∈ RD } generated from the linear embedding matrix W ∈ RD×d . In this case , we are only interested in the column space of W , so we can assume that w0 , w1 , ... , wn−1 is an orthonormal basis 1 . Such a matrix W belongs to the Stiefel manifold , defined by Definition 1 ( Stiefel manifold ) The compact Stiefel manifold St ( d , D ) is a submanifold of the Eucilidean space RD×d such that St ( d , D ) = { X ∈ RD×d : XTX = Id } . ( 3 ) As an example , if we are interested in signal recovery using low-dimensional PCA embedding , the projections we calculated from PCA analysis will be on Stiefel manifolds . However , for classification tasks , the exact distance information is less important than label information . In this case , two such Stiefel matricesW1 andW2 produce the same embedding ifW1 = W2Od for someOd ∈ O ( d ) , whereO ( d ) is the group of orthogonal matrices in dimension d. In this case , the relevant embedding we obtained is a point on the Grassmann manifold , defined by 1If this is not the case , we can replace the matrix [ w0 w1 ... wn−1 ] by the Q matrix of the QR-decomposition of itself , without changing the corresponding subspace . Definition 2 ( Grassmann manifold ) The Grassmann manifold Gr ( d , D ) is defined to be the quotient manifold Gr ( d , D ) = St ( d , D ) /O ( d ) . A point on Gr ( d , D ) is defined by an equivalence class [ W ] = { WOd , Od ∈ O ( d ) } where W ∈ St ( d , D ) . Given a family of elements on the Stiefel or Grassmann manifold , the center-of-mass is defined as an element on the same manifold that minimizes the functional given by the weighted sum of square distances . To be precise , we have Definition 3 ( Stiefel and Grassmann center-of-masses ) Given a sequence of matrices W1 , ... , Wl ∈ St ( d , D ) and a sequence of weights w1 , ... , wl > 0 , the Stiefel center-of-mass with respect to the distance d ( W1 , W2 ) on St ( d , D ) is defined as a matrix Wc = W Stc ( W1 , ... , Wl ; w1 , ... , wl ) ∈ St ( d , D ) such that Wc = W St c ( W1 , ... , Wl ; w1 , ... , wl ) ≡ arg min W∈St ( d , D ) l∑ j=1 wjd 2 ( W , Wj ) . ( 4 ) Similarly , if the corresponding equivalent classes are [ W1 ] , ... , [ Wl ] ∈ Gr ( d , D ) , then the Grassmann center-of-mass with respect to the distance d ( [ W1 ] , [ W2 ] ) on Gr ( d , D ) is defined as the equivalence class [ Wc ] , where Wc = WGrc ( W1 , ... , Wl ; w1 , ... , wl ) ∈ St ( d , D ) is such that Wc = W Gr c ( W1 , ... , Wl ; w1 , ... , wl ) ≡ arg min W∈St ( d , D ) l∑ j=1 wjd 2 ( [ W ] , [ Wj ] ) . ( 5 ) The distances d ( W1 , W2 ) or d ( [ W1 ] , [ W2 ] ) can be taken in different ways . For example , for W1 , W2 ∈ St ( d , D ) , one way is to consider d ( W1 , W2 ) = dF ( W1 , W2 ) = ‖W1 −W2‖F , the matrix Frobenius norm of W1 −W2 . One can also take a more intrinsic distance , such as the geodesic distance between W1 and W2 on the manifold St ( d , D ) with the metric given by embedded geometry ( see Edleman et al . ( 1999 ) ) . For [ W1 ] , [ W2 ] ∈ Gr ( d , D ) , one way is to consider the projected Frobenius norm d ( [ W1 ] , [ W2 ] ) = dpF ( [ W1 ] , [ W2 ] ) = 2−1/2‖W1WT1 −W2WT2 ‖F . There are also many other choices , such as using the principle angles between the subspaces , chordal norms , or other types of Frobenius norms ( see Edleman et al . ( 1999 , Section 4.3 ) ) . With respect to matrix Frobenius norm and projected Frobenius norm , the Stiefel and Grassmann center-of-masses can be calculated explicitly in the following theorems . Theorem 1 ( Stiefel center-of-mass with respect to Frobenius norm ) We consider the singular value decomposition of the matrix ∑l j=1 wjWj = O1∆O2 , where O1 ∈ O ( D ) and O2 ∈ O ( d ) , ∆ = ( diag ( λ1 , ... , λd ) d×d 0 ( D−d ) ×d ) and λ1 ≥ ... ≥ λd ≥ 0 are the singular values . Then the Stiefel center-of-mass with respect to the distance given by Frobenius norm d ( W1 , W2 ) = ‖W1−W2‖F is given by Wc = O1ΛO2 where Λ = ( diag ( 1 , ... , 1 ) d×d 0 ( D−d ) ×d ) . Theorem 2 ( Grassmann center-of-mass with respect to projected Frobenius norm ) Set Ωj = ( ∑l j=1 wj ) −1 wj . We consider the singular value decomposition of the symmetric matrix l∑ j=1 ΩjWjW T j = Q∆Q T where Q ∈ O ( D ) and ∆ = diag ( σ21 , ... , σ2D ) , σ21 ≥ ... ≥ σ2D ≥ 0 . Then the Grassmann center-of-mass with respect to the distance given by projected Frobenius norm dpF ( [ W1 ] , [ W2 ] ) = 2−1/2‖W1WT1 − W2WT2 ‖F is the equivalence class [ Wc ] determined by Wc = QΛ , where Λ = ( diag ( 1 , ... , 1 ) d×d 0 ( D−d ) ×d ) . 4 SIM-I : INTERPOLATING THE LPP MODEL FAMILY Recall that we have developed a piece-wise linear embedding model f ( x ) : RD → Rd over the data set X = { x1 , ... , xn } . The embedding f ( x ) corresponds to a family of subspace indexing models W1 , ... , W2h ∈ St ( d , D ) ( e.g . for PCA signal recovery tasks ) or [ W1 ] , ... , [ W2h ] ∈ Gr ( d , D ) ( e.g . for classification tasks ) . Each subspace model Wk is built from LPP embedding using the subset Ck ⊂ X developed from k-d tree and h is the depth tree . Given a test point x ∈ RD that does not lie in X , we can map it to the low-dimensional embedding f ( x ) = WTk ( x ) x ∈ R d. The index k ( x ) corresponds to the subset Ck ( x ) that lie closest to x . In practice , we can first compute the means mk over all the data points in the subset Ck for each k = 1 , 2 , ... , 2h and sort the distances ‖x−mk‖ in ascending order ‖x−mk1 ( x ) ‖ ≤ ... ≤ ‖x−mk2h ( x ) ‖ , { k1 ( x ) , ... , k2h ( x ) } = { 1 , ... , 2 h } . We then take k ( x ) = k1 ( x ) to be the index k corresponding to the shortest distance . This is effective when the test point x lies significantly close to one of the subsets Ck ( x ) , see Figure 2 ( a ) . Algorithm 1 SIM-I : Subspace Indexing Model with Interpolation 1 : Input : Data set X = { x1 , ... , xn ∈ RD } and its corresponding affinity matrix S = ( sij ) 1≤i , j≤n ; test point x ∈ RD ; threshold ratio rthr > 1 ; tree depth h ; parameter K > 0 2 : Using an initial PCA and a k-d tree based partition scheme , decompose the data set X into subsets C1 , ... , C2h , where h is the depth of the tree 3 : For each subset Ck , calculate its mean ( center ) mk ∈ RD and its LPP embedding matrix Wk ∈ St ( d , D ) based on the affinity matrix S 4 : Sort the distances ‖x − mk‖ in ascending order ‖x − mk1 ( x ) ‖ ≤ ... ≤ ‖x − mk2h ( x ) ‖ , { k1 ( x ) , ... , k2h ( x ) } = { 1 , ... , 2h } 5 : Determine I , which is the first sub-index i of ki ( x ) such that ‖x−mkI+1 ( x ) ‖ > rthr‖x−mk1 ( x ) ‖ 6 : Set ji ( x ) = ki ( x ) for i = 1 , 2 , ... , I and obtain the embedding matrices Wj1 ( x ) , ... , WjI ( x ) ∈ St ( d , D ) or their corresponding subspaces [ Wj1 ( x ) ] , ... , [ WjI ( x ) ] ∈ Gr ( d , D ) , together with the weights wi = exp ( −K‖x−mji ( x ) ‖2 ) > 0 for i = 1 , ... , I 7 : Find a center-of-mass Wc = W Stc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ( Stiefel case ) or [ Wc ] = [ WGrc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ] ( Grassmann case ) according to Definition 3 and Theorems 1 and 2 . 8 : Output : The low-dimensional embedding f ( x ) = WTc x ∈ Rd However , for a general test point x ∈ RD , it might happen that this point lies at approximately the same distances to the centers of each of the several different subsets adjacent to x ( see Figure 2 ( b ) ) . In this case , we aim to interpolate between several subspace indexing modelsWj1 ( x ) , ... , WjI ( x ) . To do this , we first find the subspace indexes j1 ( x ) , ... , jI ( x ) from the first I subsets Cj1 ( x ) , ... , CjI ( x ) closest to x , i.e. , j1 ( x ) = k1 ( x ) , ... , jI ( x ) = kI ( x ) given the sorted distances ‖x−mk‖ mentioned above . In practice , the number I = I ( x ) is depending on x and can be chosen in the following way : I is the first sub-index i of ki ( x ) such that ‖x−mkI+1 ( x ) ‖ > rthr‖x−mk1 ( x ) ‖ , where rthr > 1 is a threshold ratio that can be tuned . We then pick the weights aswi = exp ( −K‖x−mji ( x ) ‖2 ) for some K > 0 and i = 1 , 2 , ... , I . This is indicating that the closer x is to Cji ( x ) , the heavier weights we assign to Wji ( x ) in the interpolation process . Given the embedding matrices Wj1 ( x ) , ... , WjI ( x ) ∈ St ( d , D ) or their corresponding subspaces [ Wj1 ( x ) ] , ... , [ WjI ( x ) ] ∈ Gr ( d , D ) , together with the weights w1 , ... , wI > 0 , we find a center-of-mass Wc = W Stc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ( Stiefel case ) or [ Wc ] = [ WGrc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ] ( Grassmann case ) according to Definition 3 and Theorems 1 and 2 . Finally , we map the test point x to the low-dimensional embedding f ( x ) = WTc x ∈ Rd . Notice that when I = 1 , the interpolation procedure reduces to projecting x using Wk1 ( x ) calculated from LPP analysis on the closest subset only . In general , the whole interpolation procedure can be regarded as providing a regularized version of the piece-wise linear embedding we discussed in Section 2 ( also see Figure 1 ) . We summarize our interpolation method as the SIM-I Algorithm 1 .
This paper proposes a subspace indexing model with interpolation (SIM-I) for dimension reduction. To capture the global nonlinearity and the local variation of data, SIM-I split the global space into a collection of local disjoint partitions by a kd-tree style scheme and build a subspace indexing model (e.g., LPP) for each local partition. The main contribution of this paper is to propose an interpolation technique to combine several subspace indexing models to determine a more promising model for low-dimensional embedding. Two experiments on PCA recovery and nearest neighbour classification validate the effectiveness of SIM-I.
SP:f14bb4150e95fa83a686a9a4b879cda9fc40a7bf
Effective Subspace Indexing via Interpolation on Stiefel and Grassmann manifolds
1 INTRODUCTION . Subspace selection algorithms have been successful in many application problems related to dimension reduction ( Zhou et al . ( 2010 ) , Bian & Tao ( 2011 ) , Si et al . ( 2010 ) , Zhang et al . ( 2009 ) ) , with applications including , e.g. , human face recognition ( Fu & Huang ( 2008 ) ) , speech and gait recognition ( Tao et al . ( 2007 ) ) , etc .. The classical approaches of subspace selection in dimension reduction include algorithms like Principle Component Analysis ( PCA , see Jolliffe ( 2002 ) ) and Linear Discriminant Analysis ( LDA , see Belhumeur et al . ( 1997 ) , Tao et al . ( 2009 ) ) . They are looking for globally linear subspace models . Therefore , they fail to estimate the nonlinearity of the intrinsic data manifold , and ignore the local variation of the data ( Saul & Roweis ( 2003 ) , Strassen ( 1969 ) ) . Consequently , these globally linear models are often ineffective for search problems on large scale image data sets . To resolve this difficulty , nonlinear algorithms such as kernel algorithms ( Ham et al . ( 2004 ) ) and manifold learning algorithms ( Belkin et al . ( 2006 ) , Guan et al . ( 2011 ) ) are proposed . However , even though these nonlinear methods significantly improve the recognition performance , they face a serious computational challenge dealing with large-scale data sets due to the complexity of matrix decomposition at the size of the number of training samples . Here we propose a simple method , Subspace Indexing Model with Interpolation ( SIM-I ) , that produces from a given data set a piece-wise linear , locality-aware and globally nonlinear model of low-dimensional embedding . SIM-I is constructed via two steps : in the first step we build a piecewise linear affinity-aware subspace model under a given partition of the data set ; in the second step we interpolate between several adjacent linear subspace models constructed previously using the “ center of mass ” calculation on Stiefel and Grassmann manifolds ( Edleman et al . ( 1999 ) , Kaneko et al . ( 2013 ) , Marrinan et al . ( 2014 ) ) . The interpolation step outputs a “ smoothed ” version ( Figure 1 ) of the original piece-wise linear model , and can be regarded as a regularization process . Compared to previously mentioned subspace methods , SIM-I enjoys the following advantages : ( 1 ) it captures the global nonlinearity and thus the local fluctuations of the data set ; ( 2 ) it is computationally feasible to large-scale data sets since it avoids the complexity in matrix decomposition at the size of the number of training samples ; ( 3 ) it includes a regularization step via interpolating between several adjacent pieces of subspace models . Numerical experiments on PCA recovery task for SIFT data set and classification tasks via nearest-neighbor method for MNIST and CIFAR-10 data sets further validate the effectiveness of SIM-I . 2 PIECE-WISE LINEAR LOCALITY PRESERVING PROJECTION ( LPP ) MODEL . If an image data point x ∈ RD is represented as a vector in a very high-dimensional space , then we want to find a low-dimensional embedding y = f ( x ) ∈ Rd , d < < D such that the embedding function f retains some meaningful properties of the original image data set , ideally close to its intrinsic dimension . If we restrict ourselves to linear maps of the form y = WTx ∈ Rd , where the D × d projection matrix W = ( wij ) 1≤i≤D,1≤j≤d ( assuming full rank ) , then such a procedure is called a locally linear low-dimensional embedding ( see Roweis & Saulm ( 2000 ) ; Van Der Maaten et al . ( 2009 ) ) . The target is to search for a “ good ” projection matrix W , such that the projection x 7→ y = WTx must preserve certain locality in the data set ( this is called a Locality Preserving Projection , or LPP projection , see He & Niyogi ( 2003 ) ) . The locality is interpreted as a kind of intrinsic relative geometric relations between the data points in the original high-dimensional space , usually represented by the affinity matrix S = ( sij ) 1≤i , j≤n ( which is a symmetric matrix with non-negative terms ) . As an example , given unlabelled data points x1 , ... , xn ∈ RD , we can take sij = exp ( −‖xi−xj‖ 2 2σ2 ) when ‖xi − xj‖ < ε and sij = 0 otherwise . Here σ > 0 and ε > 0 is a small threshold parameter , and ‖xi−xj‖ is the Euclidean norm in RD . Based on the affinity matrix S = ( sij ) , the search for the projection matrix W can be formulated as the following optimization problem min W φ ( W ) = 1 2 n∑ i , j=1 sij‖yi − yj‖2 , ( 1 ) in which yi = WTxi and yj = WTxj and the norm ‖yi − yj‖ is taken in the projected space Rd . Usually when ‖xi − xj‖ is large , the affinity sij will be small , and vice versa . Thus ( 1 ) is seeking for the embedding matrix W such that close pairs of image points xi and xj will be mapped to close pairs of embeddings yi = WTxi and yj = WTxj , and vice versa . This helps to preserve the local geometry of the data set , a.k.a the locality . To solve ( 1 ) , we introduce a weighted fully-connected graph G where the vertex set consists of all data points x1 , ... , xn and the weight on the edge connecting xi and xj is given by sij ≥ 0 . Consider the diagonal matrix D = diag ( D11 , ... , Dnn ) where Dii = n∑ j=1 sij , and we then introduce the graph Laplacian L = D − S. Then the minimization problem ( 1 ) , together with the normalization constraint n∑ i=1 Diiy2i = 1 , reduces to the following generalized eigenvalue problem ( see He & Niyogi ( 2003 ) ) XLXTw = λXDXTw , ( 2 ) where X = [ x1 , ... , xn ] ∈ RD×n . Assume we have obtained an increasing family of eigenvalues 0 = λ0 < λ1 ≤ ... ≤ λn−1 . Let the corresponding eigenvectors be w0 , w1 , ... , wn−1 . Then the low-dimensional embedding matrix can be taken as W = [ w1 , ... , wd ] ( see He et al . ( 2005 ) ) . By choosing different affinity matrices S = ( sij ) , the above LPP framework includes many commonly seen practical examples . For example , if the data x1 , ... , xn are not labelled , then we can take sij = 1 n and ( 2 ) produces the classical Principle Component Analysis ( PCA ) . For labelled data forming subsets X1 , ... , Xm with same labels in each subset , we can take sij = 1 nk when xi , xj ∈ Xk , and sij = 0 other-wise . Here nk is the cardinality of Xk . This will produce Linear Discriminant Analysis ( LDA ) . The detailed justifications of these connections can be found in He et al . ( 2005 ) . Given an input data set X = { x1 , ... , xn } where each xi ∈ RD , either labelled or unlabelled , we can apply a k-d tree ( Bentley ( 1975 ) , Wang et al . ( 2011 ) ) based partition scheme to divide the whole data set X into non-overlapping subsets C1 , ... , C2h where h is the depth of the tree . Conventional subspace selection algorithms could be applied on the whole sample space before the whole space is partitioned and indexed . For example , we can first apply a PCA to X , which selects the first d bases [ a1 , ... , ad ] with largest variance . Based on these bases , the covariance information obtained from global PCA is utilized in the indexing as follows : ( 1 ) we project all sample points x1 , ... , xn onto the maximum variance basis a1 , then we find the median value m1 of the projected samples , and split the whole collection of data along a1 at m1 , i.e. , split the current node into left and right children ; ( 2 ) starting from level i = 2 , for each left and right child , project the whole collection of data along the i-th maximum variance basis ai , find the median value mi , and split all the children at mi ; ( 3 ) increase the level from i to i+ 1 and repeat ( 2 ) until i = h reaches the bottom of the tree . We collect all the 2h children at level i = h and obtain the disjoint subsets C1 , ... , C2h . Each subset Ck , k = 1 , 2 , ... , 2h consists of a family of input data in RD . Based on them , using the above LPP framework , for each Ck , a low-dimensional embedding matrix Wk ∈ RD×d can be constructed . In this way , over the whole data set X , we have constructed a piece-wise linear low-dimensional embedding model f ( x ) : RD → Rd ( see Figure 1 ( a ) ) where x ∈ X . This model is given by the linear embedding matrices W1 , ... , W2h ∈ RD×d . The above model construction can be regarded as a training process from the data set X . For a given test data point x ∈ RD , not included in X , we can find the closest subset Ck ( x ) to it , by selecting the index k = k ( x ) ∈ { 1 , ... , 2h } with the smallest distance ‖x−mk ( x ) ‖ . Here mk is the mean among all data points in the subset Ck . With the subset Ck ( x ) chosen , we map the test point x ∈ RD to its low-dimensional embedding f ( x ) = WTk ( x ) x ∈ R d. Such a procedure extended the piece-wise linear embedding model f ( x ) : RD → Rd to all testing data points in RD . 3 CALCULATING THE “ CENTER OF MASS ” ON STIEFEL AND GRASSMANN MANIFOLDS . Subspace Indexing ( Wang et al . ( 2011 ) ) provides a d-dimensional representation of the data set { x1 , ... , xn } by the subspace span ( w1 , ... , wd ) = { WTx , x ∈ RD } generated from the linear embedding matrix W ∈ RD×d . In this case , we are only interested in the column space of W , so we can assume that w0 , w1 , ... , wn−1 is an orthonormal basis 1 . Such a matrix W belongs to the Stiefel manifold , defined by Definition 1 ( Stiefel manifold ) The compact Stiefel manifold St ( d , D ) is a submanifold of the Eucilidean space RD×d such that St ( d , D ) = { X ∈ RD×d : XTX = Id } . ( 3 ) As an example , if we are interested in signal recovery using low-dimensional PCA embedding , the projections we calculated from PCA analysis will be on Stiefel manifolds . However , for classification tasks , the exact distance information is less important than label information . In this case , two such Stiefel matricesW1 andW2 produce the same embedding ifW1 = W2Od for someOd ∈ O ( d ) , whereO ( d ) is the group of orthogonal matrices in dimension d. In this case , the relevant embedding we obtained is a point on the Grassmann manifold , defined by 1If this is not the case , we can replace the matrix [ w0 w1 ... wn−1 ] by the Q matrix of the QR-decomposition of itself , without changing the corresponding subspace . Definition 2 ( Grassmann manifold ) The Grassmann manifold Gr ( d , D ) is defined to be the quotient manifold Gr ( d , D ) = St ( d , D ) /O ( d ) . A point on Gr ( d , D ) is defined by an equivalence class [ W ] = { WOd , Od ∈ O ( d ) } where W ∈ St ( d , D ) . Given a family of elements on the Stiefel or Grassmann manifold , the center-of-mass is defined as an element on the same manifold that minimizes the functional given by the weighted sum of square distances . To be precise , we have Definition 3 ( Stiefel and Grassmann center-of-masses ) Given a sequence of matrices W1 , ... , Wl ∈ St ( d , D ) and a sequence of weights w1 , ... , wl > 0 , the Stiefel center-of-mass with respect to the distance d ( W1 , W2 ) on St ( d , D ) is defined as a matrix Wc = W Stc ( W1 , ... , Wl ; w1 , ... , wl ) ∈ St ( d , D ) such that Wc = W St c ( W1 , ... , Wl ; w1 , ... , wl ) ≡ arg min W∈St ( d , D ) l∑ j=1 wjd 2 ( W , Wj ) . ( 4 ) Similarly , if the corresponding equivalent classes are [ W1 ] , ... , [ Wl ] ∈ Gr ( d , D ) , then the Grassmann center-of-mass with respect to the distance d ( [ W1 ] , [ W2 ] ) on Gr ( d , D ) is defined as the equivalence class [ Wc ] , where Wc = WGrc ( W1 , ... , Wl ; w1 , ... , wl ) ∈ St ( d , D ) is such that Wc = W Gr c ( W1 , ... , Wl ; w1 , ... , wl ) ≡ arg min W∈St ( d , D ) l∑ j=1 wjd 2 ( [ W ] , [ Wj ] ) . ( 5 ) The distances d ( W1 , W2 ) or d ( [ W1 ] , [ W2 ] ) can be taken in different ways . For example , for W1 , W2 ∈ St ( d , D ) , one way is to consider d ( W1 , W2 ) = dF ( W1 , W2 ) = ‖W1 −W2‖F , the matrix Frobenius norm of W1 −W2 . One can also take a more intrinsic distance , such as the geodesic distance between W1 and W2 on the manifold St ( d , D ) with the metric given by embedded geometry ( see Edleman et al . ( 1999 ) ) . For [ W1 ] , [ W2 ] ∈ Gr ( d , D ) , one way is to consider the projected Frobenius norm d ( [ W1 ] , [ W2 ] ) = dpF ( [ W1 ] , [ W2 ] ) = 2−1/2‖W1WT1 −W2WT2 ‖F . There are also many other choices , such as using the principle angles between the subspaces , chordal norms , or other types of Frobenius norms ( see Edleman et al . ( 1999 , Section 4.3 ) ) . With respect to matrix Frobenius norm and projected Frobenius norm , the Stiefel and Grassmann center-of-masses can be calculated explicitly in the following theorems . Theorem 1 ( Stiefel center-of-mass with respect to Frobenius norm ) We consider the singular value decomposition of the matrix ∑l j=1 wjWj = O1∆O2 , where O1 ∈ O ( D ) and O2 ∈ O ( d ) , ∆ = ( diag ( λ1 , ... , λd ) d×d 0 ( D−d ) ×d ) and λ1 ≥ ... ≥ λd ≥ 0 are the singular values . Then the Stiefel center-of-mass with respect to the distance given by Frobenius norm d ( W1 , W2 ) = ‖W1−W2‖F is given by Wc = O1ΛO2 where Λ = ( diag ( 1 , ... , 1 ) d×d 0 ( D−d ) ×d ) . Theorem 2 ( Grassmann center-of-mass with respect to projected Frobenius norm ) Set Ωj = ( ∑l j=1 wj ) −1 wj . We consider the singular value decomposition of the symmetric matrix l∑ j=1 ΩjWjW T j = Q∆Q T where Q ∈ O ( D ) and ∆ = diag ( σ21 , ... , σ2D ) , σ21 ≥ ... ≥ σ2D ≥ 0 . Then the Grassmann center-of-mass with respect to the distance given by projected Frobenius norm dpF ( [ W1 ] , [ W2 ] ) = 2−1/2‖W1WT1 − W2WT2 ‖F is the equivalence class [ Wc ] determined by Wc = QΛ , where Λ = ( diag ( 1 , ... , 1 ) d×d 0 ( D−d ) ×d ) . 4 SIM-I : INTERPOLATING THE LPP MODEL FAMILY Recall that we have developed a piece-wise linear embedding model f ( x ) : RD → Rd over the data set X = { x1 , ... , xn } . The embedding f ( x ) corresponds to a family of subspace indexing models W1 , ... , W2h ∈ St ( d , D ) ( e.g . for PCA signal recovery tasks ) or [ W1 ] , ... , [ W2h ] ∈ Gr ( d , D ) ( e.g . for classification tasks ) . Each subspace model Wk is built from LPP embedding using the subset Ck ⊂ X developed from k-d tree and h is the depth tree . Given a test point x ∈ RD that does not lie in X , we can map it to the low-dimensional embedding f ( x ) = WTk ( x ) x ∈ R d. The index k ( x ) corresponds to the subset Ck ( x ) that lie closest to x . In practice , we can first compute the means mk over all the data points in the subset Ck for each k = 1 , 2 , ... , 2h and sort the distances ‖x−mk‖ in ascending order ‖x−mk1 ( x ) ‖ ≤ ... ≤ ‖x−mk2h ( x ) ‖ , { k1 ( x ) , ... , k2h ( x ) } = { 1 , ... , 2 h } . We then take k ( x ) = k1 ( x ) to be the index k corresponding to the shortest distance . This is effective when the test point x lies significantly close to one of the subsets Ck ( x ) , see Figure 2 ( a ) . Algorithm 1 SIM-I : Subspace Indexing Model with Interpolation 1 : Input : Data set X = { x1 , ... , xn ∈ RD } and its corresponding affinity matrix S = ( sij ) 1≤i , j≤n ; test point x ∈ RD ; threshold ratio rthr > 1 ; tree depth h ; parameter K > 0 2 : Using an initial PCA and a k-d tree based partition scheme , decompose the data set X into subsets C1 , ... , C2h , where h is the depth of the tree 3 : For each subset Ck , calculate its mean ( center ) mk ∈ RD and its LPP embedding matrix Wk ∈ St ( d , D ) based on the affinity matrix S 4 : Sort the distances ‖x − mk‖ in ascending order ‖x − mk1 ( x ) ‖ ≤ ... ≤ ‖x − mk2h ( x ) ‖ , { k1 ( x ) , ... , k2h ( x ) } = { 1 , ... , 2h } 5 : Determine I , which is the first sub-index i of ki ( x ) such that ‖x−mkI+1 ( x ) ‖ > rthr‖x−mk1 ( x ) ‖ 6 : Set ji ( x ) = ki ( x ) for i = 1 , 2 , ... , I and obtain the embedding matrices Wj1 ( x ) , ... , WjI ( x ) ∈ St ( d , D ) or their corresponding subspaces [ Wj1 ( x ) ] , ... , [ WjI ( x ) ] ∈ Gr ( d , D ) , together with the weights wi = exp ( −K‖x−mji ( x ) ‖2 ) > 0 for i = 1 , ... , I 7 : Find a center-of-mass Wc = W Stc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ( Stiefel case ) or [ Wc ] = [ WGrc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ] ( Grassmann case ) according to Definition 3 and Theorems 1 and 2 . 8 : Output : The low-dimensional embedding f ( x ) = WTc x ∈ Rd However , for a general test point x ∈ RD , it might happen that this point lies at approximately the same distances to the centers of each of the several different subsets adjacent to x ( see Figure 2 ( b ) ) . In this case , we aim to interpolate between several subspace indexing modelsWj1 ( x ) , ... , WjI ( x ) . To do this , we first find the subspace indexes j1 ( x ) , ... , jI ( x ) from the first I subsets Cj1 ( x ) , ... , CjI ( x ) closest to x , i.e. , j1 ( x ) = k1 ( x ) , ... , jI ( x ) = kI ( x ) given the sorted distances ‖x−mk‖ mentioned above . In practice , the number I = I ( x ) is depending on x and can be chosen in the following way : I is the first sub-index i of ki ( x ) such that ‖x−mkI+1 ( x ) ‖ > rthr‖x−mk1 ( x ) ‖ , where rthr > 1 is a threshold ratio that can be tuned . We then pick the weights aswi = exp ( −K‖x−mji ( x ) ‖2 ) for some K > 0 and i = 1 , 2 , ... , I . This is indicating that the closer x is to Cji ( x ) , the heavier weights we assign to Wji ( x ) in the interpolation process . Given the embedding matrices Wj1 ( x ) , ... , WjI ( x ) ∈ St ( d , D ) or their corresponding subspaces [ Wj1 ( x ) ] , ... , [ WjI ( x ) ] ∈ Gr ( d , D ) , together with the weights w1 , ... , wI > 0 , we find a center-of-mass Wc = W Stc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ( Stiefel case ) or [ Wc ] = [ WGrc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ] ( Grassmann case ) according to Definition 3 and Theorems 1 and 2 . Finally , we map the test point x to the low-dimensional embedding f ( x ) = WTc x ∈ Rd . Notice that when I = 1 , the interpolation procedure reduces to projecting x using Wk1 ( x ) calculated from LPP analysis on the closest subset only . In general , the whole interpolation procedure can be regarded as providing a regularized version of the piece-wise linear embedding we discussed in Section 2 ( also see Figure 1 ) . We summarize our interpolation method as the SIM-I Algorithm 1 .
This paper presents an approach to low-dimensional embedding of data, with an emphasis on image datasets. The algorithm proceeds by first finding several local subspaces that fit the data and then tying these subspaces together using the center of mass calculation on the Stiefel/Grassmann manifold. The method appears to be computationally efficient, since it can be applied to fairly large image datasets, though no formal analysis is given. The main drawback of the paper is that the empirical results compare only to PCA. Several more modern methods for low-dimensional embeddings exist (e.g., T-SNE, UMAP), and it would be appropriate to compare to these. UMAP also allows for the incorporation of labeled data.
SP:f14bb4150e95fa83a686a9a4b879cda9fc40a7bf
Effective Subspace Indexing via Interpolation on Stiefel and Grassmann manifolds
1 INTRODUCTION . Subspace selection algorithms have been successful in many application problems related to dimension reduction ( Zhou et al . ( 2010 ) , Bian & Tao ( 2011 ) , Si et al . ( 2010 ) , Zhang et al . ( 2009 ) ) , with applications including , e.g. , human face recognition ( Fu & Huang ( 2008 ) ) , speech and gait recognition ( Tao et al . ( 2007 ) ) , etc .. The classical approaches of subspace selection in dimension reduction include algorithms like Principle Component Analysis ( PCA , see Jolliffe ( 2002 ) ) and Linear Discriminant Analysis ( LDA , see Belhumeur et al . ( 1997 ) , Tao et al . ( 2009 ) ) . They are looking for globally linear subspace models . Therefore , they fail to estimate the nonlinearity of the intrinsic data manifold , and ignore the local variation of the data ( Saul & Roweis ( 2003 ) , Strassen ( 1969 ) ) . Consequently , these globally linear models are often ineffective for search problems on large scale image data sets . To resolve this difficulty , nonlinear algorithms such as kernel algorithms ( Ham et al . ( 2004 ) ) and manifold learning algorithms ( Belkin et al . ( 2006 ) , Guan et al . ( 2011 ) ) are proposed . However , even though these nonlinear methods significantly improve the recognition performance , they face a serious computational challenge dealing with large-scale data sets due to the complexity of matrix decomposition at the size of the number of training samples . Here we propose a simple method , Subspace Indexing Model with Interpolation ( SIM-I ) , that produces from a given data set a piece-wise linear , locality-aware and globally nonlinear model of low-dimensional embedding . SIM-I is constructed via two steps : in the first step we build a piecewise linear affinity-aware subspace model under a given partition of the data set ; in the second step we interpolate between several adjacent linear subspace models constructed previously using the “ center of mass ” calculation on Stiefel and Grassmann manifolds ( Edleman et al . ( 1999 ) , Kaneko et al . ( 2013 ) , Marrinan et al . ( 2014 ) ) . The interpolation step outputs a “ smoothed ” version ( Figure 1 ) of the original piece-wise linear model , and can be regarded as a regularization process . Compared to previously mentioned subspace methods , SIM-I enjoys the following advantages : ( 1 ) it captures the global nonlinearity and thus the local fluctuations of the data set ; ( 2 ) it is computationally feasible to large-scale data sets since it avoids the complexity in matrix decomposition at the size of the number of training samples ; ( 3 ) it includes a regularization step via interpolating between several adjacent pieces of subspace models . Numerical experiments on PCA recovery task for SIFT data set and classification tasks via nearest-neighbor method for MNIST and CIFAR-10 data sets further validate the effectiveness of SIM-I . 2 PIECE-WISE LINEAR LOCALITY PRESERVING PROJECTION ( LPP ) MODEL . If an image data point x ∈ RD is represented as a vector in a very high-dimensional space , then we want to find a low-dimensional embedding y = f ( x ) ∈ Rd , d < < D such that the embedding function f retains some meaningful properties of the original image data set , ideally close to its intrinsic dimension . If we restrict ourselves to linear maps of the form y = WTx ∈ Rd , where the D × d projection matrix W = ( wij ) 1≤i≤D,1≤j≤d ( assuming full rank ) , then such a procedure is called a locally linear low-dimensional embedding ( see Roweis & Saulm ( 2000 ) ; Van Der Maaten et al . ( 2009 ) ) . The target is to search for a “ good ” projection matrix W , such that the projection x 7→ y = WTx must preserve certain locality in the data set ( this is called a Locality Preserving Projection , or LPP projection , see He & Niyogi ( 2003 ) ) . The locality is interpreted as a kind of intrinsic relative geometric relations between the data points in the original high-dimensional space , usually represented by the affinity matrix S = ( sij ) 1≤i , j≤n ( which is a symmetric matrix with non-negative terms ) . As an example , given unlabelled data points x1 , ... , xn ∈ RD , we can take sij = exp ( −‖xi−xj‖ 2 2σ2 ) when ‖xi − xj‖ < ε and sij = 0 otherwise . Here σ > 0 and ε > 0 is a small threshold parameter , and ‖xi−xj‖ is the Euclidean norm in RD . Based on the affinity matrix S = ( sij ) , the search for the projection matrix W can be formulated as the following optimization problem min W φ ( W ) = 1 2 n∑ i , j=1 sij‖yi − yj‖2 , ( 1 ) in which yi = WTxi and yj = WTxj and the norm ‖yi − yj‖ is taken in the projected space Rd . Usually when ‖xi − xj‖ is large , the affinity sij will be small , and vice versa . Thus ( 1 ) is seeking for the embedding matrix W such that close pairs of image points xi and xj will be mapped to close pairs of embeddings yi = WTxi and yj = WTxj , and vice versa . This helps to preserve the local geometry of the data set , a.k.a the locality . To solve ( 1 ) , we introduce a weighted fully-connected graph G where the vertex set consists of all data points x1 , ... , xn and the weight on the edge connecting xi and xj is given by sij ≥ 0 . Consider the diagonal matrix D = diag ( D11 , ... , Dnn ) where Dii = n∑ j=1 sij , and we then introduce the graph Laplacian L = D − S. Then the minimization problem ( 1 ) , together with the normalization constraint n∑ i=1 Diiy2i = 1 , reduces to the following generalized eigenvalue problem ( see He & Niyogi ( 2003 ) ) XLXTw = λXDXTw , ( 2 ) where X = [ x1 , ... , xn ] ∈ RD×n . Assume we have obtained an increasing family of eigenvalues 0 = λ0 < λ1 ≤ ... ≤ λn−1 . Let the corresponding eigenvectors be w0 , w1 , ... , wn−1 . Then the low-dimensional embedding matrix can be taken as W = [ w1 , ... , wd ] ( see He et al . ( 2005 ) ) . By choosing different affinity matrices S = ( sij ) , the above LPP framework includes many commonly seen practical examples . For example , if the data x1 , ... , xn are not labelled , then we can take sij = 1 n and ( 2 ) produces the classical Principle Component Analysis ( PCA ) . For labelled data forming subsets X1 , ... , Xm with same labels in each subset , we can take sij = 1 nk when xi , xj ∈ Xk , and sij = 0 other-wise . Here nk is the cardinality of Xk . This will produce Linear Discriminant Analysis ( LDA ) . The detailed justifications of these connections can be found in He et al . ( 2005 ) . Given an input data set X = { x1 , ... , xn } where each xi ∈ RD , either labelled or unlabelled , we can apply a k-d tree ( Bentley ( 1975 ) , Wang et al . ( 2011 ) ) based partition scheme to divide the whole data set X into non-overlapping subsets C1 , ... , C2h where h is the depth of the tree . Conventional subspace selection algorithms could be applied on the whole sample space before the whole space is partitioned and indexed . For example , we can first apply a PCA to X , which selects the first d bases [ a1 , ... , ad ] with largest variance . Based on these bases , the covariance information obtained from global PCA is utilized in the indexing as follows : ( 1 ) we project all sample points x1 , ... , xn onto the maximum variance basis a1 , then we find the median value m1 of the projected samples , and split the whole collection of data along a1 at m1 , i.e. , split the current node into left and right children ; ( 2 ) starting from level i = 2 , for each left and right child , project the whole collection of data along the i-th maximum variance basis ai , find the median value mi , and split all the children at mi ; ( 3 ) increase the level from i to i+ 1 and repeat ( 2 ) until i = h reaches the bottom of the tree . We collect all the 2h children at level i = h and obtain the disjoint subsets C1 , ... , C2h . Each subset Ck , k = 1 , 2 , ... , 2h consists of a family of input data in RD . Based on them , using the above LPP framework , for each Ck , a low-dimensional embedding matrix Wk ∈ RD×d can be constructed . In this way , over the whole data set X , we have constructed a piece-wise linear low-dimensional embedding model f ( x ) : RD → Rd ( see Figure 1 ( a ) ) where x ∈ X . This model is given by the linear embedding matrices W1 , ... , W2h ∈ RD×d . The above model construction can be regarded as a training process from the data set X . For a given test data point x ∈ RD , not included in X , we can find the closest subset Ck ( x ) to it , by selecting the index k = k ( x ) ∈ { 1 , ... , 2h } with the smallest distance ‖x−mk ( x ) ‖ . Here mk is the mean among all data points in the subset Ck . With the subset Ck ( x ) chosen , we map the test point x ∈ RD to its low-dimensional embedding f ( x ) = WTk ( x ) x ∈ R d. Such a procedure extended the piece-wise linear embedding model f ( x ) : RD → Rd to all testing data points in RD . 3 CALCULATING THE “ CENTER OF MASS ” ON STIEFEL AND GRASSMANN MANIFOLDS . Subspace Indexing ( Wang et al . ( 2011 ) ) provides a d-dimensional representation of the data set { x1 , ... , xn } by the subspace span ( w1 , ... , wd ) = { WTx , x ∈ RD } generated from the linear embedding matrix W ∈ RD×d . In this case , we are only interested in the column space of W , so we can assume that w0 , w1 , ... , wn−1 is an orthonormal basis 1 . Such a matrix W belongs to the Stiefel manifold , defined by Definition 1 ( Stiefel manifold ) The compact Stiefel manifold St ( d , D ) is a submanifold of the Eucilidean space RD×d such that St ( d , D ) = { X ∈ RD×d : XTX = Id } . ( 3 ) As an example , if we are interested in signal recovery using low-dimensional PCA embedding , the projections we calculated from PCA analysis will be on Stiefel manifolds . However , for classification tasks , the exact distance information is less important than label information . In this case , two such Stiefel matricesW1 andW2 produce the same embedding ifW1 = W2Od for someOd ∈ O ( d ) , whereO ( d ) is the group of orthogonal matrices in dimension d. In this case , the relevant embedding we obtained is a point on the Grassmann manifold , defined by 1If this is not the case , we can replace the matrix [ w0 w1 ... wn−1 ] by the Q matrix of the QR-decomposition of itself , without changing the corresponding subspace . Definition 2 ( Grassmann manifold ) The Grassmann manifold Gr ( d , D ) is defined to be the quotient manifold Gr ( d , D ) = St ( d , D ) /O ( d ) . A point on Gr ( d , D ) is defined by an equivalence class [ W ] = { WOd , Od ∈ O ( d ) } where W ∈ St ( d , D ) . Given a family of elements on the Stiefel or Grassmann manifold , the center-of-mass is defined as an element on the same manifold that minimizes the functional given by the weighted sum of square distances . To be precise , we have Definition 3 ( Stiefel and Grassmann center-of-masses ) Given a sequence of matrices W1 , ... , Wl ∈ St ( d , D ) and a sequence of weights w1 , ... , wl > 0 , the Stiefel center-of-mass with respect to the distance d ( W1 , W2 ) on St ( d , D ) is defined as a matrix Wc = W Stc ( W1 , ... , Wl ; w1 , ... , wl ) ∈ St ( d , D ) such that Wc = W St c ( W1 , ... , Wl ; w1 , ... , wl ) ≡ arg min W∈St ( d , D ) l∑ j=1 wjd 2 ( W , Wj ) . ( 4 ) Similarly , if the corresponding equivalent classes are [ W1 ] , ... , [ Wl ] ∈ Gr ( d , D ) , then the Grassmann center-of-mass with respect to the distance d ( [ W1 ] , [ W2 ] ) on Gr ( d , D ) is defined as the equivalence class [ Wc ] , where Wc = WGrc ( W1 , ... , Wl ; w1 , ... , wl ) ∈ St ( d , D ) is such that Wc = W Gr c ( W1 , ... , Wl ; w1 , ... , wl ) ≡ arg min W∈St ( d , D ) l∑ j=1 wjd 2 ( [ W ] , [ Wj ] ) . ( 5 ) The distances d ( W1 , W2 ) or d ( [ W1 ] , [ W2 ] ) can be taken in different ways . For example , for W1 , W2 ∈ St ( d , D ) , one way is to consider d ( W1 , W2 ) = dF ( W1 , W2 ) = ‖W1 −W2‖F , the matrix Frobenius norm of W1 −W2 . One can also take a more intrinsic distance , such as the geodesic distance between W1 and W2 on the manifold St ( d , D ) with the metric given by embedded geometry ( see Edleman et al . ( 1999 ) ) . For [ W1 ] , [ W2 ] ∈ Gr ( d , D ) , one way is to consider the projected Frobenius norm d ( [ W1 ] , [ W2 ] ) = dpF ( [ W1 ] , [ W2 ] ) = 2−1/2‖W1WT1 −W2WT2 ‖F . There are also many other choices , such as using the principle angles between the subspaces , chordal norms , or other types of Frobenius norms ( see Edleman et al . ( 1999 , Section 4.3 ) ) . With respect to matrix Frobenius norm and projected Frobenius norm , the Stiefel and Grassmann center-of-masses can be calculated explicitly in the following theorems . Theorem 1 ( Stiefel center-of-mass with respect to Frobenius norm ) We consider the singular value decomposition of the matrix ∑l j=1 wjWj = O1∆O2 , where O1 ∈ O ( D ) and O2 ∈ O ( d ) , ∆ = ( diag ( λ1 , ... , λd ) d×d 0 ( D−d ) ×d ) and λ1 ≥ ... ≥ λd ≥ 0 are the singular values . Then the Stiefel center-of-mass with respect to the distance given by Frobenius norm d ( W1 , W2 ) = ‖W1−W2‖F is given by Wc = O1ΛO2 where Λ = ( diag ( 1 , ... , 1 ) d×d 0 ( D−d ) ×d ) . Theorem 2 ( Grassmann center-of-mass with respect to projected Frobenius norm ) Set Ωj = ( ∑l j=1 wj ) −1 wj . We consider the singular value decomposition of the symmetric matrix l∑ j=1 ΩjWjW T j = Q∆Q T where Q ∈ O ( D ) and ∆ = diag ( σ21 , ... , σ2D ) , σ21 ≥ ... ≥ σ2D ≥ 0 . Then the Grassmann center-of-mass with respect to the distance given by projected Frobenius norm dpF ( [ W1 ] , [ W2 ] ) = 2−1/2‖W1WT1 − W2WT2 ‖F is the equivalence class [ Wc ] determined by Wc = QΛ , where Λ = ( diag ( 1 , ... , 1 ) d×d 0 ( D−d ) ×d ) . 4 SIM-I : INTERPOLATING THE LPP MODEL FAMILY Recall that we have developed a piece-wise linear embedding model f ( x ) : RD → Rd over the data set X = { x1 , ... , xn } . The embedding f ( x ) corresponds to a family of subspace indexing models W1 , ... , W2h ∈ St ( d , D ) ( e.g . for PCA signal recovery tasks ) or [ W1 ] , ... , [ W2h ] ∈ Gr ( d , D ) ( e.g . for classification tasks ) . Each subspace model Wk is built from LPP embedding using the subset Ck ⊂ X developed from k-d tree and h is the depth tree . Given a test point x ∈ RD that does not lie in X , we can map it to the low-dimensional embedding f ( x ) = WTk ( x ) x ∈ R d. The index k ( x ) corresponds to the subset Ck ( x ) that lie closest to x . In practice , we can first compute the means mk over all the data points in the subset Ck for each k = 1 , 2 , ... , 2h and sort the distances ‖x−mk‖ in ascending order ‖x−mk1 ( x ) ‖ ≤ ... ≤ ‖x−mk2h ( x ) ‖ , { k1 ( x ) , ... , k2h ( x ) } = { 1 , ... , 2 h } . We then take k ( x ) = k1 ( x ) to be the index k corresponding to the shortest distance . This is effective when the test point x lies significantly close to one of the subsets Ck ( x ) , see Figure 2 ( a ) . Algorithm 1 SIM-I : Subspace Indexing Model with Interpolation 1 : Input : Data set X = { x1 , ... , xn ∈ RD } and its corresponding affinity matrix S = ( sij ) 1≤i , j≤n ; test point x ∈ RD ; threshold ratio rthr > 1 ; tree depth h ; parameter K > 0 2 : Using an initial PCA and a k-d tree based partition scheme , decompose the data set X into subsets C1 , ... , C2h , where h is the depth of the tree 3 : For each subset Ck , calculate its mean ( center ) mk ∈ RD and its LPP embedding matrix Wk ∈ St ( d , D ) based on the affinity matrix S 4 : Sort the distances ‖x − mk‖ in ascending order ‖x − mk1 ( x ) ‖ ≤ ... ≤ ‖x − mk2h ( x ) ‖ , { k1 ( x ) , ... , k2h ( x ) } = { 1 , ... , 2h } 5 : Determine I , which is the first sub-index i of ki ( x ) such that ‖x−mkI+1 ( x ) ‖ > rthr‖x−mk1 ( x ) ‖ 6 : Set ji ( x ) = ki ( x ) for i = 1 , 2 , ... , I and obtain the embedding matrices Wj1 ( x ) , ... , WjI ( x ) ∈ St ( d , D ) or their corresponding subspaces [ Wj1 ( x ) ] , ... , [ WjI ( x ) ] ∈ Gr ( d , D ) , together with the weights wi = exp ( −K‖x−mji ( x ) ‖2 ) > 0 for i = 1 , ... , I 7 : Find a center-of-mass Wc = W Stc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ( Stiefel case ) or [ Wc ] = [ WGrc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ] ( Grassmann case ) according to Definition 3 and Theorems 1 and 2 . 8 : Output : The low-dimensional embedding f ( x ) = WTc x ∈ Rd However , for a general test point x ∈ RD , it might happen that this point lies at approximately the same distances to the centers of each of the several different subsets adjacent to x ( see Figure 2 ( b ) ) . In this case , we aim to interpolate between several subspace indexing modelsWj1 ( x ) , ... , WjI ( x ) . To do this , we first find the subspace indexes j1 ( x ) , ... , jI ( x ) from the first I subsets Cj1 ( x ) , ... , CjI ( x ) closest to x , i.e. , j1 ( x ) = k1 ( x ) , ... , jI ( x ) = kI ( x ) given the sorted distances ‖x−mk‖ mentioned above . In practice , the number I = I ( x ) is depending on x and can be chosen in the following way : I is the first sub-index i of ki ( x ) such that ‖x−mkI+1 ( x ) ‖ > rthr‖x−mk1 ( x ) ‖ , where rthr > 1 is a threshold ratio that can be tuned . We then pick the weights aswi = exp ( −K‖x−mji ( x ) ‖2 ) for some K > 0 and i = 1 , 2 , ... , I . This is indicating that the closer x is to Cji ( x ) , the heavier weights we assign to Wji ( x ) in the interpolation process . Given the embedding matrices Wj1 ( x ) , ... , WjI ( x ) ∈ St ( d , D ) or their corresponding subspaces [ Wj1 ( x ) ] , ... , [ WjI ( x ) ] ∈ Gr ( d , D ) , together with the weights w1 , ... , wI > 0 , we find a center-of-mass Wc = W Stc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ( Stiefel case ) or [ Wc ] = [ WGrc ( Wj1 ( x ) , ... , WjI ( x ) ; w1 , ... , wI ) ] ( Grassmann case ) according to Definition 3 and Theorems 1 and 2 . Finally , we map the test point x to the low-dimensional embedding f ( x ) = WTc x ∈ Rd . Notice that when I = 1 , the interpolation procedure reduces to projecting x using Wk1 ( x ) calculated from LPP analysis on the closest subset only . In general , the whole interpolation procedure can be regarded as providing a regularized version of the piece-wise linear embedding we discussed in Section 2 ( also see Figure 1 ) . We summarize our interpolation method as the SIM-I Algorithm 1 .
The authors propose an approach towards computing globally non-linear, low-dimensional embeddings of high dimensional data. In particular, they consider a sub-space indexing model with interpolation (called SIM-I) which consists of two steps. First, a locally linear model of the data is generated (using kD-trees and PCA) and second, averaging operations on the respective projection matrices are carried out. These are computed based on center of mass computations on Stiefel or Grasammanian manifolds. Anectdotal experimental evidence shows that this approach outperforms simple baseline techniques.
SP:f14bb4150e95fa83a686a9a4b879cda9fc40a7bf
Compositional Video Synthesis with Action Graphs
1 INTRODUCTION . Learning to generate visual content is a fundamental task in computer vision , with numerous applications from sim-to-real training of autonomous agents , to creating visuals for games and movies . While the quality of generating still images has leaped forward recently ( Karras et al. , 2020 ; Brock et al. , 2019 ) , generating videos is much harder . Generating actions and interactions is perhaps the most challenging aspect of conditional video generation . Actions create long-range spatio-temporal dependencies between people and the objects they interact with . For example , when a player passes a ball , the entire movement sequence of all entities ( thrower , ball , receiver ) must be coordinated and carefully timed . The current paper focuses on this difficult obstacle , the task of generating coordinated and timed actions , as an important step towards generating videos of complex scenes . Current approaches for conditional video generation are not well suited to condition the generation on actions . First , future video prediction ( Ye et al. , 2019 ; Watters et al. , 2017 ) , generates future frames based on an initial input frame , but a first frame can not be used to predict coordinated actions . Second , in video-to-video , the goal is to translate a sequence of semantic masks into an output video . However , segmentation maps contain only class information , and thus do not explicitly capture the action information . As Wang et al . ( 2018a ) notes , this is a limitation that leads to systematic mistakes , such as in the case of car turns . Finally , text-to-video ( Li et al. , 2018 ; Gupta et al. , 2018 ) is potentially useful for generating videos of actions because language can describe complex actions . However , in applications that require a precise description of the scene , language is not ideal due to ambiguities ( MacDonald et al. , 1994 ) or subjectivity of the user ( Wiebe et al. , 2004 ) . Hence , we address this problem with a more structural approach . To provide a better way to condition on actions , we introduce a formalism we call an “ Action Graph ” ( AG ) , propose a new task of “ Action Graph to Video ” ( AG2Vid ) , and present a model for this task . An AG is a graph structure aimed at representing coordinated and timed actions . Its nodes represent objects , and edges represent actions annotated with their start and end time ( Fig . 1 ) . We argue that AGs are an intuitive representation for describing timed actions and would be a natural way to provide precise inputs to generative models . A key advantage of AGs is their ability to describe the dynamics of object actions precisely in a scene . In our AG2Vid task , the input is the initial frame of the video and an AG . Instead of generating the pixels directly , our AG2Vid model uses three levels of abstraction . First , we propose an action scheduling mechanism we call “ Clocked edges ” that tracks the progress of actions in different timesteps . Second , based on this , a graph neural network ( Kipf & Welling , 2016 ) operates on the AGs and predicts a sequence of scene layouts , and finally , pixels are generated conditioned on the predicted layouts . We apply this AG2Vid model to the CATER ( Girdhar & Ramanan , 2020 ) and Something-Something ( Goyal et al. , 2017 ) datasets and show that this approach results in realistic videos that are semantically compliant with the input AG . To further demonstrate the expressiveness of AG representation and the effectiveness of the AG2Vid model , we test how it generalizes to previously unseen compositions of the learned actions . Human raters then confirm the correctness of the generated actions.1 Our contributions are as follows : 1 ) Introducing the formalism of Action Graphs ( AG ) and proposing a new video synthesis task . 2 ) Presenting a novel action-graph-to-video ( AG2Vid ) model for this task . 3 ) Using the AG and AG2Vid model , we show this approach generalizes to the generation of novel compositions of the learned actions . 2 RELATED WORK . Video generation is challenging because videos contain long range dependencies . Recent generation approaches ( Vondrick et al. , 2016 ; Kumar et al. , 2020 ; Denton & Fergus , 2018 ; Lee et al. , 2018 ; Babaeizadeh et al. , 2018 ; Villegas et al. , 2019 ) extended the framework of unconditional image generation to video , based on a latent representation . For example , MoCoGAN ( Tulyakov et al. , 2018 ) disentangles the latent space representations of motion and content to generate a sequence of frames using RNNs ; TGAN ( Saito et al. , 2017 ) generates each frame in a video separately while also having a temporal generator to model dynamics across the frames . Here , we tackle a different problem by aiming to generate videos that comply with AGs . Conditional video generation has attracted considerable interest recently , with focus on two main tasks : video prediction ( Mathieu et al. , 2015 ; Battaglia et al. , 2016 ; Walker et al. , 2016 ; Watters et al. , 2017 ; Kipf et al. , 2018 ; Ye et al. , 2019 ) and video-to-video translation ( Wang et al. , 2019 ; Chan et al. , 2019 ; Siarohin et al. , 2019 ; Kim et al. , 2019 ; Mallya et al. , 2020 ) . In prediction , the goal is to generate future video frames conditioned on few initial frames . For example , it was proposed to train predictors with GANs ( Goodfellow et al. , 2014 ) to predict future pixels ( Mathieu et al. , 2015 ) . However , directly predicting pixels is challenging ( Walker et al. , 2016 ) . Instead of pixels , researchers explored object-centric graphs and perform prediction on these ( Battaglia et al. , 2016 ; Luc et al. , 2018 ; Ye et al. , 2019 ) . While inspired by object-centric representations , our method is different from these works as our generation is goal-oriented , guided by an AG . The video-to-video translation task was proposed by Wang et al . ( 2018a ) , where a natural video was generated from frame-wise semantic segmentation annotations . However , densely labeling pixels for each frame is expensive , and might not even be necessary . Motivated by this , researchers have sought to perform generation conditioned on more accessible signals including audio or text ( Song et al. , 2018 ; Fried 1Our code and models will be released upon acceptance . et al. , 2019 ; Ginosar et al. , 2019 ) . Here , we propose to synthesize videos conditioned on a novel AG , which is easy to obtain compared to semantic segmentation and is a more structured representation compared to natural audio and text . A recent method , HOI-GAN ( HG ) ( Nawhal et al. , 2020b ) , was proposed for the generation task of a single action and object . Specifically , this work addresses the zero-shot setting , and the model is tested on action and object compositions which are first presented at test time . Our focus is on generation of multiple simultaneous actions over time , performed by multiple objects . Our approach directly addresses this challenge via the AG representation and the notion of clocked edges . Various methods have been proposed to generate videos based on input text ( Marwah et al. , 2017 ; Pan et al. , 2017 ; Li et al. , 2018 ) . Most recent methods typically used very short captions which do not contain complex descriptions of actions . For example , ( Li et al. , 2018 ) used video-caption pairs from YouTube , where typical captions are ” playing hockey ” or ” flying a kite ” . Gupta et al . ( 2018 ) proposed the Flinstones animated dataset and introduced the CRAFT model for text-to-video generation . While the CRAFT model relies on text-to-video retrieval , our approach works in an end-to-end manner and aims to accurately synthesize the given input actions . Scene Graphs ( SG ) ( Johnson et al. , 2015 ; 2018 ) are a structured representation that models scenes , where objects are nodes and relations are edges . SGs have been widely used in various tasks including image retrieval ( Johnson et al. , 2015 ; Schuster et al. , 2015 ) , relationship modeling ( Krishna et al. , 2018 ; Schroeder et al. , 2019 ; Raboh et al. , 2020 ) , SG prediction ( Xu et al. , 2017 ; Newell & Deng , 2017 ; Zellers et al. , 2018 ; Herzig et al. , 2018 ) , and image captioning ( Xu et al. , 2019 ) . Recently , SGs have been applied to image generation ( Johnson et al. , 2018 ; Deng et al. , 2018 ; Herzig et al. , 2020 ) , where the goal is to generate a natural image corresponding to the input SG . More generally , spatio-temporal graphs have been explored in the field of action recognition ( Jain et al. , 2016 ; Sun et al. , 2018 ; Wang & Gupta , 2018 ; Yan et al. , 2018 ; Girdhar et al. , 2019 ; Herzig et al. , 2019 ; Materzynska et al. , 2020 ) . For example , a space-time region graph is proposed by ( Wang & Gupta , 2018 ) where object regions are taken as nodes and a GCN ( Kipf & Welling , 2016 ) is applied to perform reasoning across objects for classifying actions . Recently , it was also shown by ( Ji et al. , 2019 ; Yi et al. , 2019 ; Girdhar & Ramanan , 2020 ) that a key obstacle in action recognition is the ability to capture the long-range dependencies and compositionality of actions . While inspired by these approaches , we focus on generating videos which is a very different challenge . Recently , Ji et al . ( 2019 ) presented Action Genome , a new video dataset annotated by SGs . This dataset includes spatio-temporal SG annotations , where for each video , few individual frames were chosen and spatially annotated by SGs . Here , we use the Something-Something V2 ( Goyal et al. , 2017 ) dataset that is larger ( 200K vs. 10K videos ) and more diverse since it includes basic human activities created by a large number of crowd workers . Finally , we propose the Action Graph representation , which we view as a temporal extension of SGs . 3 ACTION GRAPHS . Our goal in this work is to build a model for synthesizing videos that contain a specified set of actions . A key component in this effort is developing a semantic representation to describe the actions performed by different objects in the scene . Towards this end , we introduce a formalism we call Action Graph ( AG ) . In an AG , nodes correspond to objects , and edges correspond to actions that these objects participate in . Objects and actions are annotated by semantic categories , and actions are also annotated by their start and end times . More formally , an AG is a tuple ( C , A , O , E ) described as follows : • An alphabet of object categories C. Categories can be compounded and include attributes . For example “ Blue Cylinder ” or “ Large Box ” . • An alphabet of action categories A . For Example “ Slide ” and “ Rotate ” . Similarly , actions can contain attributes ( e.g. , rotation speed ) . • Object nodes O : A set O ∈ Cn of n objects . • Action edges E : Actions are represented as labeled directed edges between object nodes . Each edge is annotated with an action category and with the time period during which the action is performed . Formally , each edge is of the form ( i , a , j , ts , te ) where i , j ∈ { 1 , ... , n } are object instances , a ∈ A is an action and ts , te ∈ N are action start and end time . Thus , this edge implies that object i ( which has category oi ) performs an action a over object j , and that this action takes place between times ts and te . We note that an AG edge can directly model actions over a single object and a pair of objects . For example , “ Swap the positions of objects i and j between time 0 and 9 ” is an action over two objects corresponding to edge ( i , swap , j , 0 , 9 ) . Some actions , such as “ Rotate ” , involve only one object and will therefore be specified as self-loops .
This paper proposes a generative method (AG2Vid) that generates video conditioned by the first frame, first layout and an action graph. An action graph is defined such that nodes represent objects in the scene and edges represent actions. To capture the temporal dynamics, each pairwise connection is enriched with a time interval to indicate the temporal segment when the action happens. For each time step, the method consists of several stages: First, it creates the layout corresponding to the current time step based on the current graph and previous layout. Then it extracts the optical flow based on the last two layouts and the previous generated frame and finally, it generates the current frame (at pixel level) based on the predicted optical flow and the previous frame. Several metrics, including human evaluation, indicates that the method outperforms powerful baselines on two datasets: CATER and Something-Something v2.
SP:b7192893870580c3821c5baebb643e53ed0ed2cf
Compositional Video Synthesis with Action Graphs
1 INTRODUCTION . Learning to generate visual content is a fundamental task in computer vision , with numerous applications from sim-to-real training of autonomous agents , to creating visuals for games and movies . While the quality of generating still images has leaped forward recently ( Karras et al. , 2020 ; Brock et al. , 2019 ) , generating videos is much harder . Generating actions and interactions is perhaps the most challenging aspect of conditional video generation . Actions create long-range spatio-temporal dependencies between people and the objects they interact with . For example , when a player passes a ball , the entire movement sequence of all entities ( thrower , ball , receiver ) must be coordinated and carefully timed . The current paper focuses on this difficult obstacle , the task of generating coordinated and timed actions , as an important step towards generating videos of complex scenes . Current approaches for conditional video generation are not well suited to condition the generation on actions . First , future video prediction ( Ye et al. , 2019 ; Watters et al. , 2017 ) , generates future frames based on an initial input frame , but a first frame can not be used to predict coordinated actions . Second , in video-to-video , the goal is to translate a sequence of semantic masks into an output video . However , segmentation maps contain only class information , and thus do not explicitly capture the action information . As Wang et al . ( 2018a ) notes , this is a limitation that leads to systematic mistakes , such as in the case of car turns . Finally , text-to-video ( Li et al. , 2018 ; Gupta et al. , 2018 ) is potentially useful for generating videos of actions because language can describe complex actions . However , in applications that require a precise description of the scene , language is not ideal due to ambiguities ( MacDonald et al. , 1994 ) or subjectivity of the user ( Wiebe et al. , 2004 ) . Hence , we address this problem with a more structural approach . To provide a better way to condition on actions , we introduce a formalism we call an “ Action Graph ” ( AG ) , propose a new task of “ Action Graph to Video ” ( AG2Vid ) , and present a model for this task . An AG is a graph structure aimed at representing coordinated and timed actions . Its nodes represent objects , and edges represent actions annotated with their start and end time ( Fig . 1 ) . We argue that AGs are an intuitive representation for describing timed actions and would be a natural way to provide precise inputs to generative models . A key advantage of AGs is their ability to describe the dynamics of object actions precisely in a scene . In our AG2Vid task , the input is the initial frame of the video and an AG . Instead of generating the pixels directly , our AG2Vid model uses three levels of abstraction . First , we propose an action scheduling mechanism we call “ Clocked edges ” that tracks the progress of actions in different timesteps . Second , based on this , a graph neural network ( Kipf & Welling , 2016 ) operates on the AGs and predicts a sequence of scene layouts , and finally , pixels are generated conditioned on the predicted layouts . We apply this AG2Vid model to the CATER ( Girdhar & Ramanan , 2020 ) and Something-Something ( Goyal et al. , 2017 ) datasets and show that this approach results in realistic videos that are semantically compliant with the input AG . To further demonstrate the expressiveness of AG representation and the effectiveness of the AG2Vid model , we test how it generalizes to previously unseen compositions of the learned actions . Human raters then confirm the correctness of the generated actions.1 Our contributions are as follows : 1 ) Introducing the formalism of Action Graphs ( AG ) and proposing a new video synthesis task . 2 ) Presenting a novel action-graph-to-video ( AG2Vid ) model for this task . 3 ) Using the AG and AG2Vid model , we show this approach generalizes to the generation of novel compositions of the learned actions . 2 RELATED WORK . Video generation is challenging because videos contain long range dependencies . Recent generation approaches ( Vondrick et al. , 2016 ; Kumar et al. , 2020 ; Denton & Fergus , 2018 ; Lee et al. , 2018 ; Babaeizadeh et al. , 2018 ; Villegas et al. , 2019 ) extended the framework of unconditional image generation to video , based on a latent representation . For example , MoCoGAN ( Tulyakov et al. , 2018 ) disentangles the latent space representations of motion and content to generate a sequence of frames using RNNs ; TGAN ( Saito et al. , 2017 ) generates each frame in a video separately while also having a temporal generator to model dynamics across the frames . Here , we tackle a different problem by aiming to generate videos that comply with AGs . Conditional video generation has attracted considerable interest recently , with focus on two main tasks : video prediction ( Mathieu et al. , 2015 ; Battaglia et al. , 2016 ; Walker et al. , 2016 ; Watters et al. , 2017 ; Kipf et al. , 2018 ; Ye et al. , 2019 ) and video-to-video translation ( Wang et al. , 2019 ; Chan et al. , 2019 ; Siarohin et al. , 2019 ; Kim et al. , 2019 ; Mallya et al. , 2020 ) . In prediction , the goal is to generate future video frames conditioned on few initial frames . For example , it was proposed to train predictors with GANs ( Goodfellow et al. , 2014 ) to predict future pixels ( Mathieu et al. , 2015 ) . However , directly predicting pixels is challenging ( Walker et al. , 2016 ) . Instead of pixels , researchers explored object-centric graphs and perform prediction on these ( Battaglia et al. , 2016 ; Luc et al. , 2018 ; Ye et al. , 2019 ) . While inspired by object-centric representations , our method is different from these works as our generation is goal-oriented , guided by an AG . The video-to-video translation task was proposed by Wang et al . ( 2018a ) , where a natural video was generated from frame-wise semantic segmentation annotations . However , densely labeling pixels for each frame is expensive , and might not even be necessary . Motivated by this , researchers have sought to perform generation conditioned on more accessible signals including audio or text ( Song et al. , 2018 ; Fried 1Our code and models will be released upon acceptance . et al. , 2019 ; Ginosar et al. , 2019 ) . Here , we propose to synthesize videos conditioned on a novel AG , which is easy to obtain compared to semantic segmentation and is a more structured representation compared to natural audio and text . A recent method , HOI-GAN ( HG ) ( Nawhal et al. , 2020b ) , was proposed for the generation task of a single action and object . Specifically , this work addresses the zero-shot setting , and the model is tested on action and object compositions which are first presented at test time . Our focus is on generation of multiple simultaneous actions over time , performed by multiple objects . Our approach directly addresses this challenge via the AG representation and the notion of clocked edges . Various methods have been proposed to generate videos based on input text ( Marwah et al. , 2017 ; Pan et al. , 2017 ; Li et al. , 2018 ) . Most recent methods typically used very short captions which do not contain complex descriptions of actions . For example , ( Li et al. , 2018 ) used video-caption pairs from YouTube , where typical captions are ” playing hockey ” or ” flying a kite ” . Gupta et al . ( 2018 ) proposed the Flinstones animated dataset and introduced the CRAFT model for text-to-video generation . While the CRAFT model relies on text-to-video retrieval , our approach works in an end-to-end manner and aims to accurately synthesize the given input actions . Scene Graphs ( SG ) ( Johnson et al. , 2015 ; 2018 ) are a structured representation that models scenes , where objects are nodes and relations are edges . SGs have been widely used in various tasks including image retrieval ( Johnson et al. , 2015 ; Schuster et al. , 2015 ) , relationship modeling ( Krishna et al. , 2018 ; Schroeder et al. , 2019 ; Raboh et al. , 2020 ) , SG prediction ( Xu et al. , 2017 ; Newell & Deng , 2017 ; Zellers et al. , 2018 ; Herzig et al. , 2018 ) , and image captioning ( Xu et al. , 2019 ) . Recently , SGs have been applied to image generation ( Johnson et al. , 2018 ; Deng et al. , 2018 ; Herzig et al. , 2020 ) , where the goal is to generate a natural image corresponding to the input SG . More generally , spatio-temporal graphs have been explored in the field of action recognition ( Jain et al. , 2016 ; Sun et al. , 2018 ; Wang & Gupta , 2018 ; Yan et al. , 2018 ; Girdhar et al. , 2019 ; Herzig et al. , 2019 ; Materzynska et al. , 2020 ) . For example , a space-time region graph is proposed by ( Wang & Gupta , 2018 ) where object regions are taken as nodes and a GCN ( Kipf & Welling , 2016 ) is applied to perform reasoning across objects for classifying actions . Recently , it was also shown by ( Ji et al. , 2019 ; Yi et al. , 2019 ; Girdhar & Ramanan , 2020 ) that a key obstacle in action recognition is the ability to capture the long-range dependencies and compositionality of actions . While inspired by these approaches , we focus on generating videos which is a very different challenge . Recently , Ji et al . ( 2019 ) presented Action Genome , a new video dataset annotated by SGs . This dataset includes spatio-temporal SG annotations , where for each video , few individual frames were chosen and spatially annotated by SGs . Here , we use the Something-Something V2 ( Goyal et al. , 2017 ) dataset that is larger ( 200K vs. 10K videos ) and more diverse since it includes basic human activities created by a large number of crowd workers . Finally , we propose the Action Graph representation , which we view as a temporal extension of SGs . 3 ACTION GRAPHS . Our goal in this work is to build a model for synthesizing videos that contain a specified set of actions . A key component in this effort is developing a semantic representation to describe the actions performed by different objects in the scene . Towards this end , we introduce a formalism we call Action Graph ( AG ) . In an AG , nodes correspond to objects , and edges correspond to actions that these objects participate in . Objects and actions are annotated by semantic categories , and actions are also annotated by their start and end times . More formally , an AG is a tuple ( C , A , O , E ) described as follows : • An alphabet of object categories C. Categories can be compounded and include attributes . For example “ Blue Cylinder ” or “ Large Box ” . • An alphabet of action categories A . For Example “ Slide ” and “ Rotate ” . Similarly , actions can contain attributes ( e.g. , rotation speed ) . • Object nodes O : A set O ∈ Cn of n objects . • Action edges E : Actions are represented as labeled directed edges between object nodes . Each edge is annotated with an action category and with the time period during which the action is performed . Formally , each edge is of the form ( i , a , j , ts , te ) where i , j ∈ { 1 , ... , n } are object instances , a ∈ A is an action and ts , te ∈ N are action start and end time . Thus , this edge implies that object i ( which has category oi ) performs an action a over object j , and that this action takes place between times ts and te . We note that an AG edge can directly model actions over a single object and a pair of objects . For example , “ Swap the positions of objects i and j between time 0 and 9 ” is an action over two objects corresponding to edge ( i , swap , j , 0 , 9 ) . Some actions , such as “ Rotate ” , involve only one object and will therefore be specified as self-loops .
The paper proposes a hierarchical approach to video synthesis based on Action Graph. Action Graph is a graph representation to describe the dynamics of individual objects. Based on this, the authors proposes an action scheduling mechanism to track the progress of action and then generate the scene layout at each timestamp. Finally, the pixels are generated based on the predicted scene layout. Experiments show that such AG2Vid paradigm can generate images on CATER and Something-Something dataset with a better quality compared to the baselines. It can also generate novel actions, treated by a composition of seen actions.
SP:b7192893870580c3821c5baebb643e53ed0ed2cf
Compositional Video Synthesis with Action Graphs
1 INTRODUCTION . Learning to generate visual content is a fundamental task in computer vision , with numerous applications from sim-to-real training of autonomous agents , to creating visuals for games and movies . While the quality of generating still images has leaped forward recently ( Karras et al. , 2020 ; Brock et al. , 2019 ) , generating videos is much harder . Generating actions and interactions is perhaps the most challenging aspect of conditional video generation . Actions create long-range spatio-temporal dependencies between people and the objects they interact with . For example , when a player passes a ball , the entire movement sequence of all entities ( thrower , ball , receiver ) must be coordinated and carefully timed . The current paper focuses on this difficult obstacle , the task of generating coordinated and timed actions , as an important step towards generating videos of complex scenes . Current approaches for conditional video generation are not well suited to condition the generation on actions . First , future video prediction ( Ye et al. , 2019 ; Watters et al. , 2017 ) , generates future frames based on an initial input frame , but a first frame can not be used to predict coordinated actions . Second , in video-to-video , the goal is to translate a sequence of semantic masks into an output video . However , segmentation maps contain only class information , and thus do not explicitly capture the action information . As Wang et al . ( 2018a ) notes , this is a limitation that leads to systematic mistakes , such as in the case of car turns . Finally , text-to-video ( Li et al. , 2018 ; Gupta et al. , 2018 ) is potentially useful for generating videos of actions because language can describe complex actions . However , in applications that require a precise description of the scene , language is not ideal due to ambiguities ( MacDonald et al. , 1994 ) or subjectivity of the user ( Wiebe et al. , 2004 ) . Hence , we address this problem with a more structural approach . To provide a better way to condition on actions , we introduce a formalism we call an “ Action Graph ” ( AG ) , propose a new task of “ Action Graph to Video ” ( AG2Vid ) , and present a model for this task . An AG is a graph structure aimed at representing coordinated and timed actions . Its nodes represent objects , and edges represent actions annotated with their start and end time ( Fig . 1 ) . We argue that AGs are an intuitive representation for describing timed actions and would be a natural way to provide precise inputs to generative models . A key advantage of AGs is their ability to describe the dynamics of object actions precisely in a scene . In our AG2Vid task , the input is the initial frame of the video and an AG . Instead of generating the pixels directly , our AG2Vid model uses three levels of abstraction . First , we propose an action scheduling mechanism we call “ Clocked edges ” that tracks the progress of actions in different timesteps . Second , based on this , a graph neural network ( Kipf & Welling , 2016 ) operates on the AGs and predicts a sequence of scene layouts , and finally , pixels are generated conditioned on the predicted layouts . We apply this AG2Vid model to the CATER ( Girdhar & Ramanan , 2020 ) and Something-Something ( Goyal et al. , 2017 ) datasets and show that this approach results in realistic videos that are semantically compliant with the input AG . To further demonstrate the expressiveness of AG representation and the effectiveness of the AG2Vid model , we test how it generalizes to previously unseen compositions of the learned actions . Human raters then confirm the correctness of the generated actions.1 Our contributions are as follows : 1 ) Introducing the formalism of Action Graphs ( AG ) and proposing a new video synthesis task . 2 ) Presenting a novel action-graph-to-video ( AG2Vid ) model for this task . 3 ) Using the AG and AG2Vid model , we show this approach generalizes to the generation of novel compositions of the learned actions . 2 RELATED WORK . Video generation is challenging because videos contain long range dependencies . Recent generation approaches ( Vondrick et al. , 2016 ; Kumar et al. , 2020 ; Denton & Fergus , 2018 ; Lee et al. , 2018 ; Babaeizadeh et al. , 2018 ; Villegas et al. , 2019 ) extended the framework of unconditional image generation to video , based on a latent representation . For example , MoCoGAN ( Tulyakov et al. , 2018 ) disentangles the latent space representations of motion and content to generate a sequence of frames using RNNs ; TGAN ( Saito et al. , 2017 ) generates each frame in a video separately while also having a temporal generator to model dynamics across the frames . Here , we tackle a different problem by aiming to generate videos that comply with AGs . Conditional video generation has attracted considerable interest recently , with focus on two main tasks : video prediction ( Mathieu et al. , 2015 ; Battaglia et al. , 2016 ; Walker et al. , 2016 ; Watters et al. , 2017 ; Kipf et al. , 2018 ; Ye et al. , 2019 ) and video-to-video translation ( Wang et al. , 2019 ; Chan et al. , 2019 ; Siarohin et al. , 2019 ; Kim et al. , 2019 ; Mallya et al. , 2020 ) . In prediction , the goal is to generate future video frames conditioned on few initial frames . For example , it was proposed to train predictors with GANs ( Goodfellow et al. , 2014 ) to predict future pixels ( Mathieu et al. , 2015 ) . However , directly predicting pixels is challenging ( Walker et al. , 2016 ) . Instead of pixels , researchers explored object-centric graphs and perform prediction on these ( Battaglia et al. , 2016 ; Luc et al. , 2018 ; Ye et al. , 2019 ) . While inspired by object-centric representations , our method is different from these works as our generation is goal-oriented , guided by an AG . The video-to-video translation task was proposed by Wang et al . ( 2018a ) , where a natural video was generated from frame-wise semantic segmentation annotations . However , densely labeling pixels for each frame is expensive , and might not even be necessary . Motivated by this , researchers have sought to perform generation conditioned on more accessible signals including audio or text ( Song et al. , 2018 ; Fried 1Our code and models will be released upon acceptance . et al. , 2019 ; Ginosar et al. , 2019 ) . Here , we propose to synthesize videos conditioned on a novel AG , which is easy to obtain compared to semantic segmentation and is a more structured representation compared to natural audio and text . A recent method , HOI-GAN ( HG ) ( Nawhal et al. , 2020b ) , was proposed for the generation task of a single action and object . Specifically , this work addresses the zero-shot setting , and the model is tested on action and object compositions which are first presented at test time . Our focus is on generation of multiple simultaneous actions over time , performed by multiple objects . Our approach directly addresses this challenge via the AG representation and the notion of clocked edges . Various methods have been proposed to generate videos based on input text ( Marwah et al. , 2017 ; Pan et al. , 2017 ; Li et al. , 2018 ) . Most recent methods typically used very short captions which do not contain complex descriptions of actions . For example , ( Li et al. , 2018 ) used video-caption pairs from YouTube , where typical captions are ” playing hockey ” or ” flying a kite ” . Gupta et al . ( 2018 ) proposed the Flinstones animated dataset and introduced the CRAFT model for text-to-video generation . While the CRAFT model relies on text-to-video retrieval , our approach works in an end-to-end manner and aims to accurately synthesize the given input actions . Scene Graphs ( SG ) ( Johnson et al. , 2015 ; 2018 ) are a structured representation that models scenes , where objects are nodes and relations are edges . SGs have been widely used in various tasks including image retrieval ( Johnson et al. , 2015 ; Schuster et al. , 2015 ) , relationship modeling ( Krishna et al. , 2018 ; Schroeder et al. , 2019 ; Raboh et al. , 2020 ) , SG prediction ( Xu et al. , 2017 ; Newell & Deng , 2017 ; Zellers et al. , 2018 ; Herzig et al. , 2018 ) , and image captioning ( Xu et al. , 2019 ) . Recently , SGs have been applied to image generation ( Johnson et al. , 2018 ; Deng et al. , 2018 ; Herzig et al. , 2020 ) , where the goal is to generate a natural image corresponding to the input SG . More generally , spatio-temporal graphs have been explored in the field of action recognition ( Jain et al. , 2016 ; Sun et al. , 2018 ; Wang & Gupta , 2018 ; Yan et al. , 2018 ; Girdhar et al. , 2019 ; Herzig et al. , 2019 ; Materzynska et al. , 2020 ) . For example , a space-time region graph is proposed by ( Wang & Gupta , 2018 ) where object regions are taken as nodes and a GCN ( Kipf & Welling , 2016 ) is applied to perform reasoning across objects for classifying actions . Recently , it was also shown by ( Ji et al. , 2019 ; Yi et al. , 2019 ; Girdhar & Ramanan , 2020 ) that a key obstacle in action recognition is the ability to capture the long-range dependencies and compositionality of actions . While inspired by these approaches , we focus on generating videos which is a very different challenge . Recently , Ji et al . ( 2019 ) presented Action Genome , a new video dataset annotated by SGs . This dataset includes spatio-temporal SG annotations , where for each video , few individual frames were chosen and spatially annotated by SGs . Here , we use the Something-Something V2 ( Goyal et al. , 2017 ) dataset that is larger ( 200K vs. 10K videos ) and more diverse since it includes basic human activities created by a large number of crowd workers . Finally , we propose the Action Graph representation , which we view as a temporal extension of SGs . 3 ACTION GRAPHS . Our goal in this work is to build a model for synthesizing videos that contain a specified set of actions . A key component in this effort is developing a semantic representation to describe the actions performed by different objects in the scene . Towards this end , we introduce a formalism we call Action Graph ( AG ) . In an AG , nodes correspond to objects , and edges correspond to actions that these objects participate in . Objects and actions are annotated by semantic categories , and actions are also annotated by their start and end times . More formally , an AG is a tuple ( C , A , O , E ) described as follows : • An alphabet of object categories C. Categories can be compounded and include attributes . For example “ Blue Cylinder ” or “ Large Box ” . • An alphabet of action categories A . For Example “ Slide ” and “ Rotate ” . Similarly , actions can contain attributes ( e.g. , rotation speed ) . • Object nodes O : A set O ∈ Cn of n objects . • Action edges E : Actions are represented as labeled directed edges between object nodes . Each edge is annotated with an action category and with the time period during which the action is performed . Formally , each edge is of the form ( i , a , j , ts , te ) where i , j ∈ { 1 , ... , n } are object instances , a ∈ A is an action and ts , te ∈ N are action start and end time . Thus , this edge implies that object i ( which has category oi ) performs an action a over object j , and that this action takes place between times ts and te . We note that an AG edge can directly model actions over a single object and a pair of objects . For example , “ Swap the positions of objects i and j between time 0 and 9 ” is an action over two objects corresponding to edge ( i , swap , j , 0 , 9 ) . Some actions , such as “ Rotate ” , involve only one object and will therefore be specified as self-loops .
This paper proposes a model for video generation which disentangles the object layout prediction, frame-by-frame, from the actual pixelwise frame generation. A so-called Action Graph (AG) is used as specification of the video to be generated, rather than a sentence. Action graphs model objects as nodes and actions as clocked edges. This way action graphs are "clocked" so to take into account the current progress of each action. A Graph Convolutional Network (GCN) is used to process the action graph and predict the next layout. The GCN is fed with the previous layout and the current AG. The final frame is generated by warping the previous frame and predicting an additive signal to the warped output. The network is trained similarly to a GAN.
SP:b7192893870580c3821c5baebb643e53ed0ed2cf
Concentric Spherical GNN for 3D Representation Learning
Learning 3D representations of point clouds that generalize well to arbitrary orientations is a challenge of practical importance in problems ranging from computer vision to molecular modeling . The proposed approach is based on a concentric spherical representation of 3D space , formed by nesting spatially-sampled spheres resulting from the highly regular icosahedral discretization . We propose separate intra-sphere and inter-sphere convolutions over the resulting concentric spherical grid , which are combined into a convolutional framework for learning volumetric and rotationally equivariant representations over point clouds . We demonstrate the effectiveness of our approach for 3D object classification , and towards resolving the electronic structure of atomistic systems . 1 INTRODUCTION . 3D point cloud data appear in domains ranging from computer vision , geographic information systems , and molecular modeling . Learning suitable representations of point clouds for data-driven modeling is well-motivated by applications like automonous vehicles and molecular simulation . It is important and yet challenging to learn representations that generalize well to arbitrary orientations of point clouds , in an efficient and accurate manner . Spherical Convolutional Neural Networks ( CNNs ) were introduced in Cohen et al . ( 2018 ) and Esteves et al . ( 2018 ) to address the challenge of rotations for spherical images , by defining rotationally equivariant convolutions in harmonic-space . Convolutions equivariant to transformations ( such as translation ) underpins recognizable aspects of 2D CNNs such as effective filter sharing and feature localization , a key reason for their success Cohen & Welling ( 2016 ) . However , Spherical CNNs operate over data projected onto the spherical manifold , which is lossy for general 3D point cloud data . It is desirable to learn features volumetrically , in order to accurately detect patterns in complex 3D shapes , or incorporate spatial relationships between atoms in describing atomic environments . We show that it is more expressive and general to operate over an underlying spatial representation of concentric spheres , demonstrated experimentally . We propose a new spatial structure consisting of multiple nested spheres , each discretized by the icosahedral grid . This structure is used to record both the angular and radial distribution of input points , as volumetric information . The icosahedral grid produces a highly regular sampling of the sphere , which permits efficient convolutions scaling linearly with spherical resolution , explored in Jiang et al . ( 2019 ) , Cohen et al . ( 2019 ) , and Defferrard et al . ( 2020 ) . We then propose two types of convolution for learning over the concentric spherical structure , by separately learning intra-sphere and inter-sphere features . We formulate intra-sphere convolution in terms of graphbased convolution over localized intra-sphere neighborhoods , and inter-sphere convolution as 1D convolution over co-radial grid points . The resulting convolutions are both rotationally equivariant and scalable , each scaling ( near ) linearly with respect to the size of the grid . Finally , we incorporate the proposed convolutions into a hierarchical and multi-resolution architecture , CSGNN , for learning over concentric spherical feature maps , and demonstrate its applicability to point cloud data . We first apply our approach to the problem of classifying rotated 3D objects sampled by point clouds , achieving state-of-the-art performance on the task . We further apply our approach to a problem of molecular modeling , namely predicting the electronic density of states of materials . The density of states is a fundamental property of electronic structure , used in determining total energy contributions . Our approach is applied to learn localized descriptions of atomic environments , enabling more accurate resolution of the band energy of carbon-based materials compared to previous approaches . The implementation of our methods and experiments are publicly available 1 . In summary , our primary contributions are as follows : 1 . We propose a new volumetric representation as the basis for convolutional learning . This representation consists of multiple nested spheres , each discretized by the icosahedral grid . 2 . We introduce a novel architecture for learning volumetric representation over concentric spheres by combining intra-sphere and inter-sphere convolutions . The proposed convolutions are rotationally equivariant , and also scale ( near ) linearly with grid resolution . 3 . We demonstrate the applicability of our approach through experiments in 3D object classification , and resolving electronic structure of atomistic systems . 2 BACKGROUND AND RELATED WORK . The goal of learning representations of general 3D point cloud data has led to a diverse body of work for structured learning ( Maturana & Scherer , 2015 ; Qi et al. , 2017a ; b ; Wang et al. , 2019 ; Thomas et al. , 2019 ; Zhang et al. , 2019b ) . However , the main problem shared by these methods is that they do not generalize well to general rotations of the data , which can lead to catastrophic loss of performance when they are encountered . Augmenting training with rotated data helps bridge the gap somewhat , but a significant performance gap remains . The key missing piece in many earlier work is their lack of rotationally equivariant model design . A model layer is equivariant to rotation if it commutes with rotation . In other words , feeding a rotated input to the model layer is same as feeding the original input to the layer and rotating its output . A rotationally invariant layer is a special case of an equivariant layer where rotation does not affect the output space of the layer . Several models have been proposed which exclusively use rotationally invariant layers ( Schütt et al. , 2017 ; Gilmer et al. , 2017 ; Schütt et al. , 2017 ; Chen et al. , 2019 ; Zhang et al. , 2019a ; Poulenard et al. , 2019 ; Kim et al. , 2020 ) . However , using invariant layers through the entirety of model is unnecessarily restrictive , as important information about the underlying spatial structure of the data may be lost . Our work focuses on designing rotationally equivariant layers as primary building blocks , while invariant layer ( s ) can be used before final output to achieve overall invariance of the model . This design has already seen extension to other structures and learning strategies relevant to point cloud representation . Thomas et al . ( 2018 ) proposed rotation equivariant point-wise convolutions for 3D graphs , but their approach has difficulty scaling to point clouds beyond the scale of small molecules . Equivariant design has also seen extension to spherical images through Spherical CNNs ( Cohen et al. , 2018 ; Esteves et al. , 2018 ; Jiang et al. , 2019 ; Cohen et al. , 2019 ; Rao et al. , 2019 ; Defferrard et al. , 2020 ; Yang et al. , 2020 ) . However , they are not well-suited for direct application to point clouds . Their key limitation is loss of information in constraining spatial representation from 3D domain to a 2D ( spherical ) manifold . Our work overcomes this limitation by proposing convolutional learning over concentric spheres , achieving rotationally equivariant 3D feature learning with scalable convolutions . 3 ARCHITECTURE DESIGN . The primary goal of our proposed approach is to learn volumetric representations of 3D point clouds in a rotationally equivariant and also scalable manner . To achieve this goal , we propose concentric spheres at different radii , each discretized by the icosahedral grid . The proposed construction naturally organizes 3D data by angular and radial distribution , where the resolution of each component can be controlled independently . We use the icosahedral grid as it results in a highly regular sampling of the sphere . The former permits efficient use of spatial resolution , and the later results in design of efficient and rotationally-equivariant convolutions . We propose using two separate convolutions together to learn volumetric features over concentric spheres : ( 1 ) graph-based convolution to incorporate information within spheres , and ( 2 ) radial convolutions to separately incorporate information between spheres . The proposed convolutions are extended to different spatial scales via pooling based on regular properties of the icosahedral grid , resulting in the proposed hierarchical convolutional architecture of Fig . 1 . We explain each component of our model in more detail in subsequent sections , and pooling in A.5 of Appendix . 1https : //github.com/anonymous10521/CSGNN 3.1 CONCENTRIC SPHERICAL DISCRETIZATION AND POINT CLOUD MAPPING . In this section we explain in detail our method of volumetric discretization by concentric spheres . We further present our approach to converting arbitrary point cloud data to initial feature channels over this spatial structure . Concentric Icosahedral Spheres . The initial icosahedron has 12 vertices forming 20 equilateral triangular faces . To increase grid resolution , each face can be sub-divided , with resolution scaling as |V | = 10 ∗ 4l + 2 ( l is target discretization level ) . See Fig . 3a for an illustration of this process . We implement concentric spheres by stacking R identical icosahedral grids to form the radial dimension , shown in Fig . 3b . Assuming normalization to unit radius , we uniformly assign concentric spheres at radii [ 1R , 2 R , ... , 1 ] . Assuming single-channel feature map , the resulting grid is the matrix H ∈ RR×|V | , where each vertex is indexed by the sphere it belongs to , and its position on the sphere . The resulting volumetric representation has several noteworthy properties . First , the icosahedral discretization results in a highly regular spatial sampling within each sphere . This allows more efficient use of spatial resolution compared to polar grids used in earlier works ( Cohen et al. , 2018 ; Esteves et al. , 2018 ; You et al. , 2020 ) , which have have resolution bias towards the polar regions . Second , spatial resolution is not uniform across different spheres , as the proposed construction results in higher sampling density closer to the center . However , this non-uniformity difference is largely accounted for as a function of the radius of the sphere , and does not inhibit the design of efficient and rotationally equivariant convolutions . Point Cloud to Concentric Spheres . We now consider the problem of describing a point cloud P ∈ RN×3 in terms of concentric spherical feature map H ∈ RR×|V |×C , where C is number of channels . While the concentric grid representation is defined discretely , the space point positions are continuous , which we would like to capture . To do so , we summarize the contribution of points using the Gaussian radial basis function ( RBF ) : f ( x ) = N∑ j=1 φ ( ||x− Pj ||22 ) ( 1 ) N is the number of data points , and the function φ = exp ( −γr2 ) is parameterized by the bandwidth γ . In practice we limit computation to a local neighborhood ( instead of considering all points ) and choose γ accordingly . We refer to Fig . 2 for illustrative example of the conversion , and Sec . A.6 for implementation details as applied in experiments . We determine the input channels C by grouping concentric spheres and concatenating features of co-radial vertices , also shown in Fig . 2 . Suppose converting the point cloud results in a singlechannel feature tensor H′ ∈ RR′×|V | , where R′ is the initial number of spheres . Grouping the features from co-radial vertices across R groups results in feature tensor H ∈ RR×|V |×R ′ R , where R is the number of spheres represented spatially , and R ′ R is the number of spheres represented via input channels . The proposed grouping mechanism gives flexibility to significantly increase radial resolution without correspondingly increasing the size of the spatial grid , which persists across convolutions . This enables balancing between computational efficiency and the representational boost of having additional spheres .
This paper presents a novel multi-sphere icosahedral discretization for representation of 3D data. Given meshes or point cloud, the authors map them to multiple layers spheres and apply graph conv on the spheres to learn rotation-invariant features. In the final stage, all the layers are merged via a radial pool operator. The authors claim that such a structure could better preserve information of 3D objects and showcase on mesh and point cloud classification tasks.
SP:797f40f8ab27a0ce589b18ec143e398b6b44a460
Concentric Spherical GNN for 3D Representation Learning
Learning 3D representations of point clouds that generalize well to arbitrary orientations is a challenge of practical importance in problems ranging from computer vision to molecular modeling . The proposed approach is based on a concentric spherical representation of 3D space , formed by nesting spatially-sampled spheres resulting from the highly regular icosahedral discretization . We propose separate intra-sphere and inter-sphere convolutions over the resulting concentric spherical grid , which are combined into a convolutional framework for learning volumetric and rotationally equivariant representations over point clouds . We demonstrate the effectiveness of our approach for 3D object classification , and towards resolving the electronic structure of atomistic systems . 1 INTRODUCTION . 3D point cloud data appear in domains ranging from computer vision , geographic information systems , and molecular modeling . Learning suitable representations of point clouds for data-driven modeling is well-motivated by applications like automonous vehicles and molecular simulation . It is important and yet challenging to learn representations that generalize well to arbitrary orientations of point clouds , in an efficient and accurate manner . Spherical Convolutional Neural Networks ( CNNs ) were introduced in Cohen et al . ( 2018 ) and Esteves et al . ( 2018 ) to address the challenge of rotations for spherical images , by defining rotationally equivariant convolutions in harmonic-space . Convolutions equivariant to transformations ( such as translation ) underpins recognizable aspects of 2D CNNs such as effective filter sharing and feature localization , a key reason for their success Cohen & Welling ( 2016 ) . However , Spherical CNNs operate over data projected onto the spherical manifold , which is lossy for general 3D point cloud data . It is desirable to learn features volumetrically , in order to accurately detect patterns in complex 3D shapes , or incorporate spatial relationships between atoms in describing atomic environments . We show that it is more expressive and general to operate over an underlying spatial representation of concentric spheres , demonstrated experimentally . We propose a new spatial structure consisting of multiple nested spheres , each discretized by the icosahedral grid . This structure is used to record both the angular and radial distribution of input points , as volumetric information . The icosahedral grid produces a highly regular sampling of the sphere , which permits efficient convolutions scaling linearly with spherical resolution , explored in Jiang et al . ( 2019 ) , Cohen et al . ( 2019 ) , and Defferrard et al . ( 2020 ) . We then propose two types of convolution for learning over the concentric spherical structure , by separately learning intra-sphere and inter-sphere features . We formulate intra-sphere convolution in terms of graphbased convolution over localized intra-sphere neighborhoods , and inter-sphere convolution as 1D convolution over co-radial grid points . The resulting convolutions are both rotationally equivariant and scalable , each scaling ( near ) linearly with respect to the size of the grid . Finally , we incorporate the proposed convolutions into a hierarchical and multi-resolution architecture , CSGNN , for learning over concentric spherical feature maps , and demonstrate its applicability to point cloud data . We first apply our approach to the problem of classifying rotated 3D objects sampled by point clouds , achieving state-of-the-art performance on the task . We further apply our approach to a problem of molecular modeling , namely predicting the electronic density of states of materials . The density of states is a fundamental property of electronic structure , used in determining total energy contributions . Our approach is applied to learn localized descriptions of atomic environments , enabling more accurate resolution of the band energy of carbon-based materials compared to previous approaches . The implementation of our methods and experiments are publicly available 1 . In summary , our primary contributions are as follows : 1 . We propose a new volumetric representation as the basis for convolutional learning . This representation consists of multiple nested spheres , each discretized by the icosahedral grid . 2 . We introduce a novel architecture for learning volumetric representation over concentric spheres by combining intra-sphere and inter-sphere convolutions . The proposed convolutions are rotationally equivariant , and also scale ( near ) linearly with grid resolution . 3 . We demonstrate the applicability of our approach through experiments in 3D object classification , and resolving electronic structure of atomistic systems . 2 BACKGROUND AND RELATED WORK . The goal of learning representations of general 3D point cloud data has led to a diverse body of work for structured learning ( Maturana & Scherer , 2015 ; Qi et al. , 2017a ; b ; Wang et al. , 2019 ; Thomas et al. , 2019 ; Zhang et al. , 2019b ) . However , the main problem shared by these methods is that they do not generalize well to general rotations of the data , which can lead to catastrophic loss of performance when they are encountered . Augmenting training with rotated data helps bridge the gap somewhat , but a significant performance gap remains . The key missing piece in many earlier work is their lack of rotationally equivariant model design . A model layer is equivariant to rotation if it commutes with rotation . In other words , feeding a rotated input to the model layer is same as feeding the original input to the layer and rotating its output . A rotationally invariant layer is a special case of an equivariant layer where rotation does not affect the output space of the layer . Several models have been proposed which exclusively use rotationally invariant layers ( Schütt et al. , 2017 ; Gilmer et al. , 2017 ; Schütt et al. , 2017 ; Chen et al. , 2019 ; Zhang et al. , 2019a ; Poulenard et al. , 2019 ; Kim et al. , 2020 ) . However , using invariant layers through the entirety of model is unnecessarily restrictive , as important information about the underlying spatial structure of the data may be lost . Our work focuses on designing rotationally equivariant layers as primary building blocks , while invariant layer ( s ) can be used before final output to achieve overall invariance of the model . This design has already seen extension to other structures and learning strategies relevant to point cloud representation . Thomas et al . ( 2018 ) proposed rotation equivariant point-wise convolutions for 3D graphs , but their approach has difficulty scaling to point clouds beyond the scale of small molecules . Equivariant design has also seen extension to spherical images through Spherical CNNs ( Cohen et al. , 2018 ; Esteves et al. , 2018 ; Jiang et al. , 2019 ; Cohen et al. , 2019 ; Rao et al. , 2019 ; Defferrard et al. , 2020 ; Yang et al. , 2020 ) . However , they are not well-suited for direct application to point clouds . Their key limitation is loss of information in constraining spatial representation from 3D domain to a 2D ( spherical ) manifold . Our work overcomes this limitation by proposing convolutional learning over concentric spheres , achieving rotationally equivariant 3D feature learning with scalable convolutions . 3 ARCHITECTURE DESIGN . The primary goal of our proposed approach is to learn volumetric representations of 3D point clouds in a rotationally equivariant and also scalable manner . To achieve this goal , we propose concentric spheres at different radii , each discretized by the icosahedral grid . The proposed construction naturally organizes 3D data by angular and radial distribution , where the resolution of each component can be controlled independently . We use the icosahedral grid as it results in a highly regular sampling of the sphere . The former permits efficient use of spatial resolution , and the later results in design of efficient and rotationally-equivariant convolutions . We propose using two separate convolutions together to learn volumetric features over concentric spheres : ( 1 ) graph-based convolution to incorporate information within spheres , and ( 2 ) radial convolutions to separately incorporate information between spheres . The proposed convolutions are extended to different spatial scales via pooling based on regular properties of the icosahedral grid , resulting in the proposed hierarchical convolutional architecture of Fig . 1 . We explain each component of our model in more detail in subsequent sections , and pooling in A.5 of Appendix . 1https : //github.com/anonymous10521/CSGNN 3.1 CONCENTRIC SPHERICAL DISCRETIZATION AND POINT CLOUD MAPPING . In this section we explain in detail our method of volumetric discretization by concentric spheres . We further present our approach to converting arbitrary point cloud data to initial feature channels over this spatial structure . Concentric Icosahedral Spheres . The initial icosahedron has 12 vertices forming 20 equilateral triangular faces . To increase grid resolution , each face can be sub-divided , with resolution scaling as |V | = 10 ∗ 4l + 2 ( l is target discretization level ) . See Fig . 3a for an illustration of this process . We implement concentric spheres by stacking R identical icosahedral grids to form the radial dimension , shown in Fig . 3b . Assuming normalization to unit radius , we uniformly assign concentric spheres at radii [ 1R , 2 R , ... , 1 ] . Assuming single-channel feature map , the resulting grid is the matrix H ∈ RR×|V | , where each vertex is indexed by the sphere it belongs to , and its position on the sphere . The resulting volumetric representation has several noteworthy properties . First , the icosahedral discretization results in a highly regular spatial sampling within each sphere . This allows more efficient use of spatial resolution compared to polar grids used in earlier works ( Cohen et al. , 2018 ; Esteves et al. , 2018 ; You et al. , 2020 ) , which have have resolution bias towards the polar regions . Second , spatial resolution is not uniform across different spheres , as the proposed construction results in higher sampling density closer to the center . However , this non-uniformity difference is largely accounted for as a function of the radius of the sphere , and does not inhibit the design of efficient and rotationally equivariant convolutions . Point Cloud to Concentric Spheres . We now consider the problem of describing a point cloud P ∈ RN×3 in terms of concentric spherical feature map H ∈ RR×|V |×C , where C is number of channels . While the concentric grid representation is defined discretely , the space point positions are continuous , which we would like to capture . To do so , we summarize the contribution of points using the Gaussian radial basis function ( RBF ) : f ( x ) = N∑ j=1 φ ( ||x− Pj ||22 ) ( 1 ) N is the number of data points , and the function φ = exp ( −γr2 ) is parameterized by the bandwidth γ . In practice we limit computation to a local neighborhood ( instead of considering all points ) and choose γ accordingly . We refer to Fig . 2 for illustrative example of the conversion , and Sec . A.6 for implementation details as applied in experiments . We determine the input channels C by grouping concentric spheres and concatenating features of co-radial vertices , also shown in Fig . 2 . Suppose converting the point cloud results in a singlechannel feature tensor H′ ∈ RR′×|V | , where R′ is the initial number of spheres . Grouping the features from co-radial vertices across R groups results in feature tensor H ∈ RR×|V |×R ′ R , where R is the number of spheres represented spatially , and R ′ R is the number of spheres represented via input channels . The proposed grouping mechanism gives flexibility to significantly increase radial resolution without correspondingly increasing the size of the spatial grid , which persists across convolutions . This enables balancing between computational efficiency and the representational boost of having additional spheres .
In this paper, a multi-resolution convolutional architecture is proposed to learn from concentric feature maps. Different from single sphere representation, both graph convolutions and radial convolutions are employed to extract the intra-sphere and inter-sphere information. Benefit form the radial discretization, the proposed CSGNN achieves state-of-the-art results in testing on arbitrarily rotated data under ModelNet40 dataset. However, there are several drawbacks in the draft, such as ambiguous figure and insufficient ablation study.
SP:797f40f8ab27a0ce589b18ec143e398b6b44a460
Concentric Spherical GNN for 3D Representation Learning
Learning 3D representations of point clouds that generalize well to arbitrary orientations is a challenge of practical importance in problems ranging from computer vision to molecular modeling . The proposed approach is based on a concentric spherical representation of 3D space , formed by nesting spatially-sampled spheres resulting from the highly regular icosahedral discretization . We propose separate intra-sphere and inter-sphere convolutions over the resulting concentric spherical grid , which are combined into a convolutional framework for learning volumetric and rotationally equivariant representations over point clouds . We demonstrate the effectiveness of our approach for 3D object classification , and towards resolving the electronic structure of atomistic systems . 1 INTRODUCTION . 3D point cloud data appear in domains ranging from computer vision , geographic information systems , and molecular modeling . Learning suitable representations of point clouds for data-driven modeling is well-motivated by applications like automonous vehicles and molecular simulation . It is important and yet challenging to learn representations that generalize well to arbitrary orientations of point clouds , in an efficient and accurate manner . Spherical Convolutional Neural Networks ( CNNs ) were introduced in Cohen et al . ( 2018 ) and Esteves et al . ( 2018 ) to address the challenge of rotations for spherical images , by defining rotationally equivariant convolutions in harmonic-space . Convolutions equivariant to transformations ( such as translation ) underpins recognizable aspects of 2D CNNs such as effective filter sharing and feature localization , a key reason for their success Cohen & Welling ( 2016 ) . However , Spherical CNNs operate over data projected onto the spherical manifold , which is lossy for general 3D point cloud data . It is desirable to learn features volumetrically , in order to accurately detect patterns in complex 3D shapes , or incorporate spatial relationships between atoms in describing atomic environments . We show that it is more expressive and general to operate over an underlying spatial representation of concentric spheres , demonstrated experimentally . We propose a new spatial structure consisting of multiple nested spheres , each discretized by the icosahedral grid . This structure is used to record both the angular and radial distribution of input points , as volumetric information . The icosahedral grid produces a highly regular sampling of the sphere , which permits efficient convolutions scaling linearly with spherical resolution , explored in Jiang et al . ( 2019 ) , Cohen et al . ( 2019 ) , and Defferrard et al . ( 2020 ) . We then propose two types of convolution for learning over the concentric spherical structure , by separately learning intra-sphere and inter-sphere features . We formulate intra-sphere convolution in terms of graphbased convolution over localized intra-sphere neighborhoods , and inter-sphere convolution as 1D convolution over co-radial grid points . The resulting convolutions are both rotationally equivariant and scalable , each scaling ( near ) linearly with respect to the size of the grid . Finally , we incorporate the proposed convolutions into a hierarchical and multi-resolution architecture , CSGNN , for learning over concentric spherical feature maps , and demonstrate its applicability to point cloud data . We first apply our approach to the problem of classifying rotated 3D objects sampled by point clouds , achieving state-of-the-art performance on the task . We further apply our approach to a problem of molecular modeling , namely predicting the electronic density of states of materials . The density of states is a fundamental property of electronic structure , used in determining total energy contributions . Our approach is applied to learn localized descriptions of atomic environments , enabling more accurate resolution of the band energy of carbon-based materials compared to previous approaches . The implementation of our methods and experiments are publicly available 1 . In summary , our primary contributions are as follows : 1 . We propose a new volumetric representation as the basis for convolutional learning . This representation consists of multiple nested spheres , each discretized by the icosahedral grid . 2 . We introduce a novel architecture for learning volumetric representation over concentric spheres by combining intra-sphere and inter-sphere convolutions . The proposed convolutions are rotationally equivariant , and also scale ( near ) linearly with grid resolution . 3 . We demonstrate the applicability of our approach through experiments in 3D object classification , and resolving electronic structure of atomistic systems . 2 BACKGROUND AND RELATED WORK . The goal of learning representations of general 3D point cloud data has led to a diverse body of work for structured learning ( Maturana & Scherer , 2015 ; Qi et al. , 2017a ; b ; Wang et al. , 2019 ; Thomas et al. , 2019 ; Zhang et al. , 2019b ) . However , the main problem shared by these methods is that they do not generalize well to general rotations of the data , which can lead to catastrophic loss of performance when they are encountered . Augmenting training with rotated data helps bridge the gap somewhat , but a significant performance gap remains . The key missing piece in many earlier work is their lack of rotationally equivariant model design . A model layer is equivariant to rotation if it commutes with rotation . In other words , feeding a rotated input to the model layer is same as feeding the original input to the layer and rotating its output . A rotationally invariant layer is a special case of an equivariant layer where rotation does not affect the output space of the layer . Several models have been proposed which exclusively use rotationally invariant layers ( Schütt et al. , 2017 ; Gilmer et al. , 2017 ; Schütt et al. , 2017 ; Chen et al. , 2019 ; Zhang et al. , 2019a ; Poulenard et al. , 2019 ; Kim et al. , 2020 ) . However , using invariant layers through the entirety of model is unnecessarily restrictive , as important information about the underlying spatial structure of the data may be lost . Our work focuses on designing rotationally equivariant layers as primary building blocks , while invariant layer ( s ) can be used before final output to achieve overall invariance of the model . This design has already seen extension to other structures and learning strategies relevant to point cloud representation . Thomas et al . ( 2018 ) proposed rotation equivariant point-wise convolutions for 3D graphs , but their approach has difficulty scaling to point clouds beyond the scale of small molecules . Equivariant design has also seen extension to spherical images through Spherical CNNs ( Cohen et al. , 2018 ; Esteves et al. , 2018 ; Jiang et al. , 2019 ; Cohen et al. , 2019 ; Rao et al. , 2019 ; Defferrard et al. , 2020 ; Yang et al. , 2020 ) . However , they are not well-suited for direct application to point clouds . Their key limitation is loss of information in constraining spatial representation from 3D domain to a 2D ( spherical ) manifold . Our work overcomes this limitation by proposing convolutional learning over concentric spheres , achieving rotationally equivariant 3D feature learning with scalable convolutions . 3 ARCHITECTURE DESIGN . The primary goal of our proposed approach is to learn volumetric representations of 3D point clouds in a rotationally equivariant and also scalable manner . To achieve this goal , we propose concentric spheres at different radii , each discretized by the icosahedral grid . The proposed construction naturally organizes 3D data by angular and radial distribution , where the resolution of each component can be controlled independently . We use the icosahedral grid as it results in a highly regular sampling of the sphere . The former permits efficient use of spatial resolution , and the later results in design of efficient and rotationally-equivariant convolutions . We propose using two separate convolutions together to learn volumetric features over concentric spheres : ( 1 ) graph-based convolution to incorporate information within spheres , and ( 2 ) radial convolutions to separately incorporate information between spheres . The proposed convolutions are extended to different spatial scales via pooling based on regular properties of the icosahedral grid , resulting in the proposed hierarchical convolutional architecture of Fig . 1 . We explain each component of our model in more detail in subsequent sections , and pooling in A.5 of Appendix . 1https : //github.com/anonymous10521/CSGNN 3.1 CONCENTRIC SPHERICAL DISCRETIZATION AND POINT CLOUD MAPPING . In this section we explain in detail our method of volumetric discretization by concentric spheres . We further present our approach to converting arbitrary point cloud data to initial feature channels over this spatial structure . Concentric Icosahedral Spheres . The initial icosahedron has 12 vertices forming 20 equilateral triangular faces . To increase grid resolution , each face can be sub-divided , with resolution scaling as |V | = 10 ∗ 4l + 2 ( l is target discretization level ) . See Fig . 3a for an illustration of this process . We implement concentric spheres by stacking R identical icosahedral grids to form the radial dimension , shown in Fig . 3b . Assuming normalization to unit radius , we uniformly assign concentric spheres at radii [ 1R , 2 R , ... , 1 ] . Assuming single-channel feature map , the resulting grid is the matrix H ∈ RR×|V | , where each vertex is indexed by the sphere it belongs to , and its position on the sphere . The resulting volumetric representation has several noteworthy properties . First , the icosahedral discretization results in a highly regular spatial sampling within each sphere . This allows more efficient use of spatial resolution compared to polar grids used in earlier works ( Cohen et al. , 2018 ; Esteves et al. , 2018 ; You et al. , 2020 ) , which have have resolution bias towards the polar regions . Second , spatial resolution is not uniform across different spheres , as the proposed construction results in higher sampling density closer to the center . However , this non-uniformity difference is largely accounted for as a function of the radius of the sphere , and does not inhibit the design of efficient and rotationally equivariant convolutions . Point Cloud to Concentric Spheres . We now consider the problem of describing a point cloud P ∈ RN×3 in terms of concentric spherical feature map H ∈ RR×|V |×C , where C is number of channels . While the concentric grid representation is defined discretely , the space point positions are continuous , which we would like to capture . To do so , we summarize the contribution of points using the Gaussian radial basis function ( RBF ) : f ( x ) = N∑ j=1 φ ( ||x− Pj ||22 ) ( 1 ) N is the number of data points , and the function φ = exp ( −γr2 ) is parameterized by the bandwidth γ . In practice we limit computation to a local neighborhood ( instead of considering all points ) and choose γ accordingly . We refer to Fig . 2 for illustrative example of the conversion , and Sec . A.6 for implementation details as applied in experiments . We determine the input channels C by grouping concentric spheres and concatenating features of co-radial vertices , also shown in Fig . 2 . Suppose converting the point cloud results in a singlechannel feature tensor H′ ∈ RR′×|V | , where R′ is the initial number of spheres . Grouping the features from co-radial vertices across R groups results in feature tensor H ∈ RR×|V |×R ′ R , where R is the number of spheres represented spatially , and R ′ R is the number of spheres represented via input channels . The proposed grouping mechanism gives flexibility to significantly increase radial resolution without correspondingly increasing the size of the spatial grid , which persists across convolutions . This enables balancing between computational efficiency and the representational boost of having additional spheres .
This paper addresses an important problem in 3D representation learning, which is how to design a robust convolution neural network for arbitrarily oriented inputs. They propose to use multi-sphere icosahedral discretization to representation 3D data at first. And then, several alternative convolution operations are used to further process features. The novel convolution operation is consisting of intra-sphere and inter-sphere convolution. They also design a mapping function to convert point cloud data to mesh data. The experimental results indicate the model can work well.
SP:797f40f8ab27a0ce589b18ec143e398b6b44a460
UMEC: Unified model and embedding compression for efficient recommendation systems
1 INTRODUCTION . As the core component of a recommendation system ( RS ) , recommendation models ( RM ) based on ranking neural networks are widely adopted in general content recommendation and retrieval applications . In general , an effective recommendation model consists of two components : a feature embedding sub-model and a prediction sub-model , as illustrated in Figure 1 . Usually , an RM adopts neural networks to serve two sub-models . Formally , we denote an RM as f ( · ; W ) , whereW is the learnable parameters of f . For the inference , the model f takes the input feature data x to predict the confidence of the content , serving the recommendation applications . Specifically , we further define the embedding and prediction sub-models as fe ( · ; We ) and fp ( · ; Wp ) respectively , whereWe andWp are their own learnable parameters andW = { We , Wp } . The embedding feature , v : = fe ( x ; We ) , is the input of fp with the input data x . Hence , we can express the RM as f ( · ; W ) , fp ( fe ( · ; We ) ; Wp ) . Given a ranking training loss ` ( · ) ( i.e. , binary cross entropy ( BCE ) loss ) , the learning goal of the ranking model can be written as min W ∑ ( x , y ) ∈D ` ( f ( x ; W ) , y ) , where y is the ground-truth label , and D is the training dataset . Nowadays , extremely large-scale data have been poured into the recommendation system to predict user behavior in many applications . In the online inference procedure , the heaviest computation component is the layer-wise product between the hidden output vectors and the model parametersW , for a neural network-based RM . A slimmed neural network structure would save a great amount of power consumption during the inference . Hence , the main idea of an RM compression is to slim the structural complexity of f ( W ) and reduce the dimension of hidden output vectors . To obtain an efficient ranking model ( for example , MLP based ) for an RS , one may apply existing model compression methods to MLPs directly . For example , Li et al . ( 2016 ) removes the entire filters in the network together with their connecting feature maps in terms of magnitudes , which can also ∗Equal Contribution . be applied to MLP structures to remove a specific neuron as well as its connections . Molchanov et al . ( 2019 ) approximates the importance of a neuron ( filter ) to the final loss by using the first and second-order Taylor expansions , which can also be applied to pruning the neurons without hassle . There are also some compression methods focusing on dimension reduction of embedding feature vectors . Ginart et al . ( 2019 ) proposes a mixed dimension embedding scheme by designing non-uniform embedding dimensions scaling with popularity of features . Joglekar et al . ( 2020 ) uses Neuron Input Search ( NIS ) to learn the embedding dimensions for the sparse categorical features . ... ... ... Concatenation ... ...... Dense Input Sparse Input Embedding Sub-model Prediction Sub-model Embedding Feature ing neural network model and the prediction accuracy goal of the ranking model , with end-to-end gradient-based training . We reformulate the optimization of training loss associated with hard constraints into a minimax optimization problem solved by the alternating direction method of multipliers ( ADMM ) method ( Boyd et al. , 2011 ) . To summarize our contributions , we present the merits of UMEC as the following : • To the best of our knowledge , UMEC is the first unified optimization framework for the recommendation system scenario . Unlike those existing works that treat the selection of input feature and compression of the model as two individual problems , UMEC jointly learns both together via unifying both original prediction learning goal and the model compression related hard constraints . • We reformulate the joint input feature selection and model compression task as a constrained optimization problem . We convert resource constraints and L0 sparsity constraints into soft optimization energy terms and solve the whole optimization using ADMM methods . • Extensive experiments performed over large-scale public benchmarks show that our method largely outperforms previous state-of-the-art input feature selection methods and model compression methods , endorsing the benefits of the proposed end-to-end optimization . 2 RELATED WORK . Recommendation Models With the recent development of deep learning techniques , plenty of works have proposed learning-based recommendation systems to grapple with personalized recommendation tasks . Hidasi et al . ( 2015 ) applies recurrent neural networks ( RNN ) on long session data to model the whole session and achieve better accuracy than the traditional matrix factorization approaches . Covington et al . ( 2016 ) proposes a high-level recommendation algorithm for YouTube videos by specifying a candidate generation model followed by a separate ranking model , which demonstrates a significant performance boost thanks to neural networks . Wu et al . ( 2019 ) proposes a recommendation algorithm based on the graph neural network to better capture the complex transitions among items , achieving a more accurate item embedding . Their method outperforms traditional sequential approaches . Naumov et al . ( 2019 ) exploits categorical features and designs a parallelism scheme for the embedding tables to alleviate the limited memory problem . Huang et al . ( 2020 ) proposes a multi-attention based model to mitigate the low efficiency problem in the group recommendation scenarios . Input Feature Compression for Recommendation Models The numerous input features for practical recommendation scenarios necessitate the selection of useful ones to save memory resources and facilitate computational efficiency during inference . In factorization machines ( FM ) -based and context-aware recommendation systems , for example , Mao et al . ( 2017 ) conducts input feature selection in an automatic manner by feature ranking and feature sub-sampling , while managing to improve the prediction quality . Ginart et al . ( 2019 ) designs a mixed dimension embedding layers scheme and adjusts the dimension of a particular embedding feature according to the frequency of that item . Joglekar et al . ( 2020 ) performs Neural Input Search ( NIS ) method to search for the embedding sizes for the sparse categorical features , and designs the multi-size embedding framework to leverage the model capacity more efficiently . Song et al . ( 2020 ) proposes a discovering framework to automatically find the interaction architecture of the prediction model . Model Compression Model compression aims to reduce the complexity of Deep Neural Network ( DNN ) models to achieve inference efficiency and resource saving . Generally , model compression techniques can be categorized into pruning ( Han et al. , 2015 ; Wen et al. , 2016 ; Molchanov et al. , 2019 ) , quantization ( Hubara et al. , 2017 ; Wu et al. , 2018 ; Ajanthan et al. , 2019 ) and distillation ( Hinton et al. , 2015 ; Polino et al. , 2018 ; Tung & Mori , 2019 ) . Han et al . ( 2015 ) proposes a magnitude-based and element-wise pruning technique , which does not guarantee the reduction of computation efficiency , energy and memory costs . Structured pruning can solve this issue by removing whole certain types of structures from the network , such as filter pruning and channel pruning methods ( Li et al. , 2016 ; He et al. , 2017 ; Molchanov et al. , 2019 ) . Recent works ( Frankle & Carbin , 2019 ; Chen et al. , 2020b ; a ; 2021c ; b ; a ; Ma et al. , 2021 ) reveal that with appropriate compression techniques , the identified sparse subnetworks are capable of training in isolation to match the dense model performance . In the meanwhile , researchers also develop great interest in investigating hardware-aware compression , which utilizes practical resource requirements ( e.g. , energy , latency , Flops ) to guide the compression ( He et al. , 2018 ; Yang et al. , 2019 ; Liu et al. , 2019 ) . 3 UNIFIED MODEL AND EMBEDDING COMPRESSION ON RS . For an arbitrary NN-based recommendation model f ( · ) in an RS , the terminology of `` compression '' refers to reduce the power consumption with respect to all the computation operations for the inference . The learning parameters of f ( W ) can be expressed asW : = { W ( l ) |l ∈ [ L ] } , where L is the number of layers in the f ( W ) . For an arbitrary layer l , the layer ’ s weight is denoted as W ( l ) ∈ Rdout×din . The recommendation inference on the layer l is executed as x ( l+1 ) = σ ( W ( l ) x ( l ) + b ( l ) ) , where x ( l ) ∈ Rdin is the input of l-th layer , and b ( l ) is the corresponding learning bias term . Since the RM consists of two components : feature embedding sub-model and neural network prediction sub-model , the `` compression '' can be interpreted as shrinking the dimension of embedding feature v and reducing the number of parameters inW and b . Perspective of model parameters W and b It is to reduce the input or output neurons for the specific layer l. For example , the i-th neuron of x ( l+1 ) and j-th neuron of x ( l ) are chosen to remove , then the weight matrix W ( l ) will be reshaped to ( dout − 1 ) × ( din − 1 ) . Perspective of feature embedding vectors v The reduction of din would result in the elimination of the input features . For example , v ( 1 ) is defined as the concatenation of a series of embedding vectors , v ( 1 ) = [ e1 ; e2 ; · · · ; en ] , where [ · ; · ; · ] represents the concatenation operator , and n denotes the number of embedding feature vectors in the RS . Without loss of generality , for the first embedding vector e1 ∈ Rd1 , the zero-out of first d1 columns in W ( 1 ) will result in the elimination of the whole embedding vectors for e1 . On the other hand , the compression on fe ( We ) would reduce the feature embedding vectors ’ dimensions . 3.1 A COMPRESSION EXAMPLE : GROUP LASSO FOR WEIGHT PRUNING . We first consider a simple example with an RS model consisting of fe ( We ) and fp ( Wp ) . For this RS , to reduce the computation consumption , we present a straightforward model compression method with Group Lasso . The method considers both the feature embedding selection and network slimming . We only need to apply the sparse regularization terms to the weight matrices . The optimization problem can be expressed as min W ` ( W ) + λ1 ∑ i ∥∥∥W ( 1 ) . , gi∥∥∥ 1 + L∑ l=2 λl ∑ i ∥∥∥W ( l ) . , i ∥∥∥ 1 , ( 1 ) where ` ( W ) is the original objective function . The λs are hyper-parameters to control the importance of these regularization terms . g· denotes the feature groups for the input layer . ‖ · ‖1 indicates the L1 norm . The optimization problem ( 1 ) restricts the group-wise sparsity for the input layer and the neuron-wise sparsity ( or group size = 1 ) for the rest model layers while training with the original objective function ` ( W ) . The optimization problem can be solved with the projected gradient descent method . However , the optimization problem ( 1 ) has its own limitation . The hyper-parameters λs only have the latent impact on the model size and we could not directly affect the model size . It is not friendly when the users would like to restrict the model size to a specific number . On the other hand , the hyper-parameters also make the optimization problem hard to tune , requiring multiple arguments searching rounds . To avoid these shortages , we are supposed to have new approaches to handling the compression of RS .
The paper proposes a new unified optimization framework to solve the RM compression problem. It jointly compresses the prediction network and the feature embedding, and automatically optimizes their complexity budgets under the total resource constraint. In this way, it avoids treating selection of input feature and compression of model as two individual problems, and requires no expensive hyper-parameters tuning for either part. The novel unified model and embedding compression (UMEC) method can directly satisfy both the requirement of resource consumption of the ranking neural network model and the prediction accuracy goal of the ranking model, with end-to-end gradient-based training.
SP:3a60ea9460ca9592892c6d4795d065e3b4be13de
UMEC: Unified model and embedding compression for efficient recommendation systems
1 INTRODUCTION . As the core component of a recommendation system ( RS ) , recommendation models ( RM ) based on ranking neural networks are widely adopted in general content recommendation and retrieval applications . In general , an effective recommendation model consists of two components : a feature embedding sub-model and a prediction sub-model , as illustrated in Figure 1 . Usually , an RM adopts neural networks to serve two sub-models . Formally , we denote an RM as f ( · ; W ) , whereW is the learnable parameters of f . For the inference , the model f takes the input feature data x to predict the confidence of the content , serving the recommendation applications . Specifically , we further define the embedding and prediction sub-models as fe ( · ; We ) and fp ( · ; Wp ) respectively , whereWe andWp are their own learnable parameters andW = { We , Wp } . The embedding feature , v : = fe ( x ; We ) , is the input of fp with the input data x . Hence , we can express the RM as f ( · ; W ) , fp ( fe ( · ; We ) ; Wp ) . Given a ranking training loss ` ( · ) ( i.e. , binary cross entropy ( BCE ) loss ) , the learning goal of the ranking model can be written as min W ∑ ( x , y ) ∈D ` ( f ( x ; W ) , y ) , where y is the ground-truth label , and D is the training dataset . Nowadays , extremely large-scale data have been poured into the recommendation system to predict user behavior in many applications . In the online inference procedure , the heaviest computation component is the layer-wise product between the hidden output vectors and the model parametersW , for a neural network-based RM . A slimmed neural network structure would save a great amount of power consumption during the inference . Hence , the main idea of an RM compression is to slim the structural complexity of f ( W ) and reduce the dimension of hidden output vectors . To obtain an efficient ranking model ( for example , MLP based ) for an RS , one may apply existing model compression methods to MLPs directly . For example , Li et al . ( 2016 ) removes the entire filters in the network together with their connecting feature maps in terms of magnitudes , which can also ∗Equal Contribution . be applied to MLP structures to remove a specific neuron as well as its connections . Molchanov et al . ( 2019 ) approximates the importance of a neuron ( filter ) to the final loss by using the first and second-order Taylor expansions , which can also be applied to pruning the neurons without hassle . There are also some compression methods focusing on dimension reduction of embedding feature vectors . Ginart et al . ( 2019 ) proposes a mixed dimension embedding scheme by designing non-uniform embedding dimensions scaling with popularity of features . Joglekar et al . ( 2020 ) uses Neuron Input Search ( NIS ) to learn the embedding dimensions for the sparse categorical features . ... ... ... Concatenation ... ...... Dense Input Sparse Input Embedding Sub-model Prediction Sub-model Embedding Feature ing neural network model and the prediction accuracy goal of the ranking model , with end-to-end gradient-based training . We reformulate the optimization of training loss associated with hard constraints into a minimax optimization problem solved by the alternating direction method of multipliers ( ADMM ) method ( Boyd et al. , 2011 ) . To summarize our contributions , we present the merits of UMEC as the following : • To the best of our knowledge , UMEC is the first unified optimization framework for the recommendation system scenario . Unlike those existing works that treat the selection of input feature and compression of the model as two individual problems , UMEC jointly learns both together via unifying both original prediction learning goal and the model compression related hard constraints . • We reformulate the joint input feature selection and model compression task as a constrained optimization problem . We convert resource constraints and L0 sparsity constraints into soft optimization energy terms and solve the whole optimization using ADMM methods . • Extensive experiments performed over large-scale public benchmarks show that our method largely outperforms previous state-of-the-art input feature selection methods and model compression methods , endorsing the benefits of the proposed end-to-end optimization . 2 RELATED WORK . Recommendation Models With the recent development of deep learning techniques , plenty of works have proposed learning-based recommendation systems to grapple with personalized recommendation tasks . Hidasi et al . ( 2015 ) applies recurrent neural networks ( RNN ) on long session data to model the whole session and achieve better accuracy than the traditional matrix factorization approaches . Covington et al . ( 2016 ) proposes a high-level recommendation algorithm for YouTube videos by specifying a candidate generation model followed by a separate ranking model , which demonstrates a significant performance boost thanks to neural networks . Wu et al . ( 2019 ) proposes a recommendation algorithm based on the graph neural network to better capture the complex transitions among items , achieving a more accurate item embedding . Their method outperforms traditional sequential approaches . Naumov et al . ( 2019 ) exploits categorical features and designs a parallelism scheme for the embedding tables to alleviate the limited memory problem . Huang et al . ( 2020 ) proposes a multi-attention based model to mitigate the low efficiency problem in the group recommendation scenarios . Input Feature Compression for Recommendation Models The numerous input features for practical recommendation scenarios necessitate the selection of useful ones to save memory resources and facilitate computational efficiency during inference . In factorization machines ( FM ) -based and context-aware recommendation systems , for example , Mao et al . ( 2017 ) conducts input feature selection in an automatic manner by feature ranking and feature sub-sampling , while managing to improve the prediction quality . Ginart et al . ( 2019 ) designs a mixed dimension embedding layers scheme and adjusts the dimension of a particular embedding feature according to the frequency of that item . Joglekar et al . ( 2020 ) performs Neural Input Search ( NIS ) method to search for the embedding sizes for the sparse categorical features , and designs the multi-size embedding framework to leverage the model capacity more efficiently . Song et al . ( 2020 ) proposes a discovering framework to automatically find the interaction architecture of the prediction model . Model Compression Model compression aims to reduce the complexity of Deep Neural Network ( DNN ) models to achieve inference efficiency and resource saving . Generally , model compression techniques can be categorized into pruning ( Han et al. , 2015 ; Wen et al. , 2016 ; Molchanov et al. , 2019 ) , quantization ( Hubara et al. , 2017 ; Wu et al. , 2018 ; Ajanthan et al. , 2019 ) and distillation ( Hinton et al. , 2015 ; Polino et al. , 2018 ; Tung & Mori , 2019 ) . Han et al . ( 2015 ) proposes a magnitude-based and element-wise pruning technique , which does not guarantee the reduction of computation efficiency , energy and memory costs . Structured pruning can solve this issue by removing whole certain types of structures from the network , such as filter pruning and channel pruning methods ( Li et al. , 2016 ; He et al. , 2017 ; Molchanov et al. , 2019 ) . Recent works ( Frankle & Carbin , 2019 ; Chen et al. , 2020b ; a ; 2021c ; b ; a ; Ma et al. , 2021 ) reveal that with appropriate compression techniques , the identified sparse subnetworks are capable of training in isolation to match the dense model performance . In the meanwhile , researchers also develop great interest in investigating hardware-aware compression , which utilizes practical resource requirements ( e.g. , energy , latency , Flops ) to guide the compression ( He et al. , 2018 ; Yang et al. , 2019 ; Liu et al. , 2019 ) . 3 UNIFIED MODEL AND EMBEDDING COMPRESSION ON RS . For an arbitrary NN-based recommendation model f ( · ) in an RS , the terminology of `` compression '' refers to reduce the power consumption with respect to all the computation operations for the inference . The learning parameters of f ( W ) can be expressed asW : = { W ( l ) |l ∈ [ L ] } , where L is the number of layers in the f ( W ) . For an arbitrary layer l , the layer ’ s weight is denoted as W ( l ) ∈ Rdout×din . The recommendation inference on the layer l is executed as x ( l+1 ) = σ ( W ( l ) x ( l ) + b ( l ) ) , where x ( l ) ∈ Rdin is the input of l-th layer , and b ( l ) is the corresponding learning bias term . Since the RM consists of two components : feature embedding sub-model and neural network prediction sub-model , the `` compression '' can be interpreted as shrinking the dimension of embedding feature v and reducing the number of parameters inW and b . Perspective of model parameters W and b It is to reduce the input or output neurons for the specific layer l. For example , the i-th neuron of x ( l+1 ) and j-th neuron of x ( l ) are chosen to remove , then the weight matrix W ( l ) will be reshaped to ( dout − 1 ) × ( din − 1 ) . Perspective of feature embedding vectors v The reduction of din would result in the elimination of the input features . For example , v ( 1 ) is defined as the concatenation of a series of embedding vectors , v ( 1 ) = [ e1 ; e2 ; · · · ; en ] , where [ · ; · ; · ] represents the concatenation operator , and n denotes the number of embedding feature vectors in the RS . Without loss of generality , for the first embedding vector e1 ∈ Rd1 , the zero-out of first d1 columns in W ( 1 ) will result in the elimination of the whole embedding vectors for e1 . On the other hand , the compression on fe ( We ) would reduce the feature embedding vectors ’ dimensions . 3.1 A COMPRESSION EXAMPLE : GROUP LASSO FOR WEIGHT PRUNING . We first consider a simple example with an RS model consisting of fe ( We ) and fp ( Wp ) . For this RS , to reduce the computation consumption , we present a straightforward model compression method with Group Lasso . The method considers both the feature embedding selection and network slimming . We only need to apply the sparse regularization terms to the weight matrices . The optimization problem can be expressed as min W ` ( W ) + λ1 ∑ i ∥∥∥W ( 1 ) . , gi∥∥∥ 1 + L∑ l=2 λl ∑ i ∥∥∥W ( l ) . , i ∥∥∥ 1 , ( 1 ) where ` ( W ) is the original objective function . The λs are hyper-parameters to control the importance of these regularization terms . g· denotes the feature groups for the input layer . ‖ · ‖1 indicates the L1 norm . The optimization problem ( 1 ) restricts the group-wise sparsity for the input layer and the neuron-wise sparsity ( or group size = 1 ) for the rest model layers while training with the original objective function ` ( W ) . The optimization problem can be solved with the projected gradient descent method . However , the optimization problem ( 1 ) has its own limitation . The hyper-parameters λs only have the latent impact on the model size and we could not directly affect the model size . It is not friendly when the users would like to restrict the model size to a specific number . On the other hand , the hyper-parameters also make the optimization problem hard to tune , requiring multiple arguments searching rounds . To avoid these shortages , we are supposed to have new approaches to handling the compression of RS .
This paper proposes a framework of a unified recommendation system, which balances the compression degree of the model and the accuracy of the model by compressing the embedding layer model, while optimizing feature selection and neural network compression. This paper proposes a resource-constrained method to simultaneously optimize model compression and ensure model accuracy, and use ADMM's solver to optimize constrained models. The experiment verifies the effectiveness of the method by comparing the accuracy of different model compression ratios.
SP:3a60ea9460ca9592892c6d4795d065e3b4be13de
UMEC: Unified model and embedding compression for efficient recommendation systems
1 INTRODUCTION . As the core component of a recommendation system ( RS ) , recommendation models ( RM ) based on ranking neural networks are widely adopted in general content recommendation and retrieval applications . In general , an effective recommendation model consists of two components : a feature embedding sub-model and a prediction sub-model , as illustrated in Figure 1 . Usually , an RM adopts neural networks to serve two sub-models . Formally , we denote an RM as f ( · ; W ) , whereW is the learnable parameters of f . For the inference , the model f takes the input feature data x to predict the confidence of the content , serving the recommendation applications . Specifically , we further define the embedding and prediction sub-models as fe ( · ; We ) and fp ( · ; Wp ) respectively , whereWe andWp are their own learnable parameters andW = { We , Wp } . The embedding feature , v : = fe ( x ; We ) , is the input of fp with the input data x . Hence , we can express the RM as f ( · ; W ) , fp ( fe ( · ; We ) ; Wp ) . Given a ranking training loss ` ( · ) ( i.e. , binary cross entropy ( BCE ) loss ) , the learning goal of the ranking model can be written as min W ∑ ( x , y ) ∈D ` ( f ( x ; W ) , y ) , where y is the ground-truth label , and D is the training dataset . Nowadays , extremely large-scale data have been poured into the recommendation system to predict user behavior in many applications . In the online inference procedure , the heaviest computation component is the layer-wise product between the hidden output vectors and the model parametersW , for a neural network-based RM . A slimmed neural network structure would save a great amount of power consumption during the inference . Hence , the main idea of an RM compression is to slim the structural complexity of f ( W ) and reduce the dimension of hidden output vectors . To obtain an efficient ranking model ( for example , MLP based ) for an RS , one may apply existing model compression methods to MLPs directly . For example , Li et al . ( 2016 ) removes the entire filters in the network together with their connecting feature maps in terms of magnitudes , which can also ∗Equal Contribution . be applied to MLP structures to remove a specific neuron as well as its connections . Molchanov et al . ( 2019 ) approximates the importance of a neuron ( filter ) to the final loss by using the first and second-order Taylor expansions , which can also be applied to pruning the neurons without hassle . There are also some compression methods focusing on dimension reduction of embedding feature vectors . Ginart et al . ( 2019 ) proposes a mixed dimension embedding scheme by designing non-uniform embedding dimensions scaling with popularity of features . Joglekar et al . ( 2020 ) uses Neuron Input Search ( NIS ) to learn the embedding dimensions for the sparse categorical features . ... ... ... Concatenation ... ...... Dense Input Sparse Input Embedding Sub-model Prediction Sub-model Embedding Feature ing neural network model and the prediction accuracy goal of the ranking model , with end-to-end gradient-based training . We reformulate the optimization of training loss associated with hard constraints into a minimax optimization problem solved by the alternating direction method of multipliers ( ADMM ) method ( Boyd et al. , 2011 ) . To summarize our contributions , we present the merits of UMEC as the following : • To the best of our knowledge , UMEC is the first unified optimization framework for the recommendation system scenario . Unlike those existing works that treat the selection of input feature and compression of the model as two individual problems , UMEC jointly learns both together via unifying both original prediction learning goal and the model compression related hard constraints . • We reformulate the joint input feature selection and model compression task as a constrained optimization problem . We convert resource constraints and L0 sparsity constraints into soft optimization energy terms and solve the whole optimization using ADMM methods . • Extensive experiments performed over large-scale public benchmarks show that our method largely outperforms previous state-of-the-art input feature selection methods and model compression methods , endorsing the benefits of the proposed end-to-end optimization . 2 RELATED WORK . Recommendation Models With the recent development of deep learning techniques , plenty of works have proposed learning-based recommendation systems to grapple with personalized recommendation tasks . Hidasi et al . ( 2015 ) applies recurrent neural networks ( RNN ) on long session data to model the whole session and achieve better accuracy than the traditional matrix factorization approaches . Covington et al . ( 2016 ) proposes a high-level recommendation algorithm for YouTube videos by specifying a candidate generation model followed by a separate ranking model , which demonstrates a significant performance boost thanks to neural networks . Wu et al . ( 2019 ) proposes a recommendation algorithm based on the graph neural network to better capture the complex transitions among items , achieving a more accurate item embedding . Their method outperforms traditional sequential approaches . Naumov et al . ( 2019 ) exploits categorical features and designs a parallelism scheme for the embedding tables to alleviate the limited memory problem . Huang et al . ( 2020 ) proposes a multi-attention based model to mitigate the low efficiency problem in the group recommendation scenarios . Input Feature Compression for Recommendation Models The numerous input features for practical recommendation scenarios necessitate the selection of useful ones to save memory resources and facilitate computational efficiency during inference . In factorization machines ( FM ) -based and context-aware recommendation systems , for example , Mao et al . ( 2017 ) conducts input feature selection in an automatic manner by feature ranking and feature sub-sampling , while managing to improve the prediction quality . Ginart et al . ( 2019 ) designs a mixed dimension embedding layers scheme and adjusts the dimension of a particular embedding feature according to the frequency of that item . Joglekar et al . ( 2020 ) performs Neural Input Search ( NIS ) method to search for the embedding sizes for the sparse categorical features , and designs the multi-size embedding framework to leverage the model capacity more efficiently . Song et al . ( 2020 ) proposes a discovering framework to automatically find the interaction architecture of the prediction model . Model Compression Model compression aims to reduce the complexity of Deep Neural Network ( DNN ) models to achieve inference efficiency and resource saving . Generally , model compression techniques can be categorized into pruning ( Han et al. , 2015 ; Wen et al. , 2016 ; Molchanov et al. , 2019 ) , quantization ( Hubara et al. , 2017 ; Wu et al. , 2018 ; Ajanthan et al. , 2019 ) and distillation ( Hinton et al. , 2015 ; Polino et al. , 2018 ; Tung & Mori , 2019 ) . Han et al . ( 2015 ) proposes a magnitude-based and element-wise pruning technique , which does not guarantee the reduction of computation efficiency , energy and memory costs . Structured pruning can solve this issue by removing whole certain types of structures from the network , such as filter pruning and channel pruning methods ( Li et al. , 2016 ; He et al. , 2017 ; Molchanov et al. , 2019 ) . Recent works ( Frankle & Carbin , 2019 ; Chen et al. , 2020b ; a ; 2021c ; b ; a ; Ma et al. , 2021 ) reveal that with appropriate compression techniques , the identified sparse subnetworks are capable of training in isolation to match the dense model performance . In the meanwhile , researchers also develop great interest in investigating hardware-aware compression , which utilizes practical resource requirements ( e.g. , energy , latency , Flops ) to guide the compression ( He et al. , 2018 ; Yang et al. , 2019 ; Liu et al. , 2019 ) . 3 UNIFIED MODEL AND EMBEDDING COMPRESSION ON RS . For an arbitrary NN-based recommendation model f ( · ) in an RS , the terminology of `` compression '' refers to reduce the power consumption with respect to all the computation operations for the inference . The learning parameters of f ( W ) can be expressed asW : = { W ( l ) |l ∈ [ L ] } , where L is the number of layers in the f ( W ) . For an arbitrary layer l , the layer ’ s weight is denoted as W ( l ) ∈ Rdout×din . The recommendation inference on the layer l is executed as x ( l+1 ) = σ ( W ( l ) x ( l ) + b ( l ) ) , where x ( l ) ∈ Rdin is the input of l-th layer , and b ( l ) is the corresponding learning bias term . Since the RM consists of two components : feature embedding sub-model and neural network prediction sub-model , the `` compression '' can be interpreted as shrinking the dimension of embedding feature v and reducing the number of parameters inW and b . Perspective of model parameters W and b It is to reduce the input or output neurons for the specific layer l. For example , the i-th neuron of x ( l+1 ) and j-th neuron of x ( l ) are chosen to remove , then the weight matrix W ( l ) will be reshaped to ( dout − 1 ) × ( din − 1 ) . Perspective of feature embedding vectors v The reduction of din would result in the elimination of the input features . For example , v ( 1 ) is defined as the concatenation of a series of embedding vectors , v ( 1 ) = [ e1 ; e2 ; · · · ; en ] , where [ · ; · ; · ] represents the concatenation operator , and n denotes the number of embedding feature vectors in the RS . Without loss of generality , for the first embedding vector e1 ∈ Rd1 , the zero-out of first d1 columns in W ( 1 ) will result in the elimination of the whole embedding vectors for e1 . On the other hand , the compression on fe ( We ) would reduce the feature embedding vectors ’ dimensions . 3.1 A COMPRESSION EXAMPLE : GROUP LASSO FOR WEIGHT PRUNING . We first consider a simple example with an RS model consisting of fe ( We ) and fp ( Wp ) . For this RS , to reduce the computation consumption , we present a straightforward model compression method with Group Lasso . The method considers both the feature embedding selection and network slimming . We only need to apply the sparse regularization terms to the weight matrices . The optimization problem can be expressed as min W ` ( W ) + λ1 ∑ i ∥∥∥W ( 1 ) . , gi∥∥∥ 1 + L∑ l=2 λl ∑ i ∥∥∥W ( l ) . , i ∥∥∥ 1 , ( 1 ) where ` ( W ) is the original objective function . The λs are hyper-parameters to control the importance of these regularization terms . g· denotes the feature groups for the input layer . ‖ · ‖1 indicates the L1 norm . The optimization problem ( 1 ) restricts the group-wise sparsity for the input layer and the neuron-wise sparsity ( or group size = 1 ) for the rest model layers while training with the original objective function ` ( W ) . The optimization problem can be solved with the projected gradient descent method . However , the optimization problem ( 1 ) has its own limitation . The hyper-parameters λs only have the latent impact on the model size and we could not directly affect the model size . It is not friendly when the users would like to restrict the model size to a specific number . On the other hand , the hyper-parameters also make the optimization problem hard to tune , requiring multiple arguments searching rounds . To avoid these shortages , we are supposed to have new approaches to handling the compression of RS .
This paper studies the compression of recommendation models (RMs). That is new and relatively less studied in the model compression field, but of great practical value. The main unique challenge of RM compression lies in the entanglement of compressing both the network parameters and the feature embedding inputs, and the latter often accounts for more of the computational bottleneck.
SP:3a60ea9460ca9592892c6d4795d065e3b4be13de
A Gradient-based Kernel Approach for Efficient Network Architecture Search
1 INTRODUCTION . Understanding and improving the optimization of deep networks has been an active field of artificial intelligence . One of the mysteries in deep learning is why extremely deep neural networks are hard to train . Currently , the vanishing and exploding gradient problem is widely believed to be the main answer ( Bengio et al. , 1994 ; Hochreiter & Schmidhuber , 1997 ; Pascanu et al. , 2013 ) . Gradients exponentially decrease ( or increase ) from the top layer to the bottom layer in a multilayer network . By extension , the current vanishing and exploding gradient problem also refers to extremely small ( or large ) gradient values . Following this explanation , several widely-used training techniques have been proposed to assist optimization . These studies can be roughly classified into four categories : initialization-based approaches ( Glorot & Bengio , 2010 ; He et al. , 2015 ; Zhang et al. , 2019 ) , activation-based approaches ( Hendrycks & Gimpel , 2016 ; Klambauer et al. , 2017 ) , normalization based approaches ( Ioffe & Szegedy , 2015 ; Salimans & Kingma , 2016 ; Ulyanov et al. , 2016 ; Lei Ba et al. , 2016 ; Nguyen & Salazar , 2019 ) , and skip-connection-based approaches ( He et al. , 2016 ; Huang et al. , 2017a ) . These techniques provide good alternatives to stabilize gradients and bring promising performance improvements . Despite much evidence showing the importance of steady gradient values , we are still curious about whether there are unexplored but important factors . To answer this question , we conduct extensive experiments and find some surprising phenomena . First , the accuracy curves of some models converge well with the remaining gradient vanishing and exploding problem . Second , we find several cases where models with similar gradient values show different convergence performance . These results indicate that gradient values may not be vital as much as we expect , and some hidden factors play a significant role in optimization . To answer this question , we explore other gradient features , such as covariance matrix , correlations , variance , and so on . These features are used to evaluate gradients from different perspectives . The covariance matrix evaluates the similarity between any two parameters , which is widely used in optimization studies ( Zhao & Zhang , 2015 ; Faghri et al. , 2020 ) . Gradient correlation is defined to evaluate the similarity between any two examples . Among them , experiments show that gradient correlation is an important factor . Compared to widely-explored 1We will release the code on publication . gradient values , gradient correlations are rarely studied . As gradient values affect the step size in optimization , vanishing gradients prevent models from changing weight values . In the worst case , this could completely stop training . Gradient correlations evaluate the randomness of gradient directions in Euclidean space . Lower gradient correlations indicate more “ random ” gradient directions and more “ conflicting ” parameter updates . For a better understanding , we visualize absolute gradient values and gradient correlations ( See Section 4 for more details ) . It illustrates that models with either small values or small correlations show worse convergence and generalization performance , indicating the importance of these two factors . Following the new finding , we take a further step to explore gradient correlations and gradient values in network architecture search . We first formulate two factors into a unified gradient-based kernel , which is defined as the average of a gradient dot-product matrix . Motivated by the observation that architectures with larger kernels at initialization tend to have better average results , we develop a lightweight network architecture search approach , called GT-NAS , which evaluates architectures according to the gradient-based kernel at initialization . Unlike other NAS approaches that evaluate architectures via full training , which takes massive computation resources , GT-NAS only relies on a few examples for kernel calculation . We first select top-k architectures with largest kernels as candidates , which are then trained to select the best one based on validation performance . In practice , k is usually set to be a very small value . Experiments show that GT-NAS achieves competitive results with extremely fast search on NAS-Bench-201 ( Ying et al. , 2019 ) , a NAS benchmark dataset . The low search cost allows us to apply NAS on diverse tasks . Specifically , the structure searched by the proposed policy outperforms the naive baseline without NAS on 4 datasets covering image classification and text classification . The main contributions are summarized as follows : • We propose that both gradient correlations and gradient values matter in optimization , which gives a new insight to understand and develop optimization techniques . • Following the new finding , we propose a gradient-based kernel approach for NAS , which is able to search for well-performing architectures efficiently . • Experiments show that GT-NAS achieves competitive results with orders of magnitude faster than the naive baseline . 2 RELATED WORK . Understanding and improving optimization Understanding and improving the optimization of deep networks has long been a hot research topic . Bengio et al . ( 1994 ) find the vanishing and exploding gradient problem in neural network training . To address this problem , a lot of promising approaches have been proposed in recent years , which can be classified into four research lines . The first research line focuses on initialization ( Sutskever et al. , 2013 ; Mishkin & Matas , 2016 ; Hanin & Rolnick , 2018 ) . Glorot & Bengio ( 2010 ) propose to control the variance of parameters via appropriate initialization . Following this work , several widely-used initialization approaches have been proposed , including Kaiming initialization ( He et al. , 2015 ) , Xaiver initinalization ( Glorot & Bengio , 2010 ) , and Fixup initialization ( Zhang et al. , 2019 ) . The second research line focuses on normalization ( Ioffe & Szegedy , 2015 ; Lei Ba et al. , 2016 ; Ulyanov et al. , 2016 ; Wu & He , 2018 ; Nguyen & Salazar , 2019 ) . These approaches aim to avoid the vanishing gradient by controlling the distribution of intermediate layers . The third is mainly based on activation functions to make the derivatives of activation less saturated to avoid the vanishing problem , including GELU activation ( Hendrycks & Gimpel , 2016 ) , SELU activation ( Klambauer et al. , 2017 ) , and so on . The motivation behind these approaches is to avoid unsteady derivatives of the activation with respect to the inputs . The fourth focuses on gradient clipping ( Pascanu et al. , 2013 ) . Gradient-based Kernel Our work is also related to gradient-based kernels ( Advani & Saxe , 2017 ; Jacot et al. , 2018 ) . NTK ( Jacot et al. , 2018 ) is a popular gradient-based kernel , defined as the Gram matrix of gradients . It is proposed to analyze model ’ s convergence and generalization . Following these studies , many researchers are devoted to understand current networks from the perspective of NTK ( Lee et al. , 2019 ; Hastie et al. , 2019 ; Allen-Zhu et al. , 2019 ; Arora et al. , 2019 ) . Du et al . ( 2019b ) use the Gram matrix of gradients to prove that for an m hidden node shallow neural network with ReLU activation , as long as m is large enough , randomly initialized gradient descent converges to a globally optimal solution at a linear convergence rate for the quadratic loss function . Following this work , Du et al . ( 2019a ) further expand this finding and prove that gradient descent achieves zero training loss in polynomial time for a deep over-parameterized neural network with residual connections . Network architecture search Neural architecture search aims to replace expert-designed networks with learned architectures ( Chang et al. , 2019 ; Li et al. , 2019 ; Zhou et al. , 2020 ; He et al. , 2020a ; Fang et al. , 2020 ; He et al. , 2020b ; You et al. , 2020 ; Alves & de Oliveira , 2020 ) . The first NAS research line mainly focuses on random search . The key idea is to randomly evaluate various architectures and select the best one based on their validation performance . However , despite promising results , many of them require thousands of GPU days to achieve desired results . To address this problem , Ying et al . ( 2019 ) propose a reinforcement learning based search policy which introduces an architecture generator with validation accuracy as reward . Another research line is based on evolution approaches . Real et al . ( 2019 ) propose a two-stage search policy . The first stage selects several well-performing parent architectures . The second stage applies mutation on these parent architectures to select the best one . Following this work , So et al . ( 2019 ) apply the evolution search on Transformer networks and achieve new state-of-the-art results on machine translation and language modeling tasks . Although these approaches can reduce exploration costs , the dependence on validation accuracy still leads to huge computation costs . To get rid of the dependence on validation accuracy , several studies ( Jiang et al. , 2019 ; Liu et al. , 2019 ; Dong & Yang , 2019 ; Zela et al. , 2020 ; Chu et al. , 2020 ) re-formulate the task in a differentiable manner and allow efficient search using gradient descent . Unlike these studies , we propose a lightweight NAS approach , which largely reduces evaluation cost . Furthermore , the new approach does not rely on additional search models , thus also saves memory usage . 3 NOTATIONS : GRADIENT VALUE AND GRADIENT CORRELATION . Assume g ( l ) i = { g ( l ) i,1 , · · · , g ( l ) i , r } is the gradient vector of example i with respect to all parameters in the l-th layer . r is the total number of parameters . We combine all gradient vectors together to construct a gradient matrix G ( l ) ∈ Rd×r where d refers to the number of training examples . We define a matrix P ( l ) to store the dot-product of gradients . The dot-product between two gradient vectors is : P ( l ) i , j = 〈G ( l ) i , G ( l ) j〉 . ( 1 ) We divide P ( l ) by the norm of gradient vectors to get a gradient correlation matrix C ( l ) : C ( l ) i , j = P ( l ) i , j ||G ( l ) i|| · ||G ( l ) j || . ( 2 ) Then , we use the average value of C ( l ) as the final correlation score : R = E ( C ( l ) ) . ( 3 ) Here we also evaluate the absolute gradient value : V = E ( |G ( l ) | ) . ( 4 ) Since it requires too much time to calculate R and V for plenty of training examples , we randomly sample µ examples to estimate R and V in implementation for fast calculation . The dot-product between vectors with too many elements will cause the overflow problem . We also randomly sample θ parameters when calculating R. To avoid the sampling bias that might affect our findings , we test different µ ∈ [ 50 , 100 , 200 , 300 , 400 , 500 ] and θ ∈ [ 50 , 100 , 200 , 300 , 400 , 500 ] , and observe the same phenomena . For simplicity , we show our findings in the next section with µ = 50 and θ = 50 .
This paper pointed out that both gradient correlations and gradient values have strong impacts on model training, which is an insightful finding. Based on this finding, they explore a simple yet effective network architecture search (NAS) approach. The new approach replaces the expensive “train-then-test” evaluation paradigm with a new lightweight function according to the gradient-based kernel at initialization. Experiments show the high speed of the approach.
SP:a099a8bec6b5bf6a292104066f32f5152ac2bc1c
A Gradient-based Kernel Approach for Efficient Network Architecture Search
1 INTRODUCTION . Understanding and improving the optimization of deep networks has been an active field of artificial intelligence . One of the mysteries in deep learning is why extremely deep neural networks are hard to train . Currently , the vanishing and exploding gradient problem is widely believed to be the main answer ( Bengio et al. , 1994 ; Hochreiter & Schmidhuber , 1997 ; Pascanu et al. , 2013 ) . Gradients exponentially decrease ( or increase ) from the top layer to the bottom layer in a multilayer network . By extension , the current vanishing and exploding gradient problem also refers to extremely small ( or large ) gradient values . Following this explanation , several widely-used training techniques have been proposed to assist optimization . These studies can be roughly classified into four categories : initialization-based approaches ( Glorot & Bengio , 2010 ; He et al. , 2015 ; Zhang et al. , 2019 ) , activation-based approaches ( Hendrycks & Gimpel , 2016 ; Klambauer et al. , 2017 ) , normalization based approaches ( Ioffe & Szegedy , 2015 ; Salimans & Kingma , 2016 ; Ulyanov et al. , 2016 ; Lei Ba et al. , 2016 ; Nguyen & Salazar , 2019 ) , and skip-connection-based approaches ( He et al. , 2016 ; Huang et al. , 2017a ) . These techniques provide good alternatives to stabilize gradients and bring promising performance improvements . Despite much evidence showing the importance of steady gradient values , we are still curious about whether there are unexplored but important factors . To answer this question , we conduct extensive experiments and find some surprising phenomena . First , the accuracy curves of some models converge well with the remaining gradient vanishing and exploding problem . Second , we find several cases where models with similar gradient values show different convergence performance . These results indicate that gradient values may not be vital as much as we expect , and some hidden factors play a significant role in optimization . To answer this question , we explore other gradient features , such as covariance matrix , correlations , variance , and so on . These features are used to evaluate gradients from different perspectives . The covariance matrix evaluates the similarity between any two parameters , which is widely used in optimization studies ( Zhao & Zhang , 2015 ; Faghri et al. , 2020 ) . Gradient correlation is defined to evaluate the similarity between any two examples . Among them , experiments show that gradient correlation is an important factor . Compared to widely-explored 1We will release the code on publication . gradient values , gradient correlations are rarely studied . As gradient values affect the step size in optimization , vanishing gradients prevent models from changing weight values . In the worst case , this could completely stop training . Gradient correlations evaluate the randomness of gradient directions in Euclidean space . Lower gradient correlations indicate more “ random ” gradient directions and more “ conflicting ” parameter updates . For a better understanding , we visualize absolute gradient values and gradient correlations ( See Section 4 for more details ) . It illustrates that models with either small values or small correlations show worse convergence and generalization performance , indicating the importance of these two factors . Following the new finding , we take a further step to explore gradient correlations and gradient values in network architecture search . We first formulate two factors into a unified gradient-based kernel , which is defined as the average of a gradient dot-product matrix . Motivated by the observation that architectures with larger kernels at initialization tend to have better average results , we develop a lightweight network architecture search approach , called GT-NAS , which evaluates architectures according to the gradient-based kernel at initialization . Unlike other NAS approaches that evaluate architectures via full training , which takes massive computation resources , GT-NAS only relies on a few examples for kernel calculation . We first select top-k architectures with largest kernels as candidates , which are then trained to select the best one based on validation performance . In practice , k is usually set to be a very small value . Experiments show that GT-NAS achieves competitive results with extremely fast search on NAS-Bench-201 ( Ying et al. , 2019 ) , a NAS benchmark dataset . The low search cost allows us to apply NAS on diverse tasks . Specifically , the structure searched by the proposed policy outperforms the naive baseline without NAS on 4 datasets covering image classification and text classification . The main contributions are summarized as follows : • We propose that both gradient correlations and gradient values matter in optimization , which gives a new insight to understand and develop optimization techniques . • Following the new finding , we propose a gradient-based kernel approach for NAS , which is able to search for well-performing architectures efficiently . • Experiments show that GT-NAS achieves competitive results with orders of magnitude faster than the naive baseline . 2 RELATED WORK . Understanding and improving optimization Understanding and improving the optimization of deep networks has long been a hot research topic . Bengio et al . ( 1994 ) find the vanishing and exploding gradient problem in neural network training . To address this problem , a lot of promising approaches have been proposed in recent years , which can be classified into four research lines . The first research line focuses on initialization ( Sutskever et al. , 2013 ; Mishkin & Matas , 2016 ; Hanin & Rolnick , 2018 ) . Glorot & Bengio ( 2010 ) propose to control the variance of parameters via appropriate initialization . Following this work , several widely-used initialization approaches have been proposed , including Kaiming initialization ( He et al. , 2015 ) , Xaiver initinalization ( Glorot & Bengio , 2010 ) , and Fixup initialization ( Zhang et al. , 2019 ) . The second research line focuses on normalization ( Ioffe & Szegedy , 2015 ; Lei Ba et al. , 2016 ; Ulyanov et al. , 2016 ; Wu & He , 2018 ; Nguyen & Salazar , 2019 ) . These approaches aim to avoid the vanishing gradient by controlling the distribution of intermediate layers . The third is mainly based on activation functions to make the derivatives of activation less saturated to avoid the vanishing problem , including GELU activation ( Hendrycks & Gimpel , 2016 ) , SELU activation ( Klambauer et al. , 2017 ) , and so on . The motivation behind these approaches is to avoid unsteady derivatives of the activation with respect to the inputs . The fourth focuses on gradient clipping ( Pascanu et al. , 2013 ) . Gradient-based Kernel Our work is also related to gradient-based kernels ( Advani & Saxe , 2017 ; Jacot et al. , 2018 ) . NTK ( Jacot et al. , 2018 ) is a popular gradient-based kernel , defined as the Gram matrix of gradients . It is proposed to analyze model ’ s convergence and generalization . Following these studies , many researchers are devoted to understand current networks from the perspective of NTK ( Lee et al. , 2019 ; Hastie et al. , 2019 ; Allen-Zhu et al. , 2019 ; Arora et al. , 2019 ) . Du et al . ( 2019b ) use the Gram matrix of gradients to prove that for an m hidden node shallow neural network with ReLU activation , as long as m is large enough , randomly initialized gradient descent converges to a globally optimal solution at a linear convergence rate for the quadratic loss function . Following this work , Du et al . ( 2019a ) further expand this finding and prove that gradient descent achieves zero training loss in polynomial time for a deep over-parameterized neural network with residual connections . Network architecture search Neural architecture search aims to replace expert-designed networks with learned architectures ( Chang et al. , 2019 ; Li et al. , 2019 ; Zhou et al. , 2020 ; He et al. , 2020a ; Fang et al. , 2020 ; He et al. , 2020b ; You et al. , 2020 ; Alves & de Oliveira , 2020 ) . The first NAS research line mainly focuses on random search . The key idea is to randomly evaluate various architectures and select the best one based on their validation performance . However , despite promising results , many of them require thousands of GPU days to achieve desired results . To address this problem , Ying et al . ( 2019 ) propose a reinforcement learning based search policy which introduces an architecture generator with validation accuracy as reward . Another research line is based on evolution approaches . Real et al . ( 2019 ) propose a two-stage search policy . The first stage selects several well-performing parent architectures . The second stage applies mutation on these parent architectures to select the best one . Following this work , So et al . ( 2019 ) apply the evolution search on Transformer networks and achieve new state-of-the-art results on machine translation and language modeling tasks . Although these approaches can reduce exploration costs , the dependence on validation accuracy still leads to huge computation costs . To get rid of the dependence on validation accuracy , several studies ( Jiang et al. , 2019 ; Liu et al. , 2019 ; Dong & Yang , 2019 ; Zela et al. , 2020 ; Chu et al. , 2020 ) re-formulate the task in a differentiable manner and allow efficient search using gradient descent . Unlike these studies , we propose a lightweight NAS approach , which largely reduces evaluation cost . Furthermore , the new approach does not rely on additional search models , thus also saves memory usage . 3 NOTATIONS : GRADIENT VALUE AND GRADIENT CORRELATION . Assume g ( l ) i = { g ( l ) i,1 , · · · , g ( l ) i , r } is the gradient vector of example i with respect to all parameters in the l-th layer . r is the total number of parameters . We combine all gradient vectors together to construct a gradient matrix G ( l ) ∈ Rd×r where d refers to the number of training examples . We define a matrix P ( l ) to store the dot-product of gradients . The dot-product between two gradient vectors is : P ( l ) i , j = 〈G ( l ) i , G ( l ) j〉 . ( 1 ) We divide P ( l ) by the norm of gradient vectors to get a gradient correlation matrix C ( l ) : C ( l ) i , j = P ( l ) i , j ||G ( l ) i|| · ||G ( l ) j || . ( 2 ) Then , we use the average value of C ( l ) as the final correlation score : R = E ( C ( l ) ) . ( 3 ) Here we also evaluate the absolute gradient value : V = E ( |G ( l ) | ) . ( 4 ) Since it requires too much time to calculate R and V for plenty of training examples , we randomly sample µ examples to estimate R and V in implementation for fast calculation . The dot-product between vectors with too many elements will cause the overflow problem . We also randomly sample θ parameters when calculating R. To avoid the sampling bias that might affect our findings , we test different µ ∈ [ 50 , 100 , 200 , 300 , 400 , 500 ] and θ ∈ [ 50 , 100 , 200 , 300 , 400 , 500 ] , and observe the same phenomena . For simplicity , we show our findings in the next section with µ = 50 and θ = 50 .
This paper defines a new scoring function for efficiently selecting between different network architectures, without requiring the expensive training of the models. This scoring function is based on the expected dot-products between the stochastic gradient vectors corresponding to different pairs of training examples. The paper shows that this method can much more quickly select between different architectures than previous network architecture search (NAS) algorithms, while attaining relatively similar performance.
SP:a099a8bec6b5bf6a292104066f32f5152ac2bc1c
A Gradient-based Kernel Approach for Efficient Network Architecture Search
1 INTRODUCTION . Understanding and improving the optimization of deep networks has been an active field of artificial intelligence . One of the mysteries in deep learning is why extremely deep neural networks are hard to train . Currently , the vanishing and exploding gradient problem is widely believed to be the main answer ( Bengio et al. , 1994 ; Hochreiter & Schmidhuber , 1997 ; Pascanu et al. , 2013 ) . Gradients exponentially decrease ( or increase ) from the top layer to the bottom layer in a multilayer network . By extension , the current vanishing and exploding gradient problem also refers to extremely small ( or large ) gradient values . Following this explanation , several widely-used training techniques have been proposed to assist optimization . These studies can be roughly classified into four categories : initialization-based approaches ( Glorot & Bengio , 2010 ; He et al. , 2015 ; Zhang et al. , 2019 ) , activation-based approaches ( Hendrycks & Gimpel , 2016 ; Klambauer et al. , 2017 ) , normalization based approaches ( Ioffe & Szegedy , 2015 ; Salimans & Kingma , 2016 ; Ulyanov et al. , 2016 ; Lei Ba et al. , 2016 ; Nguyen & Salazar , 2019 ) , and skip-connection-based approaches ( He et al. , 2016 ; Huang et al. , 2017a ) . These techniques provide good alternatives to stabilize gradients and bring promising performance improvements . Despite much evidence showing the importance of steady gradient values , we are still curious about whether there are unexplored but important factors . To answer this question , we conduct extensive experiments and find some surprising phenomena . First , the accuracy curves of some models converge well with the remaining gradient vanishing and exploding problem . Second , we find several cases where models with similar gradient values show different convergence performance . These results indicate that gradient values may not be vital as much as we expect , and some hidden factors play a significant role in optimization . To answer this question , we explore other gradient features , such as covariance matrix , correlations , variance , and so on . These features are used to evaluate gradients from different perspectives . The covariance matrix evaluates the similarity between any two parameters , which is widely used in optimization studies ( Zhao & Zhang , 2015 ; Faghri et al. , 2020 ) . Gradient correlation is defined to evaluate the similarity between any two examples . Among them , experiments show that gradient correlation is an important factor . Compared to widely-explored 1We will release the code on publication . gradient values , gradient correlations are rarely studied . As gradient values affect the step size in optimization , vanishing gradients prevent models from changing weight values . In the worst case , this could completely stop training . Gradient correlations evaluate the randomness of gradient directions in Euclidean space . Lower gradient correlations indicate more “ random ” gradient directions and more “ conflicting ” parameter updates . For a better understanding , we visualize absolute gradient values and gradient correlations ( See Section 4 for more details ) . It illustrates that models with either small values or small correlations show worse convergence and generalization performance , indicating the importance of these two factors . Following the new finding , we take a further step to explore gradient correlations and gradient values in network architecture search . We first formulate two factors into a unified gradient-based kernel , which is defined as the average of a gradient dot-product matrix . Motivated by the observation that architectures with larger kernels at initialization tend to have better average results , we develop a lightweight network architecture search approach , called GT-NAS , which evaluates architectures according to the gradient-based kernel at initialization . Unlike other NAS approaches that evaluate architectures via full training , which takes massive computation resources , GT-NAS only relies on a few examples for kernel calculation . We first select top-k architectures with largest kernels as candidates , which are then trained to select the best one based on validation performance . In practice , k is usually set to be a very small value . Experiments show that GT-NAS achieves competitive results with extremely fast search on NAS-Bench-201 ( Ying et al. , 2019 ) , a NAS benchmark dataset . The low search cost allows us to apply NAS on diverse tasks . Specifically , the structure searched by the proposed policy outperforms the naive baseline without NAS on 4 datasets covering image classification and text classification . The main contributions are summarized as follows : • We propose that both gradient correlations and gradient values matter in optimization , which gives a new insight to understand and develop optimization techniques . • Following the new finding , we propose a gradient-based kernel approach for NAS , which is able to search for well-performing architectures efficiently . • Experiments show that GT-NAS achieves competitive results with orders of magnitude faster than the naive baseline . 2 RELATED WORK . Understanding and improving optimization Understanding and improving the optimization of deep networks has long been a hot research topic . Bengio et al . ( 1994 ) find the vanishing and exploding gradient problem in neural network training . To address this problem , a lot of promising approaches have been proposed in recent years , which can be classified into four research lines . The first research line focuses on initialization ( Sutskever et al. , 2013 ; Mishkin & Matas , 2016 ; Hanin & Rolnick , 2018 ) . Glorot & Bengio ( 2010 ) propose to control the variance of parameters via appropriate initialization . Following this work , several widely-used initialization approaches have been proposed , including Kaiming initialization ( He et al. , 2015 ) , Xaiver initinalization ( Glorot & Bengio , 2010 ) , and Fixup initialization ( Zhang et al. , 2019 ) . The second research line focuses on normalization ( Ioffe & Szegedy , 2015 ; Lei Ba et al. , 2016 ; Ulyanov et al. , 2016 ; Wu & He , 2018 ; Nguyen & Salazar , 2019 ) . These approaches aim to avoid the vanishing gradient by controlling the distribution of intermediate layers . The third is mainly based on activation functions to make the derivatives of activation less saturated to avoid the vanishing problem , including GELU activation ( Hendrycks & Gimpel , 2016 ) , SELU activation ( Klambauer et al. , 2017 ) , and so on . The motivation behind these approaches is to avoid unsteady derivatives of the activation with respect to the inputs . The fourth focuses on gradient clipping ( Pascanu et al. , 2013 ) . Gradient-based Kernel Our work is also related to gradient-based kernels ( Advani & Saxe , 2017 ; Jacot et al. , 2018 ) . NTK ( Jacot et al. , 2018 ) is a popular gradient-based kernel , defined as the Gram matrix of gradients . It is proposed to analyze model ’ s convergence and generalization . Following these studies , many researchers are devoted to understand current networks from the perspective of NTK ( Lee et al. , 2019 ; Hastie et al. , 2019 ; Allen-Zhu et al. , 2019 ; Arora et al. , 2019 ) . Du et al . ( 2019b ) use the Gram matrix of gradients to prove that for an m hidden node shallow neural network with ReLU activation , as long as m is large enough , randomly initialized gradient descent converges to a globally optimal solution at a linear convergence rate for the quadratic loss function . Following this work , Du et al . ( 2019a ) further expand this finding and prove that gradient descent achieves zero training loss in polynomial time for a deep over-parameterized neural network with residual connections . Network architecture search Neural architecture search aims to replace expert-designed networks with learned architectures ( Chang et al. , 2019 ; Li et al. , 2019 ; Zhou et al. , 2020 ; He et al. , 2020a ; Fang et al. , 2020 ; He et al. , 2020b ; You et al. , 2020 ; Alves & de Oliveira , 2020 ) . The first NAS research line mainly focuses on random search . The key idea is to randomly evaluate various architectures and select the best one based on their validation performance . However , despite promising results , many of them require thousands of GPU days to achieve desired results . To address this problem , Ying et al . ( 2019 ) propose a reinforcement learning based search policy which introduces an architecture generator with validation accuracy as reward . Another research line is based on evolution approaches . Real et al . ( 2019 ) propose a two-stage search policy . The first stage selects several well-performing parent architectures . The second stage applies mutation on these parent architectures to select the best one . Following this work , So et al . ( 2019 ) apply the evolution search on Transformer networks and achieve new state-of-the-art results on machine translation and language modeling tasks . Although these approaches can reduce exploration costs , the dependence on validation accuracy still leads to huge computation costs . To get rid of the dependence on validation accuracy , several studies ( Jiang et al. , 2019 ; Liu et al. , 2019 ; Dong & Yang , 2019 ; Zela et al. , 2020 ; Chu et al. , 2020 ) re-formulate the task in a differentiable manner and allow efficient search using gradient descent . Unlike these studies , we propose a lightweight NAS approach , which largely reduces evaluation cost . Furthermore , the new approach does not rely on additional search models , thus also saves memory usage . 3 NOTATIONS : GRADIENT VALUE AND GRADIENT CORRELATION . Assume g ( l ) i = { g ( l ) i,1 , · · · , g ( l ) i , r } is the gradient vector of example i with respect to all parameters in the l-th layer . r is the total number of parameters . We combine all gradient vectors together to construct a gradient matrix G ( l ) ∈ Rd×r where d refers to the number of training examples . We define a matrix P ( l ) to store the dot-product of gradients . The dot-product between two gradient vectors is : P ( l ) i , j = 〈G ( l ) i , G ( l ) j〉 . ( 1 ) We divide P ( l ) by the norm of gradient vectors to get a gradient correlation matrix C ( l ) : C ( l ) i , j = P ( l ) i , j ||G ( l ) i|| · ||G ( l ) j || . ( 2 ) Then , we use the average value of C ( l ) as the final correlation score : R = E ( C ( l ) ) . ( 3 ) Here we also evaluate the absolute gradient value : V = E ( |G ( l ) | ) . ( 4 ) Since it requires too much time to calculate R and V for plenty of training examples , we randomly sample µ examples to estimate R and V in implementation for fast calculation . The dot-product between vectors with too many elements will cause the overflow problem . We also randomly sample θ parameters when calculating R. To avoid the sampling bias that might affect our findings , we test different µ ∈ [ 50 , 100 , 200 , 300 , 400 , 500 ] and θ ∈ [ 50 , 100 , 200 , 300 , 400 , 500 ] , and observe the same phenomena . For simplicity , we show our findings in the next section with µ = 50 and θ = 50 .
This paper consists of two parts, where it first studies the difficulty of neural network training, then proposes an efficient criterion for neural architecture search (NAS). In the first part, the authors propose two criteria, the average gradient absolute values and the average gradient correlations (across pairs of examples). It is claimed that both quantities are import for network training. In the second part, they propose to use gradient correlation as the reward for NAS, where it is assumed that the larger the gradient correlation the better the architecture is.
SP:a099a8bec6b5bf6a292104066f32f5152ac2bc1c
Wasserstein-2 Generative Networks
1 INTRODUCTION . Generative learning framework has become widespread over the last couple of years tentatively starting with the introduction of generative adversarial networks ( GANs ) by Goodfellow et al . ( 2014 ) . The framework aims to define a stochastic procedure to sample from a given complex probability distribution Q on a space Y ⊂ RD , e.g . a space of images . The usual generative pipeline includes sampling from tractable distribution P on space X and applying a generative mapping g : X → Y that transforms P into the desired Q . In many cases for probability distributions P , Q , there may exist several different generative mappings . For example , the mapping in Figure 1b seems to be better than the one in Figure 1a and should be preferred : the mapping in Figure 1b is straightforward , wellstructured and invertible . Existing generative learning approaches mainly do not focus on the structural properties of the generative mapping . For example , GAN-based approaches , such as f -GAN by Nowozin et al . ( 2016 ) ; Yadav et al . ( 2017 ) , WGAN by Arjovsky et al . ( 2017 ) and others Li et al . ( 2017 ) ; Mroueh & Sercu ( 2017 ) , approximate generative mapping by a neural network with a problem-specific architecture . The reasonable question is how to find a generative mapping g ◦ P = Q that is well-structured . Typically , the better the structure of the mapping is , the easier it is to find such a mapping . There are many ways to define what the well-structured mapping is . But usually , such a mapping is expected to be continuous and , if possible , invertible . One may note that when P and Q are both one-dimensional ( X , Y ⊂ R1 ) , the only class of mappings g : X → Y satisfying these properties are monotone mappings1 , i.e . ∀x , x′ ∈ X ( x 6= x′ ) satisfying ( g ( x ) − g ( x′ ) ) · ( x − x′ ) > 0 . The intuition of 1-dimensional spaces can be easily extended to X , Y ⊂ RD . We can require the similar condition to hold true : ∀x , x′ ∈ X ( x 6= x′ ) 〈g ( x ) − g ( x′ ) , x− x′〉 > 0 . ( 1 ) The condition ( 1 ) is called monotonicity , and every surjective function satisfying this condition is invertible . In one-dimensional case , for any pair of continuous P , Q with non-zero density there exists a unique monotone generative map given by g ( x ) = F−1Q ( FP ( x ) ) McCann et al . ( 1995 ) , where F ( · ) is the cumulative distribution function of P or Q . However , for D > 1 there might exist more than one generative monotone mapping . For example , when P = Q are standard 2-dimensional Gaussian distributions , all rotations by angles −π2 < α < π 2 are monotone and preserve the distribution . One may impose uniqueness by considering only maximal Peyré ( 2018 ) monotone mappings g : X → Y satisfying ∀N = 2 , 3 . . . and N distinct points x1 , . . . , xN ∈ X ( N + 1 ≡ 1 ) : N∑ n=1 〈g ( xn ) , xn − xn+1〉 > 0 . ( 2 ) The condition ( 2 ) is called cycle monotonicity and also implies `` usual '' monotonicity ( 1 ) . Importantly , for almost every two continuous probability distributions P , Q on X = Y = RD there exists a unique cycle monotone mapping g : X → Y satisfying g ◦ P = Q , see McCann et al . ( 1995 ) . Thus , instead of searching for arbitrary generative mapping , one may significantly reduce the considered approximating class of mappings by using only cycle monotone ones . According to Rockafellar ( 1966 ) , every cycle monotone mapping g is contained in a sub-gradient of some convex function ψ : X → R. Thus , every convex class of functions may produce cycle monotone mappings ( by considering sub-gradients of these functions ) . In practice , deep input convex neural networks ( ICNNs , see Amos et al . ( 2017 ) ) can be used as a class of convex functions . Formally , to fit a cycle monotone generative mapping , one may apply any existing approach , such as GANs Goodfellow et al . ( 2014 ) , with the set of generators restricted to gradients of ICNN . However , GANs typically require solving a minimax optimization problem . It turns out that the cycle monotone generators are strongly related to Wasserstein-2 distance ( W2 ) . The approaches by Taghvaei & Jalali ( 2019 ) ; Makkuva et al . ( 2019 ) use dual form of W2 to find the optimal generative mapping which is cycle monotone . The predecessor of both approaches is the gradient-descent algorithm for computing W2 distance by Chartrand et al . ( 2009 ) . The drawback of all these methods is similar to the one of GANs – their optimization objectives are minimax . Cyclically monotone generators require that both spaces X and Y have the same dimension , which poses no practical limitation . Indeed , it is possible to combine a generative mapping with a decoder of a pre-trained autoencoder , i.e . train a generative mapping into a latent space . It should be also noted that the cases with equal dimensions ofX and Y are common in computer vision . The typical example is image-to-image style transfer when both the input and the output images have the same size and number of channels . Other examples include image-to-image color transfer , domain adaptation , etc . In this paper , we develop the concept of cyclically monotone generative learning . The main contributions of the paper are as follows : 1 . Developing an end-to-end non-minimax algorithm for training cyclically monotone generative maps , i.e . optimal maps for quadratic transport cost ( Wasserstein-2 distance ) . 2 . Proving theoretical bound on the approximation properties of the transport mapping fitted by the developed approach . 3 . Developing a class of Input Convex Neural Networks whose gradients are used to approximate cyclically monotone mappings . 1We consider only monotone increasing mappings . Decreasing mappings have analogous properties . 4 . Demonstrating the performance of the method in practical problems of image-to-image color transfer , mass transport in latent spaces , image-to-image style translation and domain adaptation . Our algorithm extends the approach of Makkuva et al . ( 2019 ) , eliminates minimax optimization imposing cyclic regularization and solves non-minimax optimization problem . At the result , the algorithm scales well to high dimensions and converges up to 10x times faster than its predecessors . The paper is structured as follows . Section 2 is devoted to Related Work . In Section 3 , we give the necessary mathematical tools on Wasserstein-2 optimal transport . In Section 4 , we derive our algorithm and state our main theoretical results . In Section 5 , we provide the results of computational experiments . In Appendix A , we prove our theoretical results . In Appendix B , we describe the particular architectures of ICNN that we use for experiments . In Appendix C , additional experiments and training details are provided . 2 RELATED WORK . Modern generative learning is mainly associated with Generative Adversarial Networks ( GANs ) Goodfellow et al . ( 2014 ) ; Arjovsky et al . ( 2017 ) . Basic GAN model consists of two competing networks : generator g and discriminator d. Generator g takes as input samples x from given distribution P and tries to produce realistic samples from real data distribution Q. Discriminator d attempts to distinguish between generated and real distributions g ◦P and Q respectively . Formally , it approximates a dissimilarity measure between g ◦ P and Q ( e.g . f -divergence Nowozin et al . ( 2016 ) or Wasserstein-1 distance Arjovsky et al . ( 2017 ) ) . Although superior performance is reported for many applications of GANs Karras et al . ( 2017 ) ; Mirza & Osindero ( 2014 ) , training such models is always hard due to the minimax nature of the optimization objective . Another important branch of generative learning is related to the theory of Optimal Transport ( OT ) Villani ( 2008 ) ; Peyré et al . ( 2019 ) . OT methods seek generative mapping2 g : X → Y , optimal in the sense of the given transport cost c : X × Y → R : Cost ( P , Q ) = min g◦P=Q ∫ X c ( x , g ( x ) ) dP ( x ) . ( 3 ) Equation ( 3 ) is also known as Monge ’ s formulation of optimal transportation Villani ( 2008 ) . The principal OT generative method Seguy et al . ( 2017 ) is based on optimizing the regularized dual form of the transport cost ( 3 ) . It fits two potentials ψ , ψ ( primal and conjugate ) and then uses the barycentric projection to establish the desired ( third ) generative network g. Although the method uses non-minimax optimization objective , it is not end-to-end ( consists of two sequential steps ) . In the case of quadratic transport cost c ( x , y ) = ‖x−y‖ 2 2 , the value ( 3 ) is known as the square of Wasserstein-2 distance : W22 ( P , Q ) = min g◦P=Q ∫ X ‖x− g ( x ) ‖2 2 dP ( x ) . ( 4 ) It has been well studied in literature Brenier ( 1991 ) ; McCann et al . ( 1995 ) ; Villani ( 2003 ; 2008 ) and has many useful properties which we discuss in Section 3 in more detail . The optimal mapping for the quadratic cost is cyclically monotone . Several algorithms exist Lei et al . ( 2019 ) ; Taghvaei & Jalali ( 2019 ) ; Makkuva et al . ( 2019 ) for finding this mapping . The recent approach by Taghvaei & Jalali ( 2019 ) uses the gradient-descent-based algorithm by Chartrand et al . ( 2009 ) for computing W2 . The key idea is to approximate the optimal potential ψ∗ by an ICNN Amos et al . ( 2017 ) , and extract the optimal generator g∗ from its gradient ∇ψ∗ . The method is impractical due to high computational complexity : during the main optimization cycle , it solves an additional optimization sub-problem . The inner problem is convex but computationally costly . This was noted in the original paper and de-facto confirmed by the lack of experiments with complex distributions . A refinement of this approach is proposed by Makkuva et al . ( 2019 ) . The inner optimization sub-problem is removed , and a network is used to approximate its solution . This speeds up the computation , but the problem is still minimax . 2Commonly , in OT it is assumed that dimX = dimY . 3 PRELIMINARIES . In the section , we recall the properties of W2 distance ( 4 ) and its relation to cycle monotone mappings . Throughout the paper , we assume that P and Q are continuous distributions on X = Y = RD with finite second moments.3 This condition guarantees that ( 3 ) is well-defined in the sense that the optimal mapping g∗ always exists . It follows from ( Villani , 2003 , Brenier ’ s Theorem 2.12 ) that its restriction to the support of P is unique ( up to the values on the small sets ) and invertible . The symmetric characteristics apply to its inverse ( g∗ ) −1 , which induces symmetry to definition ( 4 ) for quadratic cost . According to Villani ( 2003 ) , the dual form of ( 4 ) is given by W22 ( P , Q ) = ∫ X ‖x‖2 2 dP ( x ) + ∫ Y ‖y‖2 2 dQ ( y ) ︸ ︷︷ ︸ Const ( P , Q ) − min ψ∈Convex [ ∫ X ψ ( x ) dP ( x ) + ∫ Y ψ ( y ) dQ ( y ) ] ︸ ︷︷ ︸ Corr ( P , Q ) , ( 5 ) where the minimum is taken over all the convex functions ( potentials ) ψ : X → R ∪ { ∞ } , and ψ ( y ) = maxx∈X ( 〈x , y〉 − ψ ( x ) ) is the convex conjugate Fenchel ( 1949 ) to ψ , which is also a convex function , ψ : Y → R ∪ { ∞ } . We call the value of the minimum in ( 5 ) cyclically monotone correlations and denote it by Corr ( P , Q ) . By equating ( 5 ) with ( 4 ) , one may derive the formula Corr ( P , Q ) = max g◦P=Q ∫ X 〈x , g ( x ) 〉dP ( x ) . ( 6 ) Note that ( − Corr ( P , Q ) ) can be viewed as an optimal transport cost for bilinear cost function c ( x , y ) = −〈x , y〉 , see McCann et al . ( 1995 ) . Thus , searching for optimal transport map g∗ for W2 is equivalent to finding the mapping which maximizes correlations ( 6 ) . It is known for W2 distance that the gradient g∗ = ∇ψ∗ of optimal potential ψ∗ readily gives the minimizer of ( 4 ) , see Villani ( 2003 ) . Being a gradient of a convex function , it is necessarily cycle monotone . In particular , the inverse mapping can be obtained by taking the gradient w.r.t . input of the conjugate of optimal potential ψ∗ ( y ) McCann et al . ( 1995 ) . Thus , we have ( g∗ ) −1 ( y ) = ( ∇ψ∗ ) −1 ( y ) = ∇ψ∗ ( y ) . ( 7 ) In fact , one may approximate the primal potential ψ by a parametric class Θ of input convex functions ψθ and optimize correlations min θ∈Θ Corr ( P , Q | ψθ ) = min θ∈Θ [ ∫ X ψθ ( x ) dP ( x ) + ∫ Y ψθ ( y ) dQ ( y ) ] ( 8 ) in order to extract the approximate optimal generator gθ† : X → Y from the approximate potential ψθ† . Note that in general it is not true that gθ† ◦ P will be equal to Q . However , we prove that if Corr ( P , Q | ψθ† ) is close to Corr ( P , Q ) , then gθ† ◦ P ≈ Q , see our Theorem A.3 in Appendix A.2 . The optimization of ( 8 ) can be performed via stochastic gradient descent . It is possible to get rid of conjugate ψθ and extract an analytic formula for the gradient of ( 8 ) w.r.t . parameters θ by using ψθ only , see the derivations in Taghvaei & Jalali ( 2019 ) ; Chartrand et al . ( 2009 ) : ∂Corr ( P , Q | ψθ ) ∂θ = ∫ X ∂ψθ ( x ) ∂θ dP ( x ) − ∫ Y ∂ψθ ( x̂ ) ∂θ dQ ( y ) , where ∂ψθ∂θ in the second integral is computed at x̂ = ( ∇ψθ ) −1 ( y ) , i.e . inverse value of y for ∇ψθ . In practice , both integrals are replaced by their Monte Carlo estimates over random mini-batches from P and Q . Yet to compute the second integral , one needs to recover the inverse values of the current mapping∇ψθ for all y ∼ Q in the mini batch . To do this , the following optimization sub-problem has to be solved x̂ = ( ∇ψθ ) −1 ( y ) ⇔ x̂ = arg max x∈X ( 〈x , y〉 − ψθ ( x ) ) ( 9 ) 3In practice , the continuity condition can be assumed to hold true . Indeed , widely used heuristics , such as adding small Gaussian noise to data Sønderby et al . ( 2016 ) , make considered distributions to be continuous . for each y ∼ Q in the mini batch . The optimization problem ( 9 ) is convex but complex because it requires computing the gradient of ψθ multiple times . It is computationally costly since ψθ is in general a large neural network . Besides , during iterations over θ , each time a new independent batch of samples arrives . This makes it hard to use the information on the solution of ( 9 ) from the previous gradient descent step over θ in ( 8 ) .
This paper proposes Wasserstein-2 Generative Networks (W2GNs) which is an optimal transport framework for learning generative models. Unlike minimax problems of Wasserstein GANs, the proposed approach which is based on minimizing the 2-Wasserstein distance reduces to a single-level optimization problem. The paper numerically shows that the new approach enjoys faster convergence and improves upon the performance scores of Wasserstein GANs and other optimal transport baselines. While the paper's idea on applying optimal transport tools for training generative models seems interesting, the discussed theoretical and numerical results are not supportive enough to show that the proposed approach indeed improves upon WGANs. Also, the theoretical sections have been written in a convoluted way with several weakly supported claims and the final algorithm has not been stated clearly. I, therefore, do not recommend the paper for acceptance.
SP:2600690b40d3f6b9c4e237c6a11685dc7912b466
Wasserstein-2 Generative Networks
1 INTRODUCTION . Generative learning framework has become widespread over the last couple of years tentatively starting with the introduction of generative adversarial networks ( GANs ) by Goodfellow et al . ( 2014 ) . The framework aims to define a stochastic procedure to sample from a given complex probability distribution Q on a space Y ⊂ RD , e.g . a space of images . The usual generative pipeline includes sampling from tractable distribution P on space X and applying a generative mapping g : X → Y that transforms P into the desired Q . In many cases for probability distributions P , Q , there may exist several different generative mappings . For example , the mapping in Figure 1b seems to be better than the one in Figure 1a and should be preferred : the mapping in Figure 1b is straightforward , wellstructured and invertible . Existing generative learning approaches mainly do not focus on the structural properties of the generative mapping . For example , GAN-based approaches , such as f -GAN by Nowozin et al . ( 2016 ) ; Yadav et al . ( 2017 ) , WGAN by Arjovsky et al . ( 2017 ) and others Li et al . ( 2017 ) ; Mroueh & Sercu ( 2017 ) , approximate generative mapping by a neural network with a problem-specific architecture . The reasonable question is how to find a generative mapping g ◦ P = Q that is well-structured . Typically , the better the structure of the mapping is , the easier it is to find such a mapping . There are many ways to define what the well-structured mapping is . But usually , such a mapping is expected to be continuous and , if possible , invertible . One may note that when P and Q are both one-dimensional ( X , Y ⊂ R1 ) , the only class of mappings g : X → Y satisfying these properties are monotone mappings1 , i.e . ∀x , x′ ∈ X ( x 6= x′ ) satisfying ( g ( x ) − g ( x′ ) ) · ( x − x′ ) > 0 . The intuition of 1-dimensional spaces can be easily extended to X , Y ⊂ RD . We can require the similar condition to hold true : ∀x , x′ ∈ X ( x 6= x′ ) 〈g ( x ) − g ( x′ ) , x− x′〉 > 0 . ( 1 ) The condition ( 1 ) is called monotonicity , and every surjective function satisfying this condition is invertible . In one-dimensional case , for any pair of continuous P , Q with non-zero density there exists a unique monotone generative map given by g ( x ) = F−1Q ( FP ( x ) ) McCann et al . ( 1995 ) , where F ( · ) is the cumulative distribution function of P or Q . However , for D > 1 there might exist more than one generative monotone mapping . For example , when P = Q are standard 2-dimensional Gaussian distributions , all rotations by angles −π2 < α < π 2 are monotone and preserve the distribution . One may impose uniqueness by considering only maximal Peyré ( 2018 ) monotone mappings g : X → Y satisfying ∀N = 2 , 3 . . . and N distinct points x1 , . . . , xN ∈ X ( N + 1 ≡ 1 ) : N∑ n=1 〈g ( xn ) , xn − xn+1〉 > 0 . ( 2 ) The condition ( 2 ) is called cycle monotonicity and also implies `` usual '' monotonicity ( 1 ) . Importantly , for almost every two continuous probability distributions P , Q on X = Y = RD there exists a unique cycle monotone mapping g : X → Y satisfying g ◦ P = Q , see McCann et al . ( 1995 ) . Thus , instead of searching for arbitrary generative mapping , one may significantly reduce the considered approximating class of mappings by using only cycle monotone ones . According to Rockafellar ( 1966 ) , every cycle monotone mapping g is contained in a sub-gradient of some convex function ψ : X → R. Thus , every convex class of functions may produce cycle monotone mappings ( by considering sub-gradients of these functions ) . In practice , deep input convex neural networks ( ICNNs , see Amos et al . ( 2017 ) ) can be used as a class of convex functions . Formally , to fit a cycle monotone generative mapping , one may apply any existing approach , such as GANs Goodfellow et al . ( 2014 ) , with the set of generators restricted to gradients of ICNN . However , GANs typically require solving a minimax optimization problem . It turns out that the cycle monotone generators are strongly related to Wasserstein-2 distance ( W2 ) . The approaches by Taghvaei & Jalali ( 2019 ) ; Makkuva et al . ( 2019 ) use dual form of W2 to find the optimal generative mapping which is cycle monotone . The predecessor of both approaches is the gradient-descent algorithm for computing W2 distance by Chartrand et al . ( 2009 ) . The drawback of all these methods is similar to the one of GANs – their optimization objectives are minimax . Cyclically monotone generators require that both spaces X and Y have the same dimension , which poses no practical limitation . Indeed , it is possible to combine a generative mapping with a decoder of a pre-trained autoencoder , i.e . train a generative mapping into a latent space . It should be also noted that the cases with equal dimensions ofX and Y are common in computer vision . The typical example is image-to-image style transfer when both the input and the output images have the same size and number of channels . Other examples include image-to-image color transfer , domain adaptation , etc . In this paper , we develop the concept of cyclically monotone generative learning . The main contributions of the paper are as follows : 1 . Developing an end-to-end non-minimax algorithm for training cyclically monotone generative maps , i.e . optimal maps for quadratic transport cost ( Wasserstein-2 distance ) . 2 . Proving theoretical bound on the approximation properties of the transport mapping fitted by the developed approach . 3 . Developing a class of Input Convex Neural Networks whose gradients are used to approximate cyclically monotone mappings . 1We consider only monotone increasing mappings . Decreasing mappings have analogous properties . 4 . Demonstrating the performance of the method in practical problems of image-to-image color transfer , mass transport in latent spaces , image-to-image style translation and domain adaptation . Our algorithm extends the approach of Makkuva et al . ( 2019 ) , eliminates minimax optimization imposing cyclic regularization and solves non-minimax optimization problem . At the result , the algorithm scales well to high dimensions and converges up to 10x times faster than its predecessors . The paper is structured as follows . Section 2 is devoted to Related Work . In Section 3 , we give the necessary mathematical tools on Wasserstein-2 optimal transport . In Section 4 , we derive our algorithm and state our main theoretical results . In Section 5 , we provide the results of computational experiments . In Appendix A , we prove our theoretical results . In Appendix B , we describe the particular architectures of ICNN that we use for experiments . In Appendix C , additional experiments and training details are provided . 2 RELATED WORK . Modern generative learning is mainly associated with Generative Adversarial Networks ( GANs ) Goodfellow et al . ( 2014 ) ; Arjovsky et al . ( 2017 ) . Basic GAN model consists of two competing networks : generator g and discriminator d. Generator g takes as input samples x from given distribution P and tries to produce realistic samples from real data distribution Q. Discriminator d attempts to distinguish between generated and real distributions g ◦P and Q respectively . Formally , it approximates a dissimilarity measure between g ◦ P and Q ( e.g . f -divergence Nowozin et al . ( 2016 ) or Wasserstein-1 distance Arjovsky et al . ( 2017 ) ) . Although superior performance is reported for many applications of GANs Karras et al . ( 2017 ) ; Mirza & Osindero ( 2014 ) , training such models is always hard due to the minimax nature of the optimization objective . Another important branch of generative learning is related to the theory of Optimal Transport ( OT ) Villani ( 2008 ) ; Peyré et al . ( 2019 ) . OT methods seek generative mapping2 g : X → Y , optimal in the sense of the given transport cost c : X × Y → R : Cost ( P , Q ) = min g◦P=Q ∫ X c ( x , g ( x ) ) dP ( x ) . ( 3 ) Equation ( 3 ) is also known as Monge ’ s formulation of optimal transportation Villani ( 2008 ) . The principal OT generative method Seguy et al . ( 2017 ) is based on optimizing the regularized dual form of the transport cost ( 3 ) . It fits two potentials ψ , ψ ( primal and conjugate ) and then uses the barycentric projection to establish the desired ( third ) generative network g. Although the method uses non-minimax optimization objective , it is not end-to-end ( consists of two sequential steps ) . In the case of quadratic transport cost c ( x , y ) = ‖x−y‖ 2 2 , the value ( 3 ) is known as the square of Wasserstein-2 distance : W22 ( P , Q ) = min g◦P=Q ∫ X ‖x− g ( x ) ‖2 2 dP ( x ) . ( 4 ) It has been well studied in literature Brenier ( 1991 ) ; McCann et al . ( 1995 ) ; Villani ( 2003 ; 2008 ) and has many useful properties which we discuss in Section 3 in more detail . The optimal mapping for the quadratic cost is cyclically monotone . Several algorithms exist Lei et al . ( 2019 ) ; Taghvaei & Jalali ( 2019 ) ; Makkuva et al . ( 2019 ) for finding this mapping . The recent approach by Taghvaei & Jalali ( 2019 ) uses the gradient-descent-based algorithm by Chartrand et al . ( 2009 ) for computing W2 . The key idea is to approximate the optimal potential ψ∗ by an ICNN Amos et al . ( 2017 ) , and extract the optimal generator g∗ from its gradient ∇ψ∗ . The method is impractical due to high computational complexity : during the main optimization cycle , it solves an additional optimization sub-problem . The inner problem is convex but computationally costly . This was noted in the original paper and de-facto confirmed by the lack of experiments with complex distributions . A refinement of this approach is proposed by Makkuva et al . ( 2019 ) . The inner optimization sub-problem is removed , and a network is used to approximate its solution . This speeds up the computation , but the problem is still minimax . 2Commonly , in OT it is assumed that dimX = dimY . 3 PRELIMINARIES . In the section , we recall the properties of W2 distance ( 4 ) and its relation to cycle monotone mappings . Throughout the paper , we assume that P and Q are continuous distributions on X = Y = RD with finite second moments.3 This condition guarantees that ( 3 ) is well-defined in the sense that the optimal mapping g∗ always exists . It follows from ( Villani , 2003 , Brenier ’ s Theorem 2.12 ) that its restriction to the support of P is unique ( up to the values on the small sets ) and invertible . The symmetric characteristics apply to its inverse ( g∗ ) −1 , which induces symmetry to definition ( 4 ) for quadratic cost . According to Villani ( 2003 ) , the dual form of ( 4 ) is given by W22 ( P , Q ) = ∫ X ‖x‖2 2 dP ( x ) + ∫ Y ‖y‖2 2 dQ ( y ) ︸ ︷︷ ︸ Const ( P , Q ) − min ψ∈Convex [ ∫ X ψ ( x ) dP ( x ) + ∫ Y ψ ( y ) dQ ( y ) ] ︸ ︷︷ ︸ Corr ( P , Q ) , ( 5 ) where the minimum is taken over all the convex functions ( potentials ) ψ : X → R ∪ { ∞ } , and ψ ( y ) = maxx∈X ( 〈x , y〉 − ψ ( x ) ) is the convex conjugate Fenchel ( 1949 ) to ψ , which is also a convex function , ψ : Y → R ∪ { ∞ } . We call the value of the minimum in ( 5 ) cyclically monotone correlations and denote it by Corr ( P , Q ) . By equating ( 5 ) with ( 4 ) , one may derive the formula Corr ( P , Q ) = max g◦P=Q ∫ X 〈x , g ( x ) 〉dP ( x ) . ( 6 ) Note that ( − Corr ( P , Q ) ) can be viewed as an optimal transport cost for bilinear cost function c ( x , y ) = −〈x , y〉 , see McCann et al . ( 1995 ) . Thus , searching for optimal transport map g∗ for W2 is equivalent to finding the mapping which maximizes correlations ( 6 ) . It is known for W2 distance that the gradient g∗ = ∇ψ∗ of optimal potential ψ∗ readily gives the minimizer of ( 4 ) , see Villani ( 2003 ) . Being a gradient of a convex function , it is necessarily cycle monotone . In particular , the inverse mapping can be obtained by taking the gradient w.r.t . input of the conjugate of optimal potential ψ∗ ( y ) McCann et al . ( 1995 ) . Thus , we have ( g∗ ) −1 ( y ) = ( ∇ψ∗ ) −1 ( y ) = ∇ψ∗ ( y ) . ( 7 ) In fact , one may approximate the primal potential ψ by a parametric class Θ of input convex functions ψθ and optimize correlations min θ∈Θ Corr ( P , Q | ψθ ) = min θ∈Θ [ ∫ X ψθ ( x ) dP ( x ) + ∫ Y ψθ ( y ) dQ ( y ) ] ( 8 ) in order to extract the approximate optimal generator gθ† : X → Y from the approximate potential ψθ† . Note that in general it is not true that gθ† ◦ P will be equal to Q . However , we prove that if Corr ( P , Q | ψθ† ) is close to Corr ( P , Q ) , then gθ† ◦ P ≈ Q , see our Theorem A.3 in Appendix A.2 . The optimization of ( 8 ) can be performed via stochastic gradient descent . It is possible to get rid of conjugate ψθ and extract an analytic formula for the gradient of ( 8 ) w.r.t . parameters θ by using ψθ only , see the derivations in Taghvaei & Jalali ( 2019 ) ; Chartrand et al . ( 2009 ) : ∂Corr ( P , Q | ψθ ) ∂θ = ∫ X ∂ψθ ( x ) ∂θ dP ( x ) − ∫ Y ∂ψθ ( x̂ ) ∂θ dQ ( y ) , where ∂ψθ∂θ in the second integral is computed at x̂ = ( ∇ψθ ) −1 ( y ) , i.e . inverse value of y for ∇ψθ . In practice , both integrals are replaced by their Monte Carlo estimates over random mini-batches from P and Q . Yet to compute the second integral , one needs to recover the inverse values of the current mapping∇ψθ for all y ∼ Q in the mini batch . To do this , the following optimization sub-problem has to be solved x̂ = ( ∇ψθ ) −1 ( y ) ⇔ x̂ = arg max x∈X ( 〈x , y〉 − ψθ ( x ) ) ( 9 ) 3In practice , the continuity condition can be assumed to hold true . Indeed , widely used heuristics , such as adding small Gaussian noise to data Sønderby et al . ( 2016 ) , make considered distributions to be continuous . for each y ∼ Q in the mini batch . The optimization problem ( 9 ) is convex but complex because it requires computing the gradient of ψθ multiple times . It is computationally costly since ψθ is in general a large neural network . Besides , during iterations over θ , each time a new independent batch of samples arrives . This makes it hard to use the information on the solution of ( 9 ) from the previous gradient descent step over θ in ( 8 ) .
The paper proposes a new method for learning an optimal pushforward (for the quadratic cost) from a distribution to another distribution based on samples of both distributions. The optimal transport problem is first written equivalently as a minimax problem over set of convex functions, as in Makkuva et al. 19. Then, the convex functions are parametrized as Input Convex Neural Networks (ICNN). To my understanding, the novelty of the approach is to replace the minimax problem over the parameters of the ICNN by an easier to solve a regularized minimization problem. The authors prove the consistency of their approach: loosely speaking, they show that true minimizers of their approximate problem are epsilon minimizers of the original optimal transport problem. They also provide promising numerical experiments.
SP:2600690b40d3f6b9c4e237c6a11685dc7912b466
Wasserstein-2 Generative Networks
1 INTRODUCTION . Generative learning framework has become widespread over the last couple of years tentatively starting with the introduction of generative adversarial networks ( GANs ) by Goodfellow et al . ( 2014 ) . The framework aims to define a stochastic procedure to sample from a given complex probability distribution Q on a space Y ⊂ RD , e.g . a space of images . The usual generative pipeline includes sampling from tractable distribution P on space X and applying a generative mapping g : X → Y that transforms P into the desired Q . In many cases for probability distributions P , Q , there may exist several different generative mappings . For example , the mapping in Figure 1b seems to be better than the one in Figure 1a and should be preferred : the mapping in Figure 1b is straightforward , wellstructured and invertible . Existing generative learning approaches mainly do not focus on the structural properties of the generative mapping . For example , GAN-based approaches , such as f -GAN by Nowozin et al . ( 2016 ) ; Yadav et al . ( 2017 ) , WGAN by Arjovsky et al . ( 2017 ) and others Li et al . ( 2017 ) ; Mroueh & Sercu ( 2017 ) , approximate generative mapping by a neural network with a problem-specific architecture . The reasonable question is how to find a generative mapping g ◦ P = Q that is well-structured . Typically , the better the structure of the mapping is , the easier it is to find such a mapping . There are many ways to define what the well-structured mapping is . But usually , such a mapping is expected to be continuous and , if possible , invertible . One may note that when P and Q are both one-dimensional ( X , Y ⊂ R1 ) , the only class of mappings g : X → Y satisfying these properties are monotone mappings1 , i.e . ∀x , x′ ∈ X ( x 6= x′ ) satisfying ( g ( x ) − g ( x′ ) ) · ( x − x′ ) > 0 . The intuition of 1-dimensional spaces can be easily extended to X , Y ⊂ RD . We can require the similar condition to hold true : ∀x , x′ ∈ X ( x 6= x′ ) 〈g ( x ) − g ( x′ ) , x− x′〉 > 0 . ( 1 ) The condition ( 1 ) is called monotonicity , and every surjective function satisfying this condition is invertible . In one-dimensional case , for any pair of continuous P , Q with non-zero density there exists a unique monotone generative map given by g ( x ) = F−1Q ( FP ( x ) ) McCann et al . ( 1995 ) , where F ( · ) is the cumulative distribution function of P or Q . However , for D > 1 there might exist more than one generative monotone mapping . For example , when P = Q are standard 2-dimensional Gaussian distributions , all rotations by angles −π2 < α < π 2 are monotone and preserve the distribution . One may impose uniqueness by considering only maximal Peyré ( 2018 ) monotone mappings g : X → Y satisfying ∀N = 2 , 3 . . . and N distinct points x1 , . . . , xN ∈ X ( N + 1 ≡ 1 ) : N∑ n=1 〈g ( xn ) , xn − xn+1〉 > 0 . ( 2 ) The condition ( 2 ) is called cycle monotonicity and also implies `` usual '' monotonicity ( 1 ) . Importantly , for almost every two continuous probability distributions P , Q on X = Y = RD there exists a unique cycle monotone mapping g : X → Y satisfying g ◦ P = Q , see McCann et al . ( 1995 ) . Thus , instead of searching for arbitrary generative mapping , one may significantly reduce the considered approximating class of mappings by using only cycle monotone ones . According to Rockafellar ( 1966 ) , every cycle monotone mapping g is contained in a sub-gradient of some convex function ψ : X → R. Thus , every convex class of functions may produce cycle monotone mappings ( by considering sub-gradients of these functions ) . In practice , deep input convex neural networks ( ICNNs , see Amos et al . ( 2017 ) ) can be used as a class of convex functions . Formally , to fit a cycle monotone generative mapping , one may apply any existing approach , such as GANs Goodfellow et al . ( 2014 ) , with the set of generators restricted to gradients of ICNN . However , GANs typically require solving a minimax optimization problem . It turns out that the cycle monotone generators are strongly related to Wasserstein-2 distance ( W2 ) . The approaches by Taghvaei & Jalali ( 2019 ) ; Makkuva et al . ( 2019 ) use dual form of W2 to find the optimal generative mapping which is cycle monotone . The predecessor of both approaches is the gradient-descent algorithm for computing W2 distance by Chartrand et al . ( 2009 ) . The drawback of all these methods is similar to the one of GANs – their optimization objectives are minimax . Cyclically monotone generators require that both spaces X and Y have the same dimension , which poses no practical limitation . Indeed , it is possible to combine a generative mapping with a decoder of a pre-trained autoencoder , i.e . train a generative mapping into a latent space . It should be also noted that the cases with equal dimensions ofX and Y are common in computer vision . The typical example is image-to-image style transfer when both the input and the output images have the same size and number of channels . Other examples include image-to-image color transfer , domain adaptation , etc . In this paper , we develop the concept of cyclically monotone generative learning . The main contributions of the paper are as follows : 1 . Developing an end-to-end non-minimax algorithm for training cyclically monotone generative maps , i.e . optimal maps for quadratic transport cost ( Wasserstein-2 distance ) . 2 . Proving theoretical bound on the approximation properties of the transport mapping fitted by the developed approach . 3 . Developing a class of Input Convex Neural Networks whose gradients are used to approximate cyclically monotone mappings . 1We consider only monotone increasing mappings . Decreasing mappings have analogous properties . 4 . Demonstrating the performance of the method in practical problems of image-to-image color transfer , mass transport in latent spaces , image-to-image style translation and domain adaptation . Our algorithm extends the approach of Makkuva et al . ( 2019 ) , eliminates minimax optimization imposing cyclic regularization and solves non-minimax optimization problem . At the result , the algorithm scales well to high dimensions and converges up to 10x times faster than its predecessors . The paper is structured as follows . Section 2 is devoted to Related Work . In Section 3 , we give the necessary mathematical tools on Wasserstein-2 optimal transport . In Section 4 , we derive our algorithm and state our main theoretical results . In Section 5 , we provide the results of computational experiments . In Appendix A , we prove our theoretical results . In Appendix B , we describe the particular architectures of ICNN that we use for experiments . In Appendix C , additional experiments and training details are provided . 2 RELATED WORK . Modern generative learning is mainly associated with Generative Adversarial Networks ( GANs ) Goodfellow et al . ( 2014 ) ; Arjovsky et al . ( 2017 ) . Basic GAN model consists of two competing networks : generator g and discriminator d. Generator g takes as input samples x from given distribution P and tries to produce realistic samples from real data distribution Q. Discriminator d attempts to distinguish between generated and real distributions g ◦P and Q respectively . Formally , it approximates a dissimilarity measure between g ◦ P and Q ( e.g . f -divergence Nowozin et al . ( 2016 ) or Wasserstein-1 distance Arjovsky et al . ( 2017 ) ) . Although superior performance is reported for many applications of GANs Karras et al . ( 2017 ) ; Mirza & Osindero ( 2014 ) , training such models is always hard due to the minimax nature of the optimization objective . Another important branch of generative learning is related to the theory of Optimal Transport ( OT ) Villani ( 2008 ) ; Peyré et al . ( 2019 ) . OT methods seek generative mapping2 g : X → Y , optimal in the sense of the given transport cost c : X × Y → R : Cost ( P , Q ) = min g◦P=Q ∫ X c ( x , g ( x ) ) dP ( x ) . ( 3 ) Equation ( 3 ) is also known as Monge ’ s formulation of optimal transportation Villani ( 2008 ) . The principal OT generative method Seguy et al . ( 2017 ) is based on optimizing the regularized dual form of the transport cost ( 3 ) . It fits two potentials ψ , ψ ( primal and conjugate ) and then uses the barycentric projection to establish the desired ( third ) generative network g. Although the method uses non-minimax optimization objective , it is not end-to-end ( consists of two sequential steps ) . In the case of quadratic transport cost c ( x , y ) = ‖x−y‖ 2 2 , the value ( 3 ) is known as the square of Wasserstein-2 distance : W22 ( P , Q ) = min g◦P=Q ∫ X ‖x− g ( x ) ‖2 2 dP ( x ) . ( 4 ) It has been well studied in literature Brenier ( 1991 ) ; McCann et al . ( 1995 ) ; Villani ( 2003 ; 2008 ) and has many useful properties which we discuss in Section 3 in more detail . The optimal mapping for the quadratic cost is cyclically monotone . Several algorithms exist Lei et al . ( 2019 ) ; Taghvaei & Jalali ( 2019 ) ; Makkuva et al . ( 2019 ) for finding this mapping . The recent approach by Taghvaei & Jalali ( 2019 ) uses the gradient-descent-based algorithm by Chartrand et al . ( 2009 ) for computing W2 . The key idea is to approximate the optimal potential ψ∗ by an ICNN Amos et al . ( 2017 ) , and extract the optimal generator g∗ from its gradient ∇ψ∗ . The method is impractical due to high computational complexity : during the main optimization cycle , it solves an additional optimization sub-problem . The inner problem is convex but computationally costly . This was noted in the original paper and de-facto confirmed by the lack of experiments with complex distributions . A refinement of this approach is proposed by Makkuva et al . ( 2019 ) . The inner optimization sub-problem is removed , and a network is used to approximate its solution . This speeds up the computation , but the problem is still minimax . 2Commonly , in OT it is assumed that dimX = dimY . 3 PRELIMINARIES . In the section , we recall the properties of W2 distance ( 4 ) and its relation to cycle monotone mappings . Throughout the paper , we assume that P and Q are continuous distributions on X = Y = RD with finite second moments.3 This condition guarantees that ( 3 ) is well-defined in the sense that the optimal mapping g∗ always exists . It follows from ( Villani , 2003 , Brenier ’ s Theorem 2.12 ) that its restriction to the support of P is unique ( up to the values on the small sets ) and invertible . The symmetric characteristics apply to its inverse ( g∗ ) −1 , which induces symmetry to definition ( 4 ) for quadratic cost . According to Villani ( 2003 ) , the dual form of ( 4 ) is given by W22 ( P , Q ) = ∫ X ‖x‖2 2 dP ( x ) + ∫ Y ‖y‖2 2 dQ ( y ) ︸ ︷︷ ︸ Const ( P , Q ) − min ψ∈Convex [ ∫ X ψ ( x ) dP ( x ) + ∫ Y ψ ( y ) dQ ( y ) ] ︸ ︷︷ ︸ Corr ( P , Q ) , ( 5 ) where the minimum is taken over all the convex functions ( potentials ) ψ : X → R ∪ { ∞ } , and ψ ( y ) = maxx∈X ( 〈x , y〉 − ψ ( x ) ) is the convex conjugate Fenchel ( 1949 ) to ψ , which is also a convex function , ψ : Y → R ∪ { ∞ } . We call the value of the minimum in ( 5 ) cyclically monotone correlations and denote it by Corr ( P , Q ) . By equating ( 5 ) with ( 4 ) , one may derive the formula Corr ( P , Q ) = max g◦P=Q ∫ X 〈x , g ( x ) 〉dP ( x ) . ( 6 ) Note that ( − Corr ( P , Q ) ) can be viewed as an optimal transport cost for bilinear cost function c ( x , y ) = −〈x , y〉 , see McCann et al . ( 1995 ) . Thus , searching for optimal transport map g∗ for W2 is equivalent to finding the mapping which maximizes correlations ( 6 ) . It is known for W2 distance that the gradient g∗ = ∇ψ∗ of optimal potential ψ∗ readily gives the minimizer of ( 4 ) , see Villani ( 2003 ) . Being a gradient of a convex function , it is necessarily cycle monotone . In particular , the inverse mapping can be obtained by taking the gradient w.r.t . input of the conjugate of optimal potential ψ∗ ( y ) McCann et al . ( 1995 ) . Thus , we have ( g∗ ) −1 ( y ) = ( ∇ψ∗ ) −1 ( y ) = ∇ψ∗ ( y ) . ( 7 ) In fact , one may approximate the primal potential ψ by a parametric class Θ of input convex functions ψθ and optimize correlations min θ∈Θ Corr ( P , Q | ψθ ) = min θ∈Θ [ ∫ X ψθ ( x ) dP ( x ) + ∫ Y ψθ ( y ) dQ ( y ) ] ( 8 ) in order to extract the approximate optimal generator gθ† : X → Y from the approximate potential ψθ† . Note that in general it is not true that gθ† ◦ P will be equal to Q . However , we prove that if Corr ( P , Q | ψθ† ) is close to Corr ( P , Q ) , then gθ† ◦ P ≈ Q , see our Theorem A.3 in Appendix A.2 . The optimization of ( 8 ) can be performed via stochastic gradient descent . It is possible to get rid of conjugate ψθ and extract an analytic formula for the gradient of ( 8 ) w.r.t . parameters θ by using ψθ only , see the derivations in Taghvaei & Jalali ( 2019 ) ; Chartrand et al . ( 2009 ) : ∂Corr ( P , Q | ψθ ) ∂θ = ∫ X ∂ψθ ( x ) ∂θ dP ( x ) − ∫ Y ∂ψθ ( x̂ ) ∂θ dQ ( y ) , where ∂ψθ∂θ in the second integral is computed at x̂ = ( ∇ψθ ) −1 ( y ) , i.e . inverse value of y for ∇ψθ . In practice , both integrals are replaced by their Monte Carlo estimates over random mini-batches from P and Q . Yet to compute the second integral , one needs to recover the inverse values of the current mapping∇ψθ for all y ∼ Q in the mini batch . To do this , the following optimization sub-problem has to be solved x̂ = ( ∇ψθ ) −1 ( y ) ⇔ x̂ = arg max x∈X ( 〈x , y〉 − ψθ ( x ) ) ( 9 ) 3In practice , the continuity condition can be assumed to hold true . Indeed , widely used heuristics , such as adding small Gaussian noise to data Sønderby et al . ( 2016 ) , make considered distributions to be continuous . for each y ∼ Q in the mini batch . The optimization problem ( 9 ) is convex but complex because it requires computing the gradient of ψθ multiple times . It is computationally costly since ψθ is in general a large neural network . Besides , during iterations over θ , each time a new independent batch of samples arrives . This makes it hard to use the information on the solution of ( 9 ) from the previous gradient descent step over θ in ( 8 ) .
From my perspective, this is a much needed and love-to-see work for the line of neural generative modeling. Previous approaches were dominated by GAN based approaches which require solving a minimax optimization which has technical hurdles in practice. This paper reviews the literature of OT theory, and provides a comprehensive explanation about the relation between W_2 and cyclical monotonic map. In particular, it motivates the opportunity to approximate Eq. (8) with Eq.(12), as which a non-minimax formulation exist.
SP:2600690b40d3f6b9c4e237c6a11685dc7912b466
Efficient Certified Defenses Against Patch Attacks on Image Classifiers
Adversarial patches pose a realistic threat model for physical world attacks on autonomous systems via their perception component . Autonomous systems in safety-critical domains such as automated driving should thus contain a fail-safe fallback component that combines certifiable robustness against patches with efficient inference while maintaining high performance on clean inputs . We propose BAGCERT , a novel combination of model architecture and certification procedure that allows efficient certification . We derive a loss that enables end-to-end optimization of certified robustness against patches of different sizes and locations . On CIFAR10 , BAGCERT certifies 10.000 examples in 43 seconds on a single GPU and obtains 86 % clean and 60 % certified accuracy against 5× 5 patches . 1 INTRODUCTION . Adversarial patches ( Brown et al. , 2017 ) are one of the most relevant threat models for attacks on autonomous systems such as highly automated cars or robots . In this threat model , an attacker can freely control a small subregion of the input ( the “ patch ” ) but needs to leave the rest of the input unchanged . This threat model is relevant because it corresponds to a physically realizable attack ( Lee & Kolter , 2019 ) : an attacker can print the adversarial patch pattern , place it in the physical world , and it will become part of the input of any system whose field of view overlaps with the physical patch . Moreover , once an attacker has generated a successful patch pattern , this pattern can be easily shared , will be effective against all systems using the same perception component , and an attack can be conducted without requiring access to the individual system . This makes for instance attacking an entire fleet of cars of the same vendor feasible . While several empirical defenses were proposed ( Hayes , 2018 ; Naseer et al. , 2019 ; Selvaraju et al. , 2019 ; Wu et al. , 2020 ) ) , these only offer robustness against known attacks but not necessarily against more effective attacks that may be developed in the future ( Chiang et al. , 2020 ) . In contrast , certified defenses for the patch threat model ( Chiang et al. , 2020 ; Levine & Feizi , 2020 ; Zhang et al. , 2020 ; Xiang et al. , 2020 ) allow guaranteed robustness against all possible attacks for the given threat model . Ideally , a certified defense should combine high certified robustness with efficient inference while maintaining strong performance on clean inputs . Moreover , the training objective should be based on the certification problem to avoid post-hoc calibration of the model for certification . Existing defenses do not satisfy all of these conditions : Chiang et al . ( 2020 ) proposed an approach that extends interval-bound propagation ( Gowal et al. , 2019 ) to the patch threat model . In this approach , there is a clear connection between training objective and certification problem . However , certified accuracy is relatively low and clean performance severely affected ( below 50 % on CIFAR10 ) . Moreover , inference requires separate forward passes for all possible patch positions and is thus computationally very expensive . Derandomized smoothing ( Levine & Feizi , 2020 ) achieves much higher certified and clean performance on CIFAR10 and even scales to ImageNet . However , inference is computationally expensive since it is based on separately propagating many differently ablated versions of a single input . Moreover , training and certification are disconnected and a separate tuning of parameters of the post-hoc certification procedure on some hold-out data is required , a drawback shared also by Clipped BagNet Zhang et al . ( 2020 ) and PatchGuard ( Xiang et al. , 2020 ) . In this work , we propose BAGCERT , which combines high certified accuracy ( 60 % on CIFAR10 for 5×5 patches ) and clean performance ( 86 % on CIFAR10 ) , efficient inference ( 43 seconds on a single GPU for the 10.000 CIFAR10 test samples ) , and end-to-end training for robustness against patches of varying size , aspect ratio , and location . BAGCERT is based on the following contributions : • We propose three different conditions that can be checked for certifying robustness . One of these corresponds to the condition proposed by Levine & Feizi ( 2020 ) . However , we show that an alternative condition improves certified accuracy of the same model typically by roughly 3 percent points while remaining broadly applicable . • We derive a loss function that directly optimizes for certified accuracy against a uniform distribution of patch sizes at arbitrary positions . This loss corresponds to a specific type of the well known class of margin losses . • Similarly to Levine & Feizi ( 2020 ) , we classify images via a majority voting over a large number of predictions that are based on small local regions of a single input . However , the proposed model achieves this via a single forward-pass on the unmodified input , by utilizing a neural network architecture with very small receptive fields , similar to BagNets ( Brendel & Bethge , 2019 ) . This enables efficient inference with surprisingly high clean accuracy and was concurrently proposed by Zhang et al . ( 2020 ) and Xiang et al . ( 2020 ) . 2 RELATED WORK . Adversarial Patch Attacks Vulnerability of image classifiers to adversarial patch attacks was first demonstrated by Brown et al . ( 2017 ) . They show that a specifically crafted physical adversarial patch is able to fool multiple ImageNet models into predicting the wrong class with high confidence . Numerous patch attacks were proposed for object detection ( Liu et al. , 2019 ; Lee & Kolter , 2019 ; Thys et al. , 2019 ; Huang et al. , 2019 ) and optical flow estimation ( Ranjan et al. , 2019 ) . The versatility of these attacks allows them to perform efficiently in the black box setup ( Croce et al. , 2020 ) as well as suppressing detected objects in a scene without overlapping any of them ( Lee & Kolter , 2019 ) . Following Athalye et al . ( 2018b ) , adversarial patches can be printed out and placed in the physical world to fool different models independently from the scaling , rotation , brightness and other visual transformations . These factors make adversarial patch attacks a non-negligible threat for the safety-critical perception systems ( Thys et al. , 2019 ) . Heuristic Defenses Against Patch Attacks Several heuristic defenses against adversarial patches such as digital watermarking ( Hayes , 2018 ) or local gradient smoothing ( Naseer et al. , 2019 ) have been proposed . However , similarly to the results obtained for the norm-bounded adversarial attacks ( Athalye et al. , 2018a ) , it was demonstrated that these defenses can be easily broken by white-box attacks which account for the pre-processing steps in the optimization procedure ( Chiang et al. , 2020 ) . The role of spatial context in the object detection algorithms which makes them vulnerable to the patch attacks was investigated by Saha et al . ( 2019 ) and an empirical defense based on GradCAM ( Selvaraju et al. , 2019 ) was proposed . Existing augmentation techniques based on adding Gaussian noise patch ( Lopes et al. , 2019 ) or a patch from a different image ( Yun et al. , 2019 ) increase robustness against occlusions caused by adversarial patches . Wu et al . ( 2020 ) propose a defense that uses adversarial training to increase robustness against occlusion attacks . Certified Defenses Evaluating defense methods using their performance against empirical attacks can lead to the false sense of security since stronger adversaries might be developed in the future that break the defenses ( Athalye et al. , 2018a ; Uesato et al. , 2018 ) . Therefore , it is important to have guarantees of robustness . Numerous works were proposed in the field of certified robustness ranging from complete verifiers finding the worst-case adversarial examples exactly ( Huang et al. , 2017 ; Tjeng & Tedrake , 2017 ) to faster but less accurate incomplete methods that provide an upper bound on the robust error ( Gehr et al. , 2018 ; Wong & Kolter , 2018 ; Wong et al. , 2018 ; Gowal et al. , 2019 ) . Another line of work is based on Randomized Smoothing ( Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ) , which exhibits strong empirical results and scales to ImageNet , however at the cost of increasing inference time by orders of magnitude . Certified defenses crafted for the patch attacks were first proposed by Chiang et al . ( 2020 ) . They adapt the IBP method ( Gowal et al. , 2019 ) to the patch threat model . Although their approach allows to obtain robustness guarantees , it only scales to small patches and causes a significant drop in clean accuracy . Levine & Feizi ( 2020 ) proposed ( de ) randomized smoothing : they train a base classifier for classifying images where all but a small local region is ablated . At inference time , many ( or even all ) possible ablations are classified and a majority vote determines the final classification . If this majority vote is with sufficient margin , the decision is provable robust against patch attacks because a patch will be completely ablated in most of the inputs and can thus only influence a minority of the votes . This method provides significant accuracy improvement when compared to ( Chiang et al. , 2020 ) and allows training and certifying ImageNet models . However , its inference in block-smoothing mode is computationally expensive . A last line of work is based on using models with small receptive fields such as BagNets ( Brendel & Bethge , 2019 ) : Zhang et al . ( 2020 ) apply a clipping function while Xiang et al . ( 2020 ) apply a “ detect-and-mask ” filter to the logits of pretrained BagNets before global averaging . Using small receptive fields limits the number of region scores affected by a local patches while clipping and masking ensure that few very large region scores can not dominate the global average . We note that these approaches do not train models directly for certified robustness but rather achieve it by applying post-hoc procedures that come with additional hyperparameters that require careful tuning . 3 METHOD . We introduce BAGCERT , a framework which consists of novel conditions for certifying robustness , a specific model architecture , and a new end-to-end training procedure . BAGCERT allows end-to-end training of classifiers whose robustness against adversarial patch attacks can be certified efficiently . We outline our approach for the task of image classification but note that it can be extended to other tasks with grid-structured inputs . We refer to Figure 1 for an illustration of the training phase and to Figure 5 in the supplementary material for an illustration of certification of BAGCERT . Threat Model We consider a threat model in which an attacker can conduct an image-dependent patch attack . Let x ∈ [ 0 , 1 ] win×hin×cin be an input image of resolution win×hin with cin channels . Let p be a patch and l be a region of an image x having the same size as patch p. We denote a set of feasible regions l as L. For example , for a patch p ∈ [ 0 , 1 ] n×cin consisting of n pixels , L could be the set of all wp×hp rectangular regions l of an image x with wp ·hp = n. We define an operator A such that A ( x , p , l ) is the result of placing a patch p onto an image x over a region l. We assume that the attacker has white-box knowledge of the model and conducts an input-dependent attack , that is attack region l and inserted patch p can be chosen for every input independently .
This paper presents a provable defense method called BAGCERT against patch attacks which uses an invariant of BagNet for certification. By using the network with small receptive fields, this paper first analyzes the worst-case classification. The basic certification process is created by using a novel aggregation function. Finally, after using the same certification conditions as the Derandomized smoothing (Levine & Feizi, 2020), the certification could be evaluated within constant time. To further reduce the impact of the adversarial patch, the proposed method uses the certification condition as the objective loss to train the network. Empirical studies show the superiority of BAGCERT over other approaches.
SP:1a201622459f5aac2d8372f9c90d53c42b91cd90
Efficient Certified Defenses Against Patch Attacks on Image Classifiers
Adversarial patches pose a realistic threat model for physical world attacks on autonomous systems via their perception component . Autonomous systems in safety-critical domains such as automated driving should thus contain a fail-safe fallback component that combines certifiable robustness against patches with efficient inference while maintaining high performance on clean inputs . We propose BAGCERT , a novel combination of model architecture and certification procedure that allows efficient certification . We derive a loss that enables end-to-end optimization of certified robustness against patches of different sizes and locations . On CIFAR10 , BAGCERT certifies 10.000 examples in 43 seconds on a single GPU and obtains 86 % clean and 60 % certified accuracy against 5× 5 patches . 1 INTRODUCTION . Adversarial patches ( Brown et al. , 2017 ) are one of the most relevant threat models for attacks on autonomous systems such as highly automated cars or robots . In this threat model , an attacker can freely control a small subregion of the input ( the “ patch ” ) but needs to leave the rest of the input unchanged . This threat model is relevant because it corresponds to a physically realizable attack ( Lee & Kolter , 2019 ) : an attacker can print the adversarial patch pattern , place it in the physical world , and it will become part of the input of any system whose field of view overlaps with the physical patch . Moreover , once an attacker has generated a successful patch pattern , this pattern can be easily shared , will be effective against all systems using the same perception component , and an attack can be conducted without requiring access to the individual system . This makes for instance attacking an entire fleet of cars of the same vendor feasible . While several empirical defenses were proposed ( Hayes , 2018 ; Naseer et al. , 2019 ; Selvaraju et al. , 2019 ; Wu et al. , 2020 ) ) , these only offer robustness against known attacks but not necessarily against more effective attacks that may be developed in the future ( Chiang et al. , 2020 ) . In contrast , certified defenses for the patch threat model ( Chiang et al. , 2020 ; Levine & Feizi , 2020 ; Zhang et al. , 2020 ; Xiang et al. , 2020 ) allow guaranteed robustness against all possible attacks for the given threat model . Ideally , a certified defense should combine high certified robustness with efficient inference while maintaining strong performance on clean inputs . Moreover , the training objective should be based on the certification problem to avoid post-hoc calibration of the model for certification . Existing defenses do not satisfy all of these conditions : Chiang et al . ( 2020 ) proposed an approach that extends interval-bound propagation ( Gowal et al. , 2019 ) to the patch threat model . In this approach , there is a clear connection between training objective and certification problem . However , certified accuracy is relatively low and clean performance severely affected ( below 50 % on CIFAR10 ) . Moreover , inference requires separate forward passes for all possible patch positions and is thus computationally very expensive . Derandomized smoothing ( Levine & Feizi , 2020 ) achieves much higher certified and clean performance on CIFAR10 and even scales to ImageNet . However , inference is computationally expensive since it is based on separately propagating many differently ablated versions of a single input . Moreover , training and certification are disconnected and a separate tuning of parameters of the post-hoc certification procedure on some hold-out data is required , a drawback shared also by Clipped BagNet Zhang et al . ( 2020 ) and PatchGuard ( Xiang et al. , 2020 ) . In this work , we propose BAGCERT , which combines high certified accuracy ( 60 % on CIFAR10 for 5×5 patches ) and clean performance ( 86 % on CIFAR10 ) , efficient inference ( 43 seconds on a single GPU for the 10.000 CIFAR10 test samples ) , and end-to-end training for robustness against patches of varying size , aspect ratio , and location . BAGCERT is based on the following contributions : • We propose three different conditions that can be checked for certifying robustness . One of these corresponds to the condition proposed by Levine & Feizi ( 2020 ) . However , we show that an alternative condition improves certified accuracy of the same model typically by roughly 3 percent points while remaining broadly applicable . • We derive a loss function that directly optimizes for certified accuracy against a uniform distribution of patch sizes at arbitrary positions . This loss corresponds to a specific type of the well known class of margin losses . • Similarly to Levine & Feizi ( 2020 ) , we classify images via a majority voting over a large number of predictions that are based on small local regions of a single input . However , the proposed model achieves this via a single forward-pass on the unmodified input , by utilizing a neural network architecture with very small receptive fields , similar to BagNets ( Brendel & Bethge , 2019 ) . This enables efficient inference with surprisingly high clean accuracy and was concurrently proposed by Zhang et al . ( 2020 ) and Xiang et al . ( 2020 ) . 2 RELATED WORK . Adversarial Patch Attacks Vulnerability of image classifiers to adversarial patch attacks was first demonstrated by Brown et al . ( 2017 ) . They show that a specifically crafted physical adversarial patch is able to fool multiple ImageNet models into predicting the wrong class with high confidence . Numerous patch attacks were proposed for object detection ( Liu et al. , 2019 ; Lee & Kolter , 2019 ; Thys et al. , 2019 ; Huang et al. , 2019 ) and optical flow estimation ( Ranjan et al. , 2019 ) . The versatility of these attacks allows them to perform efficiently in the black box setup ( Croce et al. , 2020 ) as well as suppressing detected objects in a scene without overlapping any of them ( Lee & Kolter , 2019 ) . Following Athalye et al . ( 2018b ) , adversarial patches can be printed out and placed in the physical world to fool different models independently from the scaling , rotation , brightness and other visual transformations . These factors make adversarial patch attacks a non-negligible threat for the safety-critical perception systems ( Thys et al. , 2019 ) . Heuristic Defenses Against Patch Attacks Several heuristic defenses against adversarial patches such as digital watermarking ( Hayes , 2018 ) or local gradient smoothing ( Naseer et al. , 2019 ) have been proposed . However , similarly to the results obtained for the norm-bounded adversarial attacks ( Athalye et al. , 2018a ) , it was demonstrated that these defenses can be easily broken by white-box attacks which account for the pre-processing steps in the optimization procedure ( Chiang et al. , 2020 ) . The role of spatial context in the object detection algorithms which makes them vulnerable to the patch attacks was investigated by Saha et al . ( 2019 ) and an empirical defense based on GradCAM ( Selvaraju et al. , 2019 ) was proposed . Existing augmentation techniques based on adding Gaussian noise patch ( Lopes et al. , 2019 ) or a patch from a different image ( Yun et al. , 2019 ) increase robustness against occlusions caused by adversarial patches . Wu et al . ( 2020 ) propose a defense that uses adversarial training to increase robustness against occlusion attacks . Certified Defenses Evaluating defense methods using their performance against empirical attacks can lead to the false sense of security since stronger adversaries might be developed in the future that break the defenses ( Athalye et al. , 2018a ; Uesato et al. , 2018 ) . Therefore , it is important to have guarantees of robustness . Numerous works were proposed in the field of certified robustness ranging from complete verifiers finding the worst-case adversarial examples exactly ( Huang et al. , 2017 ; Tjeng & Tedrake , 2017 ) to faster but less accurate incomplete methods that provide an upper bound on the robust error ( Gehr et al. , 2018 ; Wong & Kolter , 2018 ; Wong et al. , 2018 ; Gowal et al. , 2019 ) . Another line of work is based on Randomized Smoothing ( Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ) , which exhibits strong empirical results and scales to ImageNet , however at the cost of increasing inference time by orders of magnitude . Certified defenses crafted for the patch attacks were first proposed by Chiang et al . ( 2020 ) . They adapt the IBP method ( Gowal et al. , 2019 ) to the patch threat model . Although their approach allows to obtain robustness guarantees , it only scales to small patches and causes a significant drop in clean accuracy . Levine & Feizi ( 2020 ) proposed ( de ) randomized smoothing : they train a base classifier for classifying images where all but a small local region is ablated . At inference time , many ( or even all ) possible ablations are classified and a majority vote determines the final classification . If this majority vote is with sufficient margin , the decision is provable robust against patch attacks because a patch will be completely ablated in most of the inputs and can thus only influence a minority of the votes . This method provides significant accuracy improvement when compared to ( Chiang et al. , 2020 ) and allows training and certifying ImageNet models . However , its inference in block-smoothing mode is computationally expensive . A last line of work is based on using models with small receptive fields such as BagNets ( Brendel & Bethge , 2019 ) : Zhang et al . ( 2020 ) apply a clipping function while Xiang et al . ( 2020 ) apply a “ detect-and-mask ” filter to the logits of pretrained BagNets before global averaging . Using small receptive fields limits the number of region scores affected by a local patches while clipping and masking ensure that few very large region scores can not dominate the global average . We note that these approaches do not train models directly for certified robustness but rather achieve it by applying post-hoc procedures that come with additional hyperparameters that require careful tuning . 3 METHOD . We introduce BAGCERT , a framework which consists of novel conditions for certifying robustness , a specific model architecture , and a new end-to-end training procedure . BAGCERT allows end-to-end training of classifiers whose robustness against adversarial patch attacks can be certified efficiently . We outline our approach for the task of image classification but note that it can be extended to other tasks with grid-structured inputs . We refer to Figure 1 for an illustration of the training phase and to Figure 5 in the supplementary material for an illustration of certification of BAGCERT . Threat Model We consider a threat model in which an attacker can conduct an image-dependent patch attack . Let x ∈ [ 0 , 1 ] win×hin×cin be an input image of resolution win×hin with cin channels . Let p be a patch and l be a region of an image x having the same size as patch p. We denote a set of feasible regions l as L. For example , for a patch p ∈ [ 0 , 1 ] n×cin consisting of n pixels , L could be the set of all wp×hp rectangular regions l of an image x with wp ·hp = n. We define an operator A such that A ( x , p , l ) is the result of placing a patch p onto an image x over a region l. We assume that the attacker has white-box knowledge of the model and conducts an input-dependent attack , that is attack region l and inserted patch p can be chosen for every input independently .
This paper considers a problem of the defense against adversarial patch insertion attacks for image classification. Namely, it considers rectangular adversarial patches of fixed sizes and aspect ratios inserted in arbitrary locations of input images and requires from the desired model to obtain good classification performance on both clean and corrupted versions of datasets. Moreover, it is desired for results on the corrupted data to have certified robustness (theoretically guarantied classification performance given the model and the parameters of the attack).
SP:1a201622459f5aac2d8372f9c90d53c42b91cd90
Efficient Certified Defenses Against Patch Attacks on Image Classifiers
Adversarial patches pose a realistic threat model for physical world attacks on autonomous systems via their perception component . Autonomous systems in safety-critical domains such as automated driving should thus contain a fail-safe fallback component that combines certifiable robustness against patches with efficient inference while maintaining high performance on clean inputs . We propose BAGCERT , a novel combination of model architecture and certification procedure that allows efficient certification . We derive a loss that enables end-to-end optimization of certified robustness against patches of different sizes and locations . On CIFAR10 , BAGCERT certifies 10.000 examples in 43 seconds on a single GPU and obtains 86 % clean and 60 % certified accuracy against 5× 5 patches . 1 INTRODUCTION . Adversarial patches ( Brown et al. , 2017 ) are one of the most relevant threat models for attacks on autonomous systems such as highly automated cars or robots . In this threat model , an attacker can freely control a small subregion of the input ( the “ patch ” ) but needs to leave the rest of the input unchanged . This threat model is relevant because it corresponds to a physically realizable attack ( Lee & Kolter , 2019 ) : an attacker can print the adversarial patch pattern , place it in the physical world , and it will become part of the input of any system whose field of view overlaps with the physical patch . Moreover , once an attacker has generated a successful patch pattern , this pattern can be easily shared , will be effective against all systems using the same perception component , and an attack can be conducted without requiring access to the individual system . This makes for instance attacking an entire fleet of cars of the same vendor feasible . While several empirical defenses were proposed ( Hayes , 2018 ; Naseer et al. , 2019 ; Selvaraju et al. , 2019 ; Wu et al. , 2020 ) ) , these only offer robustness against known attacks but not necessarily against more effective attacks that may be developed in the future ( Chiang et al. , 2020 ) . In contrast , certified defenses for the patch threat model ( Chiang et al. , 2020 ; Levine & Feizi , 2020 ; Zhang et al. , 2020 ; Xiang et al. , 2020 ) allow guaranteed robustness against all possible attacks for the given threat model . Ideally , a certified defense should combine high certified robustness with efficient inference while maintaining strong performance on clean inputs . Moreover , the training objective should be based on the certification problem to avoid post-hoc calibration of the model for certification . Existing defenses do not satisfy all of these conditions : Chiang et al . ( 2020 ) proposed an approach that extends interval-bound propagation ( Gowal et al. , 2019 ) to the patch threat model . In this approach , there is a clear connection between training objective and certification problem . However , certified accuracy is relatively low and clean performance severely affected ( below 50 % on CIFAR10 ) . Moreover , inference requires separate forward passes for all possible patch positions and is thus computationally very expensive . Derandomized smoothing ( Levine & Feizi , 2020 ) achieves much higher certified and clean performance on CIFAR10 and even scales to ImageNet . However , inference is computationally expensive since it is based on separately propagating many differently ablated versions of a single input . Moreover , training and certification are disconnected and a separate tuning of parameters of the post-hoc certification procedure on some hold-out data is required , a drawback shared also by Clipped BagNet Zhang et al . ( 2020 ) and PatchGuard ( Xiang et al. , 2020 ) . In this work , we propose BAGCERT , which combines high certified accuracy ( 60 % on CIFAR10 for 5×5 patches ) and clean performance ( 86 % on CIFAR10 ) , efficient inference ( 43 seconds on a single GPU for the 10.000 CIFAR10 test samples ) , and end-to-end training for robustness against patches of varying size , aspect ratio , and location . BAGCERT is based on the following contributions : • We propose three different conditions that can be checked for certifying robustness . One of these corresponds to the condition proposed by Levine & Feizi ( 2020 ) . However , we show that an alternative condition improves certified accuracy of the same model typically by roughly 3 percent points while remaining broadly applicable . • We derive a loss function that directly optimizes for certified accuracy against a uniform distribution of patch sizes at arbitrary positions . This loss corresponds to a specific type of the well known class of margin losses . • Similarly to Levine & Feizi ( 2020 ) , we classify images via a majority voting over a large number of predictions that are based on small local regions of a single input . However , the proposed model achieves this via a single forward-pass on the unmodified input , by utilizing a neural network architecture with very small receptive fields , similar to BagNets ( Brendel & Bethge , 2019 ) . This enables efficient inference with surprisingly high clean accuracy and was concurrently proposed by Zhang et al . ( 2020 ) and Xiang et al . ( 2020 ) . 2 RELATED WORK . Adversarial Patch Attacks Vulnerability of image classifiers to adversarial patch attacks was first demonstrated by Brown et al . ( 2017 ) . They show that a specifically crafted physical adversarial patch is able to fool multiple ImageNet models into predicting the wrong class with high confidence . Numerous patch attacks were proposed for object detection ( Liu et al. , 2019 ; Lee & Kolter , 2019 ; Thys et al. , 2019 ; Huang et al. , 2019 ) and optical flow estimation ( Ranjan et al. , 2019 ) . The versatility of these attacks allows them to perform efficiently in the black box setup ( Croce et al. , 2020 ) as well as suppressing detected objects in a scene without overlapping any of them ( Lee & Kolter , 2019 ) . Following Athalye et al . ( 2018b ) , adversarial patches can be printed out and placed in the physical world to fool different models independently from the scaling , rotation , brightness and other visual transformations . These factors make adversarial patch attacks a non-negligible threat for the safety-critical perception systems ( Thys et al. , 2019 ) . Heuristic Defenses Against Patch Attacks Several heuristic defenses against adversarial patches such as digital watermarking ( Hayes , 2018 ) or local gradient smoothing ( Naseer et al. , 2019 ) have been proposed . However , similarly to the results obtained for the norm-bounded adversarial attacks ( Athalye et al. , 2018a ) , it was demonstrated that these defenses can be easily broken by white-box attacks which account for the pre-processing steps in the optimization procedure ( Chiang et al. , 2020 ) . The role of spatial context in the object detection algorithms which makes them vulnerable to the patch attacks was investigated by Saha et al . ( 2019 ) and an empirical defense based on GradCAM ( Selvaraju et al. , 2019 ) was proposed . Existing augmentation techniques based on adding Gaussian noise patch ( Lopes et al. , 2019 ) or a patch from a different image ( Yun et al. , 2019 ) increase robustness against occlusions caused by adversarial patches . Wu et al . ( 2020 ) propose a defense that uses adversarial training to increase robustness against occlusion attacks . Certified Defenses Evaluating defense methods using their performance against empirical attacks can lead to the false sense of security since stronger adversaries might be developed in the future that break the defenses ( Athalye et al. , 2018a ; Uesato et al. , 2018 ) . Therefore , it is important to have guarantees of robustness . Numerous works were proposed in the field of certified robustness ranging from complete verifiers finding the worst-case adversarial examples exactly ( Huang et al. , 2017 ; Tjeng & Tedrake , 2017 ) to faster but less accurate incomplete methods that provide an upper bound on the robust error ( Gehr et al. , 2018 ; Wong & Kolter , 2018 ; Wong et al. , 2018 ; Gowal et al. , 2019 ) . Another line of work is based on Randomized Smoothing ( Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ) , which exhibits strong empirical results and scales to ImageNet , however at the cost of increasing inference time by orders of magnitude . Certified defenses crafted for the patch attacks were first proposed by Chiang et al . ( 2020 ) . They adapt the IBP method ( Gowal et al. , 2019 ) to the patch threat model . Although their approach allows to obtain robustness guarantees , it only scales to small patches and causes a significant drop in clean accuracy . Levine & Feizi ( 2020 ) proposed ( de ) randomized smoothing : they train a base classifier for classifying images where all but a small local region is ablated . At inference time , many ( or even all ) possible ablations are classified and a majority vote determines the final classification . If this majority vote is with sufficient margin , the decision is provable robust against patch attacks because a patch will be completely ablated in most of the inputs and can thus only influence a minority of the votes . This method provides significant accuracy improvement when compared to ( Chiang et al. , 2020 ) and allows training and certifying ImageNet models . However , its inference in block-smoothing mode is computationally expensive . A last line of work is based on using models with small receptive fields such as BagNets ( Brendel & Bethge , 2019 ) : Zhang et al . ( 2020 ) apply a clipping function while Xiang et al . ( 2020 ) apply a “ detect-and-mask ” filter to the logits of pretrained BagNets before global averaging . Using small receptive fields limits the number of region scores affected by a local patches while clipping and masking ensure that few very large region scores can not dominate the global average . We note that these approaches do not train models directly for certified robustness but rather achieve it by applying post-hoc procedures that come with additional hyperparameters that require careful tuning . 3 METHOD . We introduce BAGCERT , a framework which consists of novel conditions for certifying robustness , a specific model architecture , and a new end-to-end training procedure . BAGCERT allows end-to-end training of classifiers whose robustness against adversarial patch attacks can be certified efficiently . We outline our approach for the task of image classification but note that it can be extended to other tasks with grid-structured inputs . We refer to Figure 1 for an illustration of the training phase and to Figure 5 in the supplementary material for an illustration of certification of BAGCERT . Threat Model We consider a threat model in which an attacker can conduct an image-dependent patch attack . Let x ∈ [ 0 , 1 ] win×hin×cin be an input image of resolution win×hin with cin channels . Let p be a patch and l be a region of an image x having the same size as patch p. We denote a set of feasible regions l as L. For example , for a patch p ∈ [ 0 , 1 ] n×cin consisting of n pixels , L could be the set of all wp×hp rectangular regions l of an image x with wp ·hp = n. We define an operator A such that A ( x , p , l ) is the result of placing a patch p onto an image x over a region l. We assume that the attacker has white-box knowledge of the model and conducts an input-dependent attack , that is attack region l and inserted patch p can be chosen for every input independently .
This paper deals with obtaining verified bounds on the accuracy of a model under attack restricted to patch modification (only a small, localized group of pixels can be modified). As opposed to previous methods (Chiang et al, 2020) which simply applied existing verification methods to the problem by enumerating possible patch locations, the proposed approach consist in modifying the structure of the network such that predictions are made densely and then aggregated. The dense prediction means that only some of the predictions can be affected by the adversarial patch, and so the certification process can use this to reason about the robustness at the aggregation level.
SP:1a201622459f5aac2d8372f9c90d53c42b91cd90
Neighborhood-Aware Neural Architecture Search
1 INTRODUCTION . The process of automatic neural architecture design , also called neural architecture search ( NAS ) , is a promising technology to improve performance and efficiency for deep learning applications ( Zoph & Le , 2017 ; Zoph et al. , 2018 ; Liu et al. , 2019 ) . NAS methods typically minimize the validation loss to find the optimal architecture . However , directly optimizing such an objective may cause the search algorithm to overfit to the search setting , i.e. , finding a solution architecture with good search performance but generalizes poorly to the test setting . This type of overfitting is a result of the differences between the search and test settings , such as the length of training schedules ( Zoph & Le , 2017 ; Zoph et al. , 2018 ) , cross-architecture weight sharing ( Liu et al. , 2019 ; Pham et al. , 2018 ) , and the usage of proxy datasets during search ( Zoph & Le , 2017 ; Zoph et al. , 2018 ; Liu et al. , 2019 ) . To achieve better generalization , we propose a novel NAS formulation that searches for “ flat-minima architectures ” , which we define as architectures that perform well under small perturbations of the architecture ( Figure 1 ) . One example of architectural perturbations is to replace a convolutional operator with a skip connection ( identity mapping ) . Our work takes inspiration from prior work on neural network training , which shows that flat minima of the loss function correspond to network weights with better generalization than sharp ones ( Hochreiter & Schmidhuber , 1997 ) . We show that flat minima in the architecture space also generalize better to a new data distribution than sharp minima ( Sec . 3.3 ) . Unlike the standard NAS formulation that directly optimizes single architecture performance , i.e. , α∗ = arg minα∈A f ( α ) , we optimize the aggregated performance over the neighborhood of an architecture : α∗ = arg min α∈A g ( f ( N ( α ) ) ) , ( 1 ) where f ( · ) is a task-specific error metric , α denotes an architecture in the search space A , N ( α ) denotes the neighborhood of architecture α , and g ( · ) is an aggregation function ( e.g. , the mean function ) . Note that we overload the notation of the error metric f ( · ) and define f ( · ) to return a set of errors when the input is a set of architectures in the neighborhood : f ( N ( α ) ) = { f ( α′ ) | α′ ∈ N ( α ) } . Common choices for f ( · ) are validation loss and negative validation accuracy . We will discuss more details of neighborhood N ( α ) and aggregation function g ( · ) in the following text . To implement our formulation , one must define the neighborhood N ( α ) and specify an aggregation function g ( · ) . How to define the neighborhood of an architecture is an open question . One possible method to obtain neighboring architectures is to perturb one or more operations in the architecture and the degree of perturbation defines the scope of the neighborhood . This method can be applied to sampling-based search algorithms , e.g. , random search and reinforcement learning . However , it can not be directly used to generate neighboring architectures for gradient-based search algorithms ( a.k.a , differentiable NAS ) , where the neighboring architectures themselves also need to be differentiable with respect to the architecture being learned . To address this issue , we propose a differentiable representation for the neighborhood of architectures , which makes the objective function differentiable and allows us to apply our formulation to gradient-based algorithms , e.g. , DARTS ( Liu et al. , 2019 ) . Properly choosing the aggregation function g ( · ) can help the search algorithm identify flat minima in the search space . Our choice of g ( · ) ( e.g. , mean ) is inspired by the definition of the flatness/sharpness of local minima in previous work ( Chaudhari et al. , 2017 ; Keskar et al. , 2017 ; Dinh et al. , 2017 ) . We summarize our contributions as follows : 1 . We propose a neighborhood-aware NAS formulation based on the flat minima assumption , and demonstrate a principled way to apply our formulation to existing search algorithms , including sampling-based algorithms and gradient-based algorithms . We empirically validate our assumption and show that flat-minima architectures generalize better than sharp ones . 2 . We propose a neighborhood-aware random search ( NA-RS ) algorithm and demonstrate its superiority over the standard random search . On NAS-Bench-201 ( Dong & Yang , 2020 ) , NA-RS outperforms the standard random search by 1.48 % on CIFAR-100 and 1.58 % on ImageNet-16-120 . 3 . We propose a differentiable neighborhood representation so that we can apply our formulation to gradient-based NAS methods . We augment DARTS ( Liu et al. , 2019 ) with our formulation and name the proposed method NA-DARTS . Our NA-DARTS outperforms DARTS by 1.18 % on CIFAR-100 and 1.2 % on ImageNet , and also performs better than or on par with state-of-the-art NAS methods . 2 RELATED WORK . Flat Minima . Hochreiter & Schmidhuber ( 1997 ) shows that flat minima of the loss function of neural networks generalize better than sharp minima . Flat minima are used to explain the poor generalization of large-batch methods ( Keskar et al. , 2017 ; Yao et al. , 2018 ) , where large-batch methods are shown to be more likely to converge to sharp minima . Chaudhari et al . ( 2017 ) propose an ob- jective function for training neural networks so that flat minima are preferred during optimization . Their objective can be interpreted as a weighted average of the ( transformed ) function values of data points around the local minima , which inspires us to consider mean as one of the aggregation functions . Previous work mentioned above focus on flat minima in the network weight space . However , we study flat minima in the architecture space , which is discrete and fundamentally different from the continuous weights studied in previous work . This makes it non-trivial to apply the flat minima idea to NAS . Zela et al . ( 2020 ) observes a strong correlation between the generalization error of the architecture found by DARTS ( Liu et al. , 2019 ) and the flatness of the loss function at the found architecture . They propose several regularization strategies to improve DARTS , such as early stopping before the loss curvature becomes too high . Our flat minima assumption is motivated by their observation and our method can be combined with their regularization strategies . NAS - Search Algorithm . Various search algorithms have been applied to solve NAS , including sampling-based and gradient-based algorithms . Representative sampling-based algorithms include random search ( Li & Talwalkar , 2019 ) , reinforcement learning ( Baker et al. , 2017 ; Zoph & Le , 2017 ; Zoph et al. , 2018 ; Zhong et al. , 2018 ) , Bayesian optimization ( Kandasamy et al. , 2018 ; Cao et al. , 2019 ) , evolutionary algorithms ( Xie & Yuille , 2017 ; Real et al. , 2017 ; 2019 ) , and sequential modelbased optimization ( Liu et al. , 2018 ) . To make NAS more computationally efficient , weight sharing across architectures is proposed to amortize the training cost of candidate architectures ( Pham et al. , 2018 ; Bender et al. , 2018 ) . Based on weight sharing , gradient-based algorithms are proposed to directly learn the architecture with gradient descent ( Liu et al. , 2019 ; Xie et al. , 2019 ) . Our focus is not proposing novel search algorithms but revisiting the standard NAS formulation . Our proposed formulation can be applied to both sampling-based algorithms and gradient-based algorithms . NAS - Search Space . Search space is crucial for the performance of NAS . One of the most widely used search spaces is the cell search space ( Zoph et al. , 2018 ) , which searches for a cell that can be stacked multiple times to form the entire network . Our proposed neighborhood-aware formulation is agnostic to the search space , and we specifically showcase our formulation on the cell search space . 3 NEIGHBORHOOD-AWARE FORMULATION . We propose a neighborhood-aware NAS formulation ( Eq . 1 ) to identify flat minima in the search space . Our formulation builds upon the assumption that flat-minima architectures usually generalize better than sharp ones . In this formulation , the optimal architecture is selected according to the aggregated performance g ( f ( N ( α ) ) ) of neighbors of an architecture , instead of the standard criterion , i.e. , single architecture performance f ( α ) only . We now introduce the neighborhood definition of an architecture N ( α ) and the aggregation function g ( · ) . 3.1 NEIGHBORHOOD DEFINITION AND CELL SEARCH SPACE . Formally defining the neighborhood requires a distance metric between architectures , which largely depends on how an architecture is represented and how the search space is constructed . We adopt the cell search space ( Zoph et al. , 2018 ) as it has been widely used in recent NAS methods ( Liu et al. , 2018 ; 2019 ) . Instead of the entire architecture , we search for a cell that can be stacked multiple times to form the entire architecture . The number of times the cell is stacked and the output layer are manually defined prior to the search . A cell is defined as a directed acyclic graph ( DAG ) consisting of n nodes . Each node represents a feature map . Each directed edge ( i , j ) ( 1 ≤ i < j ≤ n ) is associated with an operation used to transform the feature map at node i , and passes the transformed feature map to node j . The feature map at one node is the sum of all the feature maps on the incoming edges to this node : x ( j ) = ∑ ( i , j ) ∈E ∑m k=1 α ( i , j ) k ok ( x ( i ) ) , where E denotes the set of edges in the cell , x ( i ) is the feature map at node i , and ok is the kth operation among the m available operations . α ( i , j ) is a m-dim one-hot vector , indicating the operation choice for edge ( i , j ) . A cell is then represented by a set of variables α = { α ( i , j ) } . Note that α ( i , j ) being a one-hot vector means that only one operation is chosen for edge ( i , j ) . On a side note , the one-hot constraint on α ( i , j ) can be relaxed in differentiable NAS methods ( Liu et al. , 2019 ; Xie et al. , 2019 ) . We define the distance between two cells α and α′ as : dist ( α , α′ ) = ∑ ( i , j ) ∈E δ ( α ( i , j ) , α′ ( i , j ) ) , ( 2 ) where δ ( · , · ) is the total variation distance between two probability distributions : δ ( p , q ) = 1 2 ||p − q||1 = 1 2 ∑m k=1 |pk − qk| . Here p and q are both m-dim probability distributions . The total variation distance is symmetric and bounded between 0 and 1 . It also offers the following property : δ ( α ( i , j ) , α′ ( i , j ) ) = 0 implies that the two cells have the same operation at edge ( i , j ) and δ ( α ( i , j ) , α′ ( i , j ) ) = 1 implies that they have different operations at edge ( i , j ) . Note that instead of directly counting the edge differences , we adopt total variation distance to accommodate relaxed α that is later used in differentiable NAS methods ( Liu et al. , 2019 ; Xie et al. , 2019 ) . The neighborhood of a cell α is defined as : N ( α ) = { α′ | dist ( α , α′ ) ≤ d } , ( 3 ) where d is a distance threshold . Due to the property of the total variation distance , when d is an integer , the neighborhood contains all the cells that have at most d edges associated with different operations from α . For clarification , our definition of neighborhood includes the reference architecture α itself .
The authors proposed neighborhood-aware neural architecture search, where during the evaluation phase during search, the neighborhood of an architecture is considered. Specifically, when an architecture $\alpha$ is picked, its neighbors $\mathcal{N}(\alpha)$ all contribute to the performance validation. This is built upon the assumption that `` flat minima generalize better than sharp minima’’ and the authors verify it in Appendix C.
SP:9f950c0b9c87ef9e2fbbe79e4a2c4d6a8fd1b041
Neighborhood-Aware Neural Architecture Search
1 INTRODUCTION . The process of automatic neural architecture design , also called neural architecture search ( NAS ) , is a promising technology to improve performance and efficiency for deep learning applications ( Zoph & Le , 2017 ; Zoph et al. , 2018 ; Liu et al. , 2019 ) . NAS methods typically minimize the validation loss to find the optimal architecture . However , directly optimizing such an objective may cause the search algorithm to overfit to the search setting , i.e. , finding a solution architecture with good search performance but generalizes poorly to the test setting . This type of overfitting is a result of the differences between the search and test settings , such as the length of training schedules ( Zoph & Le , 2017 ; Zoph et al. , 2018 ) , cross-architecture weight sharing ( Liu et al. , 2019 ; Pham et al. , 2018 ) , and the usage of proxy datasets during search ( Zoph & Le , 2017 ; Zoph et al. , 2018 ; Liu et al. , 2019 ) . To achieve better generalization , we propose a novel NAS formulation that searches for “ flat-minima architectures ” , which we define as architectures that perform well under small perturbations of the architecture ( Figure 1 ) . One example of architectural perturbations is to replace a convolutional operator with a skip connection ( identity mapping ) . Our work takes inspiration from prior work on neural network training , which shows that flat minima of the loss function correspond to network weights with better generalization than sharp ones ( Hochreiter & Schmidhuber , 1997 ) . We show that flat minima in the architecture space also generalize better to a new data distribution than sharp minima ( Sec . 3.3 ) . Unlike the standard NAS formulation that directly optimizes single architecture performance , i.e. , α∗ = arg minα∈A f ( α ) , we optimize the aggregated performance over the neighborhood of an architecture : α∗ = arg min α∈A g ( f ( N ( α ) ) ) , ( 1 ) where f ( · ) is a task-specific error metric , α denotes an architecture in the search space A , N ( α ) denotes the neighborhood of architecture α , and g ( · ) is an aggregation function ( e.g. , the mean function ) . Note that we overload the notation of the error metric f ( · ) and define f ( · ) to return a set of errors when the input is a set of architectures in the neighborhood : f ( N ( α ) ) = { f ( α′ ) | α′ ∈ N ( α ) } . Common choices for f ( · ) are validation loss and negative validation accuracy . We will discuss more details of neighborhood N ( α ) and aggregation function g ( · ) in the following text . To implement our formulation , one must define the neighborhood N ( α ) and specify an aggregation function g ( · ) . How to define the neighborhood of an architecture is an open question . One possible method to obtain neighboring architectures is to perturb one or more operations in the architecture and the degree of perturbation defines the scope of the neighborhood . This method can be applied to sampling-based search algorithms , e.g. , random search and reinforcement learning . However , it can not be directly used to generate neighboring architectures for gradient-based search algorithms ( a.k.a , differentiable NAS ) , where the neighboring architectures themselves also need to be differentiable with respect to the architecture being learned . To address this issue , we propose a differentiable representation for the neighborhood of architectures , which makes the objective function differentiable and allows us to apply our formulation to gradient-based algorithms , e.g. , DARTS ( Liu et al. , 2019 ) . Properly choosing the aggregation function g ( · ) can help the search algorithm identify flat minima in the search space . Our choice of g ( · ) ( e.g. , mean ) is inspired by the definition of the flatness/sharpness of local minima in previous work ( Chaudhari et al. , 2017 ; Keskar et al. , 2017 ; Dinh et al. , 2017 ) . We summarize our contributions as follows : 1 . We propose a neighborhood-aware NAS formulation based on the flat minima assumption , and demonstrate a principled way to apply our formulation to existing search algorithms , including sampling-based algorithms and gradient-based algorithms . We empirically validate our assumption and show that flat-minima architectures generalize better than sharp ones . 2 . We propose a neighborhood-aware random search ( NA-RS ) algorithm and demonstrate its superiority over the standard random search . On NAS-Bench-201 ( Dong & Yang , 2020 ) , NA-RS outperforms the standard random search by 1.48 % on CIFAR-100 and 1.58 % on ImageNet-16-120 . 3 . We propose a differentiable neighborhood representation so that we can apply our formulation to gradient-based NAS methods . We augment DARTS ( Liu et al. , 2019 ) with our formulation and name the proposed method NA-DARTS . Our NA-DARTS outperforms DARTS by 1.18 % on CIFAR-100 and 1.2 % on ImageNet , and also performs better than or on par with state-of-the-art NAS methods . 2 RELATED WORK . Flat Minima . Hochreiter & Schmidhuber ( 1997 ) shows that flat minima of the loss function of neural networks generalize better than sharp minima . Flat minima are used to explain the poor generalization of large-batch methods ( Keskar et al. , 2017 ; Yao et al. , 2018 ) , where large-batch methods are shown to be more likely to converge to sharp minima . Chaudhari et al . ( 2017 ) propose an ob- jective function for training neural networks so that flat minima are preferred during optimization . Their objective can be interpreted as a weighted average of the ( transformed ) function values of data points around the local minima , which inspires us to consider mean as one of the aggregation functions . Previous work mentioned above focus on flat minima in the network weight space . However , we study flat minima in the architecture space , which is discrete and fundamentally different from the continuous weights studied in previous work . This makes it non-trivial to apply the flat minima idea to NAS . Zela et al . ( 2020 ) observes a strong correlation between the generalization error of the architecture found by DARTS ( Liu et al. , 2019 ) and the flatness of the loss function at the found architecture . They propose several regularization strategies to improve DARTS , such as early stopping before the loss curvature becomes too high . Our flat minima assumption is motivated by their observation and our method can be combined with their regularization strategies . NAS - Search Algorithm . Various search algorithms have been applied to solve NAS , including sampling-based and gradient-based algorithms . Representative sampling-based algorithms include random search ( Li & Talwalkar , 2019 ) , reinforcement learning ( Baker et al. , 2017 ; Zoph & Le , 2017 ; Zoph et al. , 2018 ; Zhong et al. , 2018 ) , Bayesian optimization ( Kandasamy et al. , 2018 ; Cao et al. , 2019 ) , evolutionary algorithms ( Xie & Yuille , 2017 ; Real et al. , 2017 ; 2019 ) , and sequential modelbased optimization ( Liu et al. , 2018 ) . To make NAS more computationally efficient , weight sharing across architectures is proposed to amortize the training cost of candidate architectures ( Pham et al. , 2018 ; Bender et al. , 2018 ) . Based on weight sharing , gradient-based algorithms are proposed to directly learn the architecture with gradient descent ( Liu et al. , 2019 ; Xie et al. , 2019 ) . Our focus is not proposing novel search algorithms but revisiting the standard NAS formulation . Our proposed formulation can be applied to both sampling-based algorithms and gradient-based algorithms . NAS - Search Space . Search space is crucial for the performance of NAS . One of the most widely used search spaces is the cell search space ( Zoph et al. , 2018 ) , which searches for a cell that can be stacked multiple times to form the entire network . Our proposed neighborhood-aware formulation is agnostic to the search space , and we specifically showcase our formulation on the cell search space . 3 NEIGHBORHOOD-AWARE FORMULATION . We propose a neighborhood-aware NAS formulation ( Eq . 1 ) to identify flat minima in the search space . Our formulation builds upon the assumption that flat-minima architectures usually generalize better than sharp ones . In this formulation , the optimal architecture is selected according to the aggregated performance g ( f ( N ( α ) ) ) of neighbors of an architecture , instead of the standard criterion , i.e. , single architecture performance f ( α ) only . We now introduce the neighborhood definition of an architecture N ( α ) and the aggregation function g ( · ) . 3.1 NEIGHBORHOOD DEFINITION AND CELL SEARCH SPACE . Formally defining the neighborhood requires a distance metric between architectures , which largely depends on how an architecture is represented and how the search space is constructed . We adopt the cell search space ( Zoph et al. , 2018 ) as it has been widely used in recent NAS methods ( Liu et al. , 2018 ; 2019 ) . Instead of the entire architecture , we search for a cell that can be stacked multiple times to form the entire architecture . The number of times the cell is stacked and the output layer are manually defined prior to the search . A cell is defined as a directed acyclic graph ( DAG ) consisting of n nodes . Each node represents a feature map . Each directed edge ( i , j ) ( 1 ≤ i < j ≤ n ) is associated with an operation used to transform the feature map at node i , and passes the transformed feature map to node j . The feature map at one node is the sum of all the feature maps on the incoming edges to this node : x ( j ) = ∑ ( i , j ) ∈E ∑m k=1 α ( i , j ) k ok ( x ( i ) ) , where E denotes the set of edges in the cell , x ( i ) is the feature map at node i , and ok is the kth operation among the m available operations . α ( i , j ) is a m-dim one-hot vector , indicating the operation choice for edge ( i , j ) . A cell is then represented by a set of variables α = { α ( i , j ) } . Note that α ( i , j ) being a one-hot vector means that only one operation is chosen for edge ( i , j ) . On a side note , the one-hot constraint on α ( i , j ) can be relaxed in differentiable NAS methods ( Liu et al. , 2019 ; Xie et al. , 2019 ) . We define the distance between two cells α and α′ as : dist ( α , α′ ) = ∑ ( i , j ) ∈E δ ( α ( i , j ) , α′ ( i , j ) ) , ( 2 ) where δ ( · , · ) is the total variation distance between two probability distributions : δ ( p , q ) = 1 2 ||p − q||1 = 1 2 ∑m k=1 |pk − qk| . Here p and q are both m-dim probability distributions . The total variation distance is symmetric and bounded between 0 and 1 . It also offers the following property : δ ( α ( i , j ) , α′ ( i , j ) ) = 0 implies that the two cells have the same operation at edge ( i , j ) and δ ( α ( i , j ) , α′ ( i , j ) ) = 1 implies that they have different operations at edge ( i , j ) . Note that instead of directly counting the edge differences , we adopt total variation distance to accommodate relaxed α that is later used in differentiable NAS methods ( Liu et al. , 2019 ; Xie et al. , 2019 ) . The neighborhood of a cell α is defined as : N ( α ) = { α′ | dist ( α , α′ ) ≤ d } , ( 3 ) where d is a distance threshold . Due to the property of the total variation distance , when d is an integer , the neighborhood contains all the cells that have at most d edges associated with different operations from α . For clarification , our definition of neighborhood includes the reference architecture α itself .
This paper proposes a neighbor-aware method in the neural architecture search (NAS). The paper states that by optimizing a neighbor of the neural network, it can search the result in a flat-minima, which is more stable than the sharp minima. The experiment results in further support that the proposed NA-RS and NA-DARTS outperform the current SOTA in various tasks.
SP:9f950c0b9c87ef9e2fbbe79e4a2c4d6a8fd1b041
Neighborhood-Aware Neural Architecture Search
1 INTRODUCTION . The process of automatic neural architecture design , also called neural architecture search ( NAS ) , is a promising technology to improve performance and efficiency for deep learning applications ( Zoph & Le , 2017 ; Zoph et al. , 2018 ; Liu et al. , 2019 ) . NAS methods typically minimize the validation loss to find the optimal architecture . However , directly optimizing such an objective may cause the search algorithm to overfit to the search setting , i.e. , finding a solution architecture with good search performance but generalizes poorly to the test setting . This type of overfitting is a result of the differences between the search and test settings , such as the length of training schedules ( Zoph & Le , 2017 ; Zoph et al. , 2018 ) , cross-architecture weight sharing ( Liu et al. , 2019 ; Pham et al. , 2018 ) , and the usage of proxy datasets during search ( Zoph & Le , 2017 ; Zoph et al. , 2018 ; Liu et al. , 2019 ) . To achieve better generalization , we propose a novel NAS formulation that searches for “ flat-minima architectures ” , which we define as architectures that perform well under small perturbations of the architecture ( Figure 1 ) . One example of architectural perturbations is to replace a convolutional operator with a skip connection ( identity mapping ) . Our work takes inspiration from prior work on neural network training , which shows that flat minima of the loss function correspond to network weights with better generalization than sharp ones ( Hochreiter & Schmidhuber , 1997 ) . We show that flat minima in the architecture space also generalize better to a new data distribution than sharp minima ( Sec . 3.3 ) . Unlike the standard NAS formulation that directly optimizes single architecture performance , i.e. , α∗ = arg minα∈A f ( α ) , we optimize the aggregated performance over the neighborhood of an architecture : α∗ = arg min α∈A g ( f ( N ( α ) ) ) , ( 1 ) where f ( · ) is a task-specific error metric , α denotes an architecture in the search space A , N ( α ) denotes the neighborhood of architecture α , and g ( · ) is an aggregation function ( e.g. , the mean function ) . Note that we overload the notation of the error metric f ( · ) and define f ( · ) to return a set of errors when the input is a set of architectures in the neighborhood : f ( N ( α ) ) = { f ( α′ ) | α′ ∈ N ( α ) } . Common choices for f ( · ) are validation loss and negative validation accuracy . We will discuss more details of neighborhood N ( α ) and aggregation function g ( · ) in the following text . To implement our formulation , one must define the neighborhood N ( α ) and specify an aggregation function g ( · ) . How to define the neighborhood of an architecture is an open question . One possible method to obtain neighboring architectures is to perturb one or more operations in the architecture and the degree of perturbation defines the scope of the neighborhood . This method can be applied to sampling-based search algorithms , e.g. , random search and reinforcement learning . However , it can not be directly used to generate neighboring architectures for gradient-based search algorithms ( a.k.a , differentiable NAS ) , where the neighboring architectures themselves also need to be differentiable with respect to the architecture being learned . To address this issue , we propose a differentiable representation for the neighborhood of architectures , which makes the objective function differentiable and allows us to apply our formulation to gradient-based algorithms , e.g. , DARTS ( Liu et al. , 2019 ) . Properly choosing the aggregation function g ( · ) can help the search algorithm identify flat minima in the search space . Our choice of g ( · ) ( e.g. , mean ) is inspired by the definition of the flatness/sharpness of local minima in previous work ( Chaudhari et al. , 2017 ; Keskar et al. , 2017 ; Dinh et al. , 2017 ) . We summarize our contributions as follows : 1 . We propose a neighborhood-aware NAS formulation based on the flat minima assumption , and demonstrate a principled way to apply our formulation to existing search algorithms , including sampling-based algorithms and gradient-based algorithms . We empirically validate our assumption and show that flat-minima architectures generalize better than sharp ones . 2 . We propose a neighborhood-aware random search ( NA-RS ) algorithm and demonstrate its superiority over the standard random search . On NAS-Bench-201 ( Dong & Yang , 2020 ) , NA-RS outperforms the standard random search by 1.48 % on CIFAR-100 and 1.58 % on ImageNet-16-120 . 3 . We propose a differentiable neighborhood representation so that we can apply our formulation to gradient-based NAS methods . We augment DARTS ( Liu et al. , 2019 ) with our formulation and name the proposed method NA-DARTS . Our NA-DARTS outperforms DARTS by 1.18 % on CIFAR-100 and 1.2 % on ImageNet , and also performs better than or on par with state-of-the-art NAS methods . 2 RELATED WORK . Flat Minima . Hochreiter & Schmidhuber ( 1997 ) shows that flat minima of the loss function of neural networks generalize better than sharp minima . Flat minima are used to explain the poor generalization of large-batch methods ( Keskar et al. , 2017 ; Yao et al. , 2018 ) , where large-batch methods are shown to be more likely to converge to sharp minima . Chaudhari et al . ( 2017 ) propose an ob- jective function for training neural networks so that flat minima are preferred during optimization . Their objective can be interpreted as a weighted average of the ( transformed ) function values of data points around the local minima , which inspires us to consider mean as one of the aggregation functions . Previous work mentioned above focus on flat minima in the network weight space . However , we study flat minima in the architecture space , which is discrete and fundamentally different from the continuous weights studied in previous work . This makes it non-trivial to apply the flat minima idea to NAS . Zela et al . ( 2020 ) observes a strong correlation between the generalization error of the architecture found by DARTS ( Liu et al. , 2019 ) and the flatness of the loss function at the found architecture . They propose several regularization strategies to improve DARTS , such as early stopping before the loss curvature becomes too high . Our flat minima assumption is motivated by their observation and our method can be combined with their regularization strategies . NAS - Search Algorithm . Various search algorithms have been applied to solve NAS , including sampling-based and gradient-based algorithms . Representative sampling-based algorithms include random search ( Li & Talwalkar , 2019 ) , reinforcement learning ( Baker et al. , 2017 ; Zoph & Le , 2017 ; Zoph et al. , 2018 ; Zhong et al. , 2018 ) , Bayesian optimization ( Kandasamy et al. , 2018 ; Cao et al. , 2019 ) , evolutionary algorithms ( Xie & Yuille , 2017 ; Real et al. , 2017 ; 2019 ) , and sequential modelbased optimization ( Liu et al. , 2018 ) . To make NAS more computationally efficient , weight sharing across architectures is proposed to amortize the training cost of candidate architectures ( Pham et al. , 2018 ; Bender et al. , 2018 ) . Based on weight sharing , gradient-based algorithms are proposed to directly learn the architecture with gradient descent ( Liu et al. , 2019 ; Xie et al. , 2019 ) . Our focus is not proposing novel search algorithms but revisiting the standard NAS formulation . Our proposed formulation can be applied to both sampling-based algorithms and gradient-based algorithms . NAS - Search Space . Search space is crucial for the performance of NAS . One of the most widely used search spaces is the cell search space ( Zoph et al. , 2018 ) , which searches for a cell that can be stacked multiple times to form the entire network . Our proposed neighborhood-aware formulation is agnostic to the search space , and we specifically showcase our formulation on the cell search space . 3 NEIGHBORHOOD-AWARE FORMULATION . We propose a neighborhood-aware NAS formulation ( Eq . 1 ) to identify flat minima in the search space . Our formulation builds upon the assumption that flat-minima architectures usually generalize better than sharp ones . In this formulation , the optimal architecture is selected according to the aggregated performance g ( f ( N ( α ) ) ) of neighbors of an architecture , instead of the standard criterion , i.e. , single architecture performance f ( α ) only . We now introduce the neighborhood definition of an architecture N ( α ) and the aggregation function g ( · ) . 3.1 NEIGHBORHOOD DEFINITION AND CELL SEARCH SPACE . Formally defining the neighborhood requires a distance metric between architectures , which largely depends on how an architecture is represented and how the search space is constructed . We adopt the cell search space ( Zoph et al. , 2018 ) as it has been widely used in recent NAS methods ( Liu et al. , 2018 ; 2019 ) . Instead of the entire architecture , we search for a cell that can be stacked multiple times to form the entire architecture . The number of times the cell is stacked and the output layer are manually defined prior to the search . A cell is defined as a directed acyclic graph ( DAG ) consisting of n nodes . Each node represents a feature map . Each directed edge ( i , j ) ( 1 ≤ i < j ≤ n ) is associated with an operation used to transform the feature map at node i , and passes the transformed feature map to node j . The feature map at one node is the sum of all the feature maps on the incoming edges to this node : x ( j ) = ∑ ( i , j ) ∈E ∑m k=1 α ( i , j ) k ok ( x ( i ) ) , where E denotes the set of edges in the cell , x ( i ) is the feature map at node i , and ok is the kth operation among the m available operations . α ( i , j ) is a m-dim one-hot vector , indicating the operation choice for edge ( i , j ) . A cell is then represented by a set of variables α = { α ( i , j ) } . Note that α ( i , j ) being a one-hot vector means that only one operation is chosen for edge ( i , j ) . On a side note , the one-hot constraint on α ( i , j ) can be relaxed in differentiable NAS methods ( Liu et al. , 2019 ; Xie et al. , 2019 ) . We define the distance between two cells α and α′ as : dist ( α , α′ ) = ∑ ( i , j ) ∈E δ ( α ( i , j ) , α′ ( i , j ) ) , ( 2 ) where δ ( · , · ) is the total variation distance between two probability distributions : δ ( p , q ) = 1 2 ||p − q||1 = 1 2 ∑m k=1 |pk − qk| . Here p and q are both m-dim probability distributions . The total variation distance is symmetric and bounded between 0 and 1 . It also offers the following property : δ ( α ( i , j ) , α′ ( i , j ) ) = 0 implies that the two cells have the same operation at edge ( i , j ) and δ ( α ( i , j ) , α′ ( i , j ) ) = 1 implies that they have different operations at edge ( i , j ) . Note that instead of directly counting the edge differences , we adopt total variation distance to accommodate relaxed α that is later used in differentiable NAS methods ( Liu et al. , 2019 ; Xie et al. , 2019 ) . The neighborhood of a cell α is defined as : N ( α ) = { α′ | dist ( α , α′ ) ≤ d } , ( 3 ) where d is a distance threshold . Due to the property of the total variation distance , when d is an integer , the neighborhood contains all the cells that have at most d edges associated with different operations from α . For clarification , our definition of neighborhood includes the reference architecture α itself .
This paper introduces a searching framework of neural architectures search by modifying the objective function to optimize the aggregated performance over the neighborhood of an architecture. From the observation that flat-minima architecture $\alpha$ generalizes better than sharp-minima architecture (Zela et al. (ICLR2020), the author proposes the objective function considering the neighborhood to enforce the flat minima. The author supports their method by providing ablation studies and architecture performances from CIFAR-10/100, ImageNet, and NAS-BENCH-201.
SP:9f950c0b9c87ef9e2fbbe79e4a2c4d6a8fd1b041
Fully Convolutional Approach for Simulating Wave Dynamics
We investigate the performance of fully convolutional networks to predict the motion and interaction of surface waves in open and closed complex geometries . We focus on a U-Net type architecture and assess its ability to capture and extrapolate wave propagation in time as well as the reflection , interference and diffraction of waves . We investigate how well the network generalises both to long-time predictions and to geometric configurations not seen during training . We demonstrate that this neural network is capable of accurately predicting the height distribution of waves on a liquid surface within curved and multi-faceted open and closed geometries , when only simple box and right-angled corner geometries were seen during training . We found that the RMSE of the predictions remained of order 1× 10−4 times the characteristic length of the domain for at least 20 time-steps . 1 INTRODUCTION Figure 1 : Rollouts of our U-Net . It simulates wave motion on a fluid surface with the possible existence of solid walls [ video ] . Predicting the spatio-temporal dynamics of physical systems is a recurrent problem in many areas of science and engineering . A well-established process consists of describing the physical phenomena by human-engineered mathematical models , which capture our current understanding of the physical laws governing the systems , but whose complexity may prevent finding analytical solutions . Scientists therefore frequently turn to numerical solvers to simulate such mathematical models and generate accurate approximations to their solution . The huge progress in machine learning ( ML ) algorithms and increased availability of computational power during the last decade has motivated a significant growth in the popularity of data-driven physics . In this field , the interpolation capabilities of neural networks ( NNs ) have been mostly used in two ways : first , to solve partial differential equations ( PDEs ) in an unsupervised manner ( Dissanayake & Phan-Thien , 1994 ; Lagaris et al. , 1998 ; 2000 ; Raissi et al. , 2019 ) and second , to predict the physical dynamics from previous observations without knowledge of the underlying equations ( Guo et al. , 2016 ; Farimani et al. , 2017 ; Thuerey et al. , 2018 ; Lee & You , 2019 ) . Unlike the first approach , the latter does not lead to an ana- lytical representation of the physical dynamics , however , it makes feasible to produce predictions for a diversity of physical domains , boundary conditions and initial conditions without needing to re-train the network , provided that the physical laws are unaltered . Recent studies applying convolutional neural networks ( CNNs ) to simulate fluid dynamics have reported a speed-up of up to four orders of magnitude , in comparison to traditional numerical solvers , while keeping a similar accuracy ( Guo et al. , 2016 ) . The major shortcoming of NNs are their often poor generalization to unseen configurations and poor long-time predictions in unsteady simulations . We investigate the application of fully convolutional neural networks to the problem of forecasting surface wave dynamics , the motion of which is described by the shallow water equations , a system of three non-linear PDEs ( Ersoy et al. , 2017 ) . Computational modelling of surface waves is widely used in seismology , computer animation and flood modelling ( Ersoy et al. , 2017 ; Garcı́a-Navarro et al. , 2019 ) . Our network learnt to simulate a range of physical phenomena including wave propagation , reflection , interference and diffraction at sharp corners . This kind of NN could supplement or potentially replace numerical algorithms used to solve the shallow water PDEs , reducing the inference time by several orders of magnitude and allowing for real-time solutions . This has particular relevance in iterative design scenarios and potential applications such as tsunami prediction . Contribution . We demonstrate that our U-Net architecture is able to accurately predict surface wave dynamics in complex straight-sided and curved geometries , even when trained only on datasets with simple straight-sided boundaries . The generalisation to different initial conditions and longertime predictions are also evaluated . Additionally , we show how including the MSE of the wave gradient into the loss function significantly reduces spurious oscillations in predicted solutions and may help improve the prediction of the position of the wavefronts . Our network is able to simulate wave dynamics four orders of magnitude faster than a state-of-the-art spectral/hp element numerical solver ( Karniadakis & Sherwin , 2013 ) , so it could be an effective replacement for numerical solvers in applications where performance is critical . 2 RELATED WORK . Physics-informed NNs for solving PDEs . The use of NNs for the solution of PDEs has been investigated since the early 1990s . Most of the relevant research at that time built on the idea of exploiting the universal function approximator property of multi-layer perceptrons ( MLPs ) ( Dissanayake & Phan-Thien , 1994 ; Dissanayake & Phan-Thien , 1994 ; Lagaris et al. , 1998 ) . In such an approach , the solutions to the PDEs are approximated as MLPs whose only inputs are the spatio-temporal coordinates . These MLPs are trained in an unsupervised way to satisfy the governing PDEs as well as the initial and boundary conditions . The main advantage of this paradigm is that the solution is obtained in a differentiable , closed analytic form , easily usable in any subsequent calculations . Nevertheless , these networks can not extrapolate to different domains , boundary conditions or initial conditions ; making it necessary to re-train the network for every slight modification of the problem . These techniques inspired the more modern physics-informed neural networks ( PINNs ) ( Raissi et al. , 2017 ; Yazdani et al. , 2018 ; Raissi et al. , 2019 ; Lu et al. , 2019 ) , which include deeper MLPs and random collocation points . CNNs for simulating steady physics . During the last five years , most of the networks used to predict continuous physics have included convolution layers . For instance , CNNs have been used to solve the Poisson ’ s equation ( Tang et al. , 2018 ; Özbay et al. , 2019 ) , and to solve the steady NavierStokes equations ( Guo et al. , 2016 ; Miyanawala & Jaiman , 2018 ; Yilmaz & German , 2017 ; Farimani et al. , 2017 ; Thuerey et al. , 2018 ; Zhang et al. , 2018 ) . The use of CNNs allows for visual inputs representing physical information , such as the domain geometry or the initial condition , and for visual outputs representing the solution fields . In contrast to PINNs , the network predictions are purely based on observation , without knowledge of the underlying governing equations . This paradigm has proven to extrapolate well to domain geometries , boundary conditions and initial conditions not seen during training ( Thuerey et al. , 2018 ) . The evaluation of these networks for prediction is considerably faster than traditional PDE solvers , allowing relatively accurate solutions to be predicted between one and four orders of magnitude faster ( Guo et al. , 2016 ; Farimani et al. , 2017 ) . These reasons make CNNs perfect for developing surrogate models , complementing expensive numerical solvers ( Guo et al. , 2016 ; Miyanawala & Jaiman , 2018 ) , or for real-time animations ( Kim et al. , 2019 ) . Our work takes inspiration from Guo et al . ( 2016 ) in the use of a binary geometry field to represent the physical domain . Although Guo et al . ( 2016 ) ; Farimani et al . ( 2017 ) and Thuerey et al . ( 2018 ) proved the generalisation of their networks to domain geometries not seen during training , these unseen domains contain elementary geometrical entities included within the training data . We go one step further by training the network with exclusively straight boundaries and demonstrating the network is able to generalise to domains incorporating boundaries with varying radius of curvature . CNNs for simulating unsteady physics . Unsteady physics have also been explored from the computer vision perspective ( Lee & You , 2019 ; Sorteberg et al. , 2018 ; Wiewel et al. , 2019 ; Kim et al. , 2019 ; Fotiadis et al. , 2020 ) , although to a lesser extent than steady physics . Here , the input to the network is a sequence of past solution fields , while the output is a sequence of predicted solution fields at future times . When predicting unsteady phenomena there is an additional challenge : keeping the predictions accurate along time . To address this , Sorteberg et al . ( 2018 ) ; Wiewel et al . ( 2019 ) and Kim et al . ( 2019 ) proposed to use encoder-propagator-decoder architectures , whereas Lee & You ( 2019 ) and Fotiadis et al . ( 2020 ) continued to use encoder-decoder architectures similar to those used for steady problems . Inspired by Fotiadis et al . ( 2020 ) , which showed that feed-forward networks perform at least as well as recurrent networks in wave forecasting , we opt to use a U-Net architecture ( Ronneberger et al. , 2015 ) to perform each time-step of the simulations . 3 METHOD . 3.1 WAVE DYNAMICS DATASETS . The datasets used during training and testing were generated by solving the inviscid , twodimensional shallow water equations with Nektar++ , a high-order spectral/hp element solver ( Cantwell et al. , 2015 ) . In conservative form , these equations are given by ∂ ∂t ( h hu hv ) +∇ · hu hvhu2 + gh2/2 hvu huv hv2 + gh2/2 = 0 , ( x , y ) ∈ D ( 1 ) where g = 9.80665 m/s2 is the acceleration due to gravity and D ∈ R2 denotes the domain under consideration . Unknown variables in this system are the water depth h ( x , y , t ) and the components of the two-dimensional velocity vector u ( x , y , t ) and v ( x , y , t ) . We imposed two forms of boundary conditions : solid wall boundaries , which result in wave reflection and diffraction ; and open boundaries , which allow waves to exit the domain . As initial conditions we considered a droplet , represented mathematically by a localized two-dimensional Gaussian superimposed on a unitary depth : h10 = 1 + I exp ( − C ( ( x− xc ) 2 + ( y − yc ) 2 ) ) ( 2 ) where I is set to 0.1 m , C is randomly sampled from a uniform distribution between 400 and 1000 m−2 and the droplet centre , ( xc , yc ) , is randomly sampled from a uniform distribution in D. Each simulation in the datasets is associated with a binary geometry field , Ω ( x , y ) , which satisfies Ω ( x , y ) = { 0 , if ( x , y ) ∈ D , 1 , otherwise . ( 3 ) Therefore , Ω = 0 inside the fluid domain and Ω = 1 in the solid boundaries ( Guo et al. , 2016 ) . This geometry forms an additional input to the network , required to provide information about the walls location . Figure 2 shows the geometry field for the seven categories of fluid domains included in the datasets . The table below summarises the training and testing sets . The sequences in each dataset contain 100 snapshots of the height field sampled at intervals of ∆t = 0.003 seconds . For full details of the datasets , see Appendix A . 1
The authors use a U-Net architecture network to predict the motion and interaction of surface waves in an open and closed complex. The network trained on data with a simple box and right-angled corner geometries and generalizes well to other complex geometric configurations. The neural network-based method runs much faster than the standard numerical simulation by directly solving the PDE.
SP:e434279e7be862814a73cf3116ddbb4f1b6a1283
Fully Convolutional Approach for Simulating Wave Dynamics
We investigate the performance of fully convolutional networks to predict the motion and interaction of surface waves in open and closed complex geometries . We focus on a U-Net type architecture and assess its ability to capture and extrapolate wave propagation in time as well as the reflection , interference and diffraction of waves . We investigate how well the network generalises both to long-time predictions and to geometric configurations not seen during training . We demonstrate that this neural network is capable of accurately predicting the height distribution of waves on a liquid surface within curved and multi-faceted open and closed geometries , when only simple box and right-angled corner geometries were seen during training . We found that the RMSE of the predictions remained of order 1× 10−4 times the characteristic length of the domain for at least 20 time-steps . 1 INTRODUCTION Figure 1 : Rollouts of our U-Net . It simulates wave motion on a fluid surface with the possible existence of solid walls [ video ] . Predicting the spatio-temporal dynamics of physical systems is a recurrent problem in many areas of science and engineering . A well-established process consists of describing the physical phenomena by human-engineered mathematical models , which capture our current understanding of the physical laws governing the systems , but whose complexity may prevent finding analytical solutions . Scientists therefore frequently turn to numerical solvers to simulate such mathematical models and generate accurate approximations to their solution . The huge progress in machine learning ( ML ) algorithms and increased availability of computational power during the last decade has motivated a significant growth in the popularity of data-driven physics . In this field , the interpolation capabilities of neural networks ( NNs ) have been mostly used in two ways : first , to solve partial differential equations ( PDEs ) in an unsupervised manner ( Dissanayake & Phan-Thien , 1994 ; Lagaris et al. , 1998 ; 2000 ; Raissi et al. , 2019 ) and second , to predict the physical dynamics from previous observations without knowledge of the underlying equations ( Guo et al. , 2016 ; Farimani et al. , 2017 ; Thuerey et al. , 2018 ; Lee & You , 2019 ) . Unlike the first approach , the latter does not lead to an ana- lytical representation of the physical dynamics , however , it makes feasible to produce predictions for a diversity of physical domains , boundary conditions and initial conditions without needing to re-train the network , provided that the physical laws are unaltered . Recent studies applying convolutional neural networks ( CNNs ) to simulate fluid dynamics have reported a speed-up of up to four orders of magnitude , in comparison to traditional numerical solvers , while keeping a similar accuracy ( Guo et al. , 2016 ) . The major shortcoming of NNs are their often poor generalization to unseen configurations and poor long-time predictions in unsteady simulations . We investigate the application of fully convolutional neural networks to the problem of forecasting surface wave dynamics , the motion of which is described by the shallow water equations , a system of three non-linear PDEs ( Ersoy et al. , 2017 ) . Computational modelling of surface waves is widely used in seismology , computer animation and flood modelling ( Ersoy et al. , 2017 ; Garcı́a-Navarro et al. , 2019 ) . Our network learnt to simulate a range of physical phenomena including wave propagation , reflection , interference and diffraction at sharp corners . This kind of NN could supplement or potentially replace numerical algorithms used to solve the shallow water PDEs , reducing the inference time by several orders of magnitude and allowing for real-time solutions . This has particular relevance in iterative design scenarios and potential applications such as tsunami prediction . Contribution . We demonstrate that our U-Net architecture is able to accurately predict surface wave dynamics in complex straight-sided and curved geometries , even when trained only on datasets with simple straight-sided boundaries . The generalisation to different initial conditions and longertime predictions are also evaluated . Additionally , we show how including the MSE of the wave gradient into the loss function significantly reduces spurious oscillations in predicted solutions and may help improve the prediction of the position of the wavefronts . Our network is able to simulate wave dynamics four orders of magnitude faster than a state-of-the-art spectral/hp element numerical solver ( Karniadakis & Sherwin , 2013 ) , so it could be an effective replacement for numerical solvers in applications where performance is critical . 2 RELATED WORK . Physics-informed NNs for solving PDEs . The use of NNs for the solution of PDEs has been investigated since the early 1990s . Most of the relevant research at that time built on the idea of exploiting the universal function approximator property of multi-layer perceptrons ( MLPs ) ( Dissanayake & Phan-Thien , 1994 ; Dissanayake & Phan-Thien , 1994 ; Lagaris et al. , 1998 ) . In such an approach , the solutions to the PDEs are approximated as MLPs whose only inputs are the spatio-temporal coordinates . These MLPs are trained in an unsupervised way to satisfy the governing PDEs as well as the initial and boundary conditions . The main advantage of this paradigm is that the solution is obtained in a differentiable , closed analytic form , easily usable in any subsequent calculations . Nevertheless , these networks can not extrapolate to different domains , boundary conditions or initial conditions ; making it necessary to re-train the network for every slight modification of the problem . These techniques inspired the more modern physics-informed neural networks ( PINNs ) ( Raissi et al. , 2017 ; Yazdani et al. , 2018 ; Raissi et al. , 2019 ; Lu et al. , 2019 ) , which include deeper MLPs and random collocation points . CNNs for simulating steady physics . During the last five years , most of the networks used to predict continuous physics have included convolution layers . For instance , CNNs have been used to solve the Poisson ’ s equation ( Tang et al. , 2018 ; Özbay et al. , 2019 ) , and to solve the steady NavierStokes equations ( Guo et al. , 2016 ; Miyanawala & Jaiman , 2018 ; Yilmaz & German , 2017 ; Farimani et al. , 2017 ; Thuerey et al. , 2018 ; Zhang et al. , 2018 ) . The use of CNNs allows for visual inputs representing physical information , such as the domain geometry or the initial condition , and for visual outputs representing the solution fields . In contrast to PINNs , the network predictions are purely based on observation , without knowledge of the underlying governing equations . This paradigm has proven to extrapolate well to domain geometries , boundary conditions and initial conditions not seen during training ( Thuerey et al. , 2018 ) . The evaluation of these networks for prediction is considerably faster than traditional PDE solvers , allowing relatively accurate solutions to be predicted between one and four orders of magnitude faster ( Guo et al. , 2016 ; Farimani et al. , 2017 ) . These reasons make CNNs perfect for developing surrogate models , complementing expensive numerical solvers ( Guo et al. , 2016 ; Miyanawala & Jaiman , 2018 ) , or for real-time animations ( Kim et al. , 2019 ) . Our work takes inspiration from Guo et al . ( 2016 ) in the use of a binary geometry field to represent the physical domain . Although Guo et al . ( 2016 ) ; Farimani et al . ( 2017 ) and Thuerey et al . ( 2018 ) proved the generalisation of their networks to domain geometries not seen during training , these unseen domains contain elementary geometrical entities included within the training data . We go one step further by training the network with exclusively straight boundaries and demonstrating the network is able to generalise to domains incorporating boundaries with varying radius of curvature . CNNs for simulating unsteady physics . Unsteady physics have also been explored from the computer vision perspective ( Lee & You , 2019 ; Sorteberg et al. , 2018 ; Wiewel et al. , 2019 ; Kim et al. , 2019 ; Fotiadis et al. , 2020 ) , although to a lesser extent than steady physics . Here , the input to the network is a sequence of past solution fields , while the output is a sequence of predicted solution fields at future times . When predicting unsteady phenomena there is an additional challenge : keeping the predictions accurate along time . To address this , Sorteberg et al . ( 2018 ) ; Wiewel et al . ( 2019 ) and Kim et al . ( 2019 ) proposed to use encoder-propagator-decoder architectures , whereas Lee & You ( 2019 ) and Fotiadis et al . ( 2020 ) continued to use encoder-decoder architectures similar to those used for steady problems . Inspired by Fotiadis et al . ( 2020 ) , which showed that feed-forward networks perform at least as well as recurrent networks in wave forecasting , we opt to use a U-Net architecture ( Ronneberger et al. , 2015 ) to perform each time-step of the simulations . 3 METHOD . 3.1 WAVE DYNAMICS DATASETS . The datasets used during training and testing were generated by solving the inviscid , twodimensional shallow water equations with Nektar++ , a high-order spectral/hp element solver ( Cantwell et al. , 2015 ) . In conservative form , these equations are given by ∂ ∂t ( h hu hv ) +∇ · hu hvhu2 + gh2/2 hvu huv hv2 + gh2/2 = 0 , ( x , y ) ∈ D ( 1 ) where g = 9.80665 m/s2 is the acceleration due to gravity and D ∈ R2 denotes the domain under consideration . Unknown variables in this system are the water depth h ( x , y , t ) and the components of the two-dimensional velocity vector u ( x , y , t ) and v ( x , y , t ) . We imposed two forms of boundary conditions : solid wall boundaries , which result in wave reflection and diffraction ; and open boundaries , which allow waves to exit the domain . As initial conditions we considered a droplet , represented mathematically by a localized two-dimensional Gaussian superimposed on a unitary depth : h10 = 1 + I exp ( − C ( ( x− xc ) 2 + ( y − yc ) 2 ) ) ( 2 ) where I is set to 0.1 m , C is randomly sampled from a uniform distribution between 400 and 1000 m−2 and the droplet centre , ( xc , yc ) , is randomly sampled from a uniform distribution in D. Each simulation in the datasets is associated with a binary geometry field , Ω ( x , y ) , which satisfies Ω ( x , y ) = { 0 , if ( x , y ) ∈ D , 1 , otherwise . ( 3 ) Therefore , Ω = 0 inside the fluid domain and Ω = 1 in the solid boundaries ( Guo et al. , 2016 ) . This geometry forms an additional input to the network , required to provide information about the walls location . Figure 2 shows the geometry field for the seven categories of fluid domains included in the datasets . The table below summarises the training and testing sets . The sequences in each dataset contain 100 snapshots of the height field sampled at intervals of ∆t = 0.003 seconds . For full details of the datasets , see Appendix A . 1
The paper applies a fully convolutional U-Net model for next step prediction of the height field for 2d wave dynamics. On the domains tested, the predictions remain accurate for 20 time-steps and the method seems to provide considerable speed-ups compared to a state-of-the-art spectral/hp element numerical solver. Some encouraging results on generalization to new domain shapes and larger scale domains are also presenting in the experimental session.
SP:e434279e7be862814a73cf3116ddbb4f1b6a1283
Fully Convolutional Approach for Simulating Wave Dynamics
We investigate the performance of fully convolutional networks to predict the motion and interaction of surface waves in open and closed complex geometries . We focus on a U-Net type architecture and assess its ability to capture and extrapolate wave propagation in time as well as the reflection , interference and diffraction of waves . We investigate how well the network generalises both to long-time predictions and to geometric configurations not seen during training . We demonstrate that this neural network is capable of accurately predicting the height distribution of waves on a liquid surface within curved and multi-faceted open and closed geometries , when only simple box and right-angled corner geometries were seen during training . We found that the RMSE of the predictions remained of order 1× 10−4 times the characteristic length of the domain for at least 20 time-steps . 1 INTRODUCTION Figure 1 : Rollouts of our U-Net . It simulates wave motion on a fluid surface with the possible existence of solid walls [ video ] . Predicting the spatio-temporal dynamics of physical systems is a recurrent problem in many areas of science and engineering . A well-established process consists of describing the physical phenomena by human-engineered mathematical models , which capture our current understanding of the physical laws governing the systems , but whose complexity may prevent finding analytical solutions . Scientists therefore frequently turn to numerical solvers to simulate such mathematical models and generate accurate approximations to their solution . The huge progress in machine learning ( ML ) algorithms and increased availability of computational power during the last decade has motivated a significant growth in the popularity of data-driven physics . In this field , the interpolation capabilities of neural networks ( NNs ) have been mostly used in two ways : first , to solve partial differential equations ( PDEs ) in an unsupervised manner ( Dissanayake & Phan-Thien , 1994 ; Lagaris et al. , 1998 ; 2000 ; Raissi et al. , 2019 ) and second , to predict the physical dynamics from previous observations without knowledge of the underlying equations ( Guo et al. , 2016 ; Farimani et al. , 2017 ; Thuerey et al. , 2018 ; Lee & You , 2019 ) . Unlike the first approach , the latter does not lead to an ana- lytical representation of the physical dynamics , however , it makes feasible to produce predictions for a diversity of physical domains , boundary conditions and initial conditions without needing to re-train the network , provided that the physical laws are unaltered . Recent studies applying convolutional neural networks ( CNNs ) to simulate fluid dynamics have reported a speed-up of up to four orders of magnitude , in comparison to traditional numerical solvers , while keeping a similar accuracy ( Guo et al. , 2016 ) . The major shortcoming of NNs are their often poor generalization to unseen configurations and poor long-time predictions in unsteady simulations . We investigate the application of fully convolutional neural networks to the problem of forecasting surface wave dynamics , the motion of which is described by the shallow water equations , a system of three non-linear PDEs ( Ersoy et al. , 2017 ) . Computational modelling of surface waves is widely used in seismology , computer animation and flood modelling ( Ersoy et al. , 2017 ; Garcı́a-Navarro et al. , 2019 ) . Our network learnt to simulate a range of physical phenomena including wave propagation , reflection , interference and diffraction at sharp corners . This kind of NN could supplement or potentially replace numerical algorithms used to solve the shallow water PDEs , reducing the inference time by several orders of magnitude and allowing for real-time solutions . This has particular relevance in iterative design scenarios and potential applications such as tsunami prediction . Contribution . We demonstrate that our U-Net architecture is able to accurately predict surface wave dynamics in complex straight-sided and curved geometries , even when trained only on datasets with simple straight-sided boundaries . The generalisation to different initial conditions and longertime predictions are also evaluated . Additionally , we show how including the MSE of the wave gradient into the loss function significantly reduces spurious oscillations in predicted solutions and may help improve the prediction of the position of the wavefronts . Our network is able to simulate wave dynamics four orders of magnitude faster than a state-of-the-art spectral/hp element numerical solver ( Karniadakis & Sherwin , 2013 ) , so it could be an effective replacement for numerical solvers in applications where performance is critical . 2 RELATED WORK . Physics-informed NNs for solving PDEs . The use of NNs for the solution of PDEs has been investigated since the early 1990s . Most of the relevant research at that time built on the idea of exploiting the universal function approximator property of multi-layer perceptrons ( MLPs ) ( Dissanayake & Phan-Thien , 1994 ; Dissanayake & Phan-Thien , 1994 ; Lagaris et al. , 1998 ) . In such an approach , the solutions to the PDEs are approximated as MLPs whose only inputs are the spatio-temporal coordinates . These MLPs are trained in an unsupervised way to satisfy the governing PDEs as well as the initial and boundary conditions . The main advantage of this paradigm is that the solution is obtained in a differentiable , closed analytic form , easily usable in any subsequent calculations . Nevertheless , these networks can not extrapolate to different domains , boundary conditions or initial conditions ; making it necessary to re-train the network for every slight modification of the problem . These techniques inspired the more modern physics-informed neural networks ( PINNs ) ( Raissi et al. , 2017 ; Yazdani et al. , 2018 ; Raissi et al. , 2019 ; Lu et al. , 2019 ) , which include deeper MLPs and random collocation points . CNNs for simulating steady physics . During the last five years , most of the networks used to predict continuous physics have included convolution layers . For instance , CNNs have been used to solve the Poisson ’ s equation ( Tang et al. , 2018 ; Özbay et al. , 2019 ) , and to solve the steady NavierStokes equations ( Guo et al. , 2016 ; Miyanawala & Jaiman , 2018 ; Yilmaz & German , 2017 ; Farimani et al. , 2017 ; Thuerey et al. , 2018 ; Zhang et al. , 2018 ) . The use of CNNs allows for visual inputs representing physical information , such as the domain geometry or the initial condition , and for visual outputs representing the solution fields . In contrast to PINNs , the network predictions are purely based on observation , without knowledge of the underlying governing equations . This paradigm has proven to extrapolate well to domain geometries , boundary conditions and initial conditions not seen during training ( Thuerey et al. , 2018 ) . The evaluation of these networks for prediction is considerably faster than traditional PDE solvers , allowing relatively accurate solutions to be predicted between one and four orders of magnitude faster ( Guo et al. , 2016 ; Farimani et al. , 2017 ) . These reasons make CNNs perfect for developing surrogate models , complementing expensive numerical solvers ( Guo et al. , 2016 ; Miyanawala & Jaiman , 2018 ) , or for real-time animations ( Kim et al. , 2019 ) . Our work takes inspiration from Guo et al . ( 2016 ) in the use of a binary geometry field to represent the physical domain . Although Guo et al . ( 2016 ) ; Farimani et al . ( 2017 ) and Thuerey et al . ( 2018 ) proved the generalisation of their networks to domain geometries not seen during training , these unseen domains contain elementary geometrical entities included within the training data . We go one step further by training the network with exclusively straight boundaries and demonstrating the network is able to generalise to domains incorporating boundaries with varying radius of curvature . CNNs for simulating unsteady physics . Unsteady physics have also been explored from the computer vision perspective ( Lee & You , 2019 ; Sorteberg et al. , 2018 ; Wiewel et al. , 2019 ; Kim et al. , 2019 ; Fotiadis et al. , 2020 ) , although to a lesser extent than steady physics . Here , the input to the network is a sequence of past solution fields , while the output is a sequence of predicted solution fields at future times . When predicting unsteady phenomena there is an additional challenge : keeping the predictions accurate along time . To address this , Sorteberg et al . ( 2018 ) ; Wiewel et al . ( 2019 ) and Kim et al . ( 2019 ) proposed to use encoder-propagator-decoder architectures , whereas Lee & You ( 2019 ) and Fotiadis et al . ( 2020 ) continued to use encoder-decoder architectures similar to those used for steady problems . Inspired by Fotiadis et al . ( 2020 ) , which showed that feed-forward networks perform at least as well as recurrent networks in wave forecasting , we opt to use a U-Net architecture ( Ronneberger et al. , 2015 ) to perform each time-step of the simulations . 3 METHOD . 3.1 WAVE DYNAMICS DATASETS . The datasets used during training and testing were generated by solving the inviscid , twodimensional shallow water equations with Nektar++ , a high-order spectral/hp element solver ( Cantwell et al. , 2015 ) . In conservative form , these equations are given by ∂ ∂t ( h hu hv ) +∇ · hu hvhu2 + gh2/2 hvu huv hv2 + gh2/2 = 0 , ( x , y ) ∈ D ( 1 ) where g = 9.80665 m/s2 is the acceleration due to gravity and D ∈ R2 denotes the domain under consideration . Unknown variables in this system are the water depth h ( x , y , t ) and the components of the two-dimensional velocity vector u ( x , y , t ) and v ( x , y , t ) . We imposed two forms of boundary conditions : solid wall boundaries , which result in wave reflection and diffraction ; and open boundaries , which allow waves to exit the domain . As initial conditions we considered a droplet , represented mathematically by a localized two-dimensional Gaussian superimposed on a unitary depth : h10 = 1 + I exp ( − C ( ( x− xc ) 2 + ( y − yc ) 2 ) ) ( 2 ) where I is set to 0.1 m , C is randomly sampled from a uniform distribution between 400 and 1000 m−2 and the droplet centre , ( xc , yc ) , is randomly sampled from a uniform distribution in D. Each simulation in the datasets is associated with a binary geometry field , Ω ( x , y ) , which satisfies Ω ( x , y ) = { 0 , if ( x , y ) ∈ D , 1 , otherwise . ( 3 ) Therefore , Ω = 0 inside the fluid domain and Ω = 1 in the solid boundaries ( Guo et al. , 2016 ) . This geometry forms an additional input to the network , required to provide information about the walls location . Figure 2 shows the geometry field for the seven categories of fluid domains included in the datasets . The table below summarises the training and testing sets . The sequences in each dataset contain 100 snapshots of the height field sampled at intervals of ∆t = 0.003 seconds . For full details of the datasets , see Appendix A . 1
In this paper, a methodology for simulating wave dynamics is presented based on convolutional neural networks. A standard analytic wave dynamics solver was used to generate a large dataset of 2D wave simulations. A deep net based on U-Net was trained to predict the next state of the wave field given the five previous states. The training was done with both standard MSE loss and also GradLoss, which placed a loss on the gradients of the field as well. The results show that the network trained with GradLoss performs significantly better over successive rollouts than the one trained with MSE. The results also show that the trained network is able to generalize to qualitatively different environments from the training set.
SP:e434279e7be862814a73cf3116ddbb4f1b6a1283
Image Modeling with Deep Convolutional Gaussian Mixture Models
1 INTRODUCTION . This conceptual work is in the context of probabilistic image modeling , whose main objectives are density estimation and image generation ( sampling ) . Since images usually do not precisely follow a Gaussian mixture distribution , such a treatment is inherently approximative in nature . This implies that clustering , even though it is possible and has a long history in the context of Gaussian Mixture Models ( GMMs ) , is not a main objective . Sampling is an active research topic mainly relying on Generative Adverserial Networks ( GANs ) discussed in Section 1.2 . Similar techniques are being investigated for generating videos ( Ghazvinian Zanjani et al. , 2018 ; Piergiovanni & Ryoo , 2019 ) . An issue with GANs is that their probabilistic interpretation remains unclear . This is outlined by the fact that there is no easy-to-compute probabilistic measure of the current fit-to-data that is optimized by GAN training . Recent evidence seems to indicate that GANs may not model the full image distribution as given by training data ( Richardson & Weiss , 2018 ) . Besides , images generated by GANs appear extremely realistic and diverse , and the GAN model has been adapted to perform a wide range of visually impressive functionalities . In contrast , GMMs explicitly describe the distribution p ( X ) , given by a set of training data X = { xn } , as a weighted mixture of K Gaussian component densities N ( x ; µk , Σk ) ≡Nk ( x ) : p ( x ) = ∑K k πkNk ( x ) . GMMs require the mixture weights to be normalized : ∑ k πk = 1 and the covariance matrices to be positive definite : xTΣkx > 0 ∀x . The quality of the current fit-to-data is expressed by the log-likelihood L ( X ) = En [ log ∑ k πkNk ( xn ) ] , ( 1 ) which is what GMM training optimizes , usually by variants of Expectation-Maximization ( EM ) ( Dempster et al. , 1977 ) . It can be shown that arbitrary distributions can , given enough components , be approximated by mixtures of Gaussians ( Goodfellow et al. , 2016 ) . Thus , GMMs are guaranteed to model the complete data distribution , but only to the extent allowed by the number of componentsK . In this respect , GMMs are similar to flat neural networks with a single hidden layer : although , by the universal approximation theorem of Pinkus ( 1999 ) and Hornik et al . ( 1989 ) , they can approximate arbitrary functions ( from certain rather broad function classes ) , they fail to do so in practice . The reason for this is that the number of required hidden layer elements is unknown , and usually beyond the reach of any reasonable computational capacity . For images , this problem was largely solved by introducing deep Convolutional Neural Networks ( CNNs ) . CNNs model the statistical structure of images ( hierarchical organization and translation invariance ) by chaining multiple convolution and pooling layers . Thus the number of parameters without compromising accuracy can be reduced . 1.1 OBJECTIVE , CONTRIBUTION AND NOVELTY . The objectives of this article are to introduce a GMM architecture which exploits the same principles that led to the performance explosion of CNNs . In particular , the genuinely novel characteristics are : • formulation of GMMs as a deep hierarchy , including convolution and pooling layers , • end-to-end training by SGD from random initial conditions ( no k-means initialization ) , • generation of realistic samples by a new sharpening procedure , • better empirical performance than vanilla GMMs for sampling , clustering and outlier detection . In addition , we provide a publicly available TensorFlow implementation which supports a Keras-like flexible construction of Deep Convolutional Gaussian Mixture Models instances . 1.2 RELATED WORK . Generative Adverserial Networks The currently most widely used models of image modeling and generation are Generative Adverserial Networks ( Arjovsky et al. , 2017 ; Mirza & Osindero , 2014 ; Goodfellow et al. , 2014 ) . Variational Autoencoders ( VAEs ) follow the classic autoencoder principle ( Kingma & Welling , 2013 ) , trying to reconstruct their inputs through a bottleneck layer , whose activities are additionally constrained to have a Gaussian distribution . GANs are trained adversarially , mapping Gaussian noise to image instances , while trying to fool an additional discriminator network , which in turn aims to distinguish real from generated samples . They are capable of generating photo-realistic images ( Richardson & Weiss , 2018 ) , although their probabilistic interpretation remains unclear since they do not possess a differentiable loss function that is minimized by training . They may suffer from what is termed mode collapse , which is hard to detect automatically due to the absence of a loss function . Due to their ability to generate realistic images , they are prominently used in models of continual learning ( Shin et al. , 2018 ) . Hierarchical GMMs Mixture of Factor Analyzers ( MFAs ) models ( McLachlan & Peel , 2005 ; Ghahramani & Hinton , 1997 ) can be considered as hierarchical GMMs because they are formulated in terms of a lower-dimensional latent-variable representation , which is mapped to a higherdimensional space . The use of MFAs for describing natural images is discussed in detail in Richardson & Weiss ( 2018 ) , showing that the MFA model alone , without further hierarchical structure , compares quite favorably to GANs when considering image generation . A straightforward hierarchical extension of GMMs is presented by Liu et al . ( 2002 ) with the goal of unsupervised clustering : responsibilities of one GMM are treated as inputs to a subsequent GMM , together with an adaptive mechanism that determines the depth of the hierarchy . Garcia et al . ( 2010 ) present a comparable , more information-theoretic approach . A hierarchy of MFA layers with sampling in mind is presented by Viroli & McLachlan ( 2019 ) , where each layer is sampling values for the latent variables of the previous one , although transformations between layers are exclusively linear . Van Den Oord & Schrauwen ( 2014 ) and ( Tang et al. , 2012 ) pursue a similar approach . All described approaches use ( quite complex ) extensions of the EM algorithm initialized by k-means for training hierarchical GMMs , except Richardson & Weiss ( 2018 ) use Stochastic Gradient Descent ( SGD ) , although with a k-means initialization . None of these models consider convolutional or max-pooling operations which have been proven to be important for modeling the statistical structure of images . Convolutional GMMs The only work we could identify proposing to estimate hierarchical convolutional GMMs is Ghazvinian Zanjani et al . ( 2018 ) , although the article described a hybrid model where a CNN and a GMM are combined . SGD and End-to-End GMM Training Training GMMs by SGD is challenging due to local optima and the need to enforce model constraints , most notably the constraint of positive-definite covariance matrices . This has recently been discussed in Hosseini & Sra ( 2020 ) , although the proposed solution requires parameter initialization by k-means and introduces several new hyper-parameters and is , thus , unlikely to work as-is in a hierarchical structure . An SGD approach that achieves robust convergence even without k-means-based parameter initialization is presented by Gepperth & Pflb ( 2020 ) . Undesirable local optima caused by random parameter initialization are circumvented by an adaptive annealing strategy . 2 DATA . For the evaluation we use the following image data sets : MNIST ( LeCun et al. , 1998 ) is the common benchmark for computer vision systems and classification problems . It consists of 60 000 28× 28 gray scale images of handwritten digits ( 0-9 ) . FashionMNIST ( Xiao et al. , 2017 ) consists of images of clothes in 10 categories and is structured like the MNIST dataset . Although these datasets are not particularly challenging for classification , their dimensionality of 784 is at least one magnitude higher than datasets used for validating other hierarchical GMM approaches in the literature . 3 DCGMM : MODEL OVERVIEW . The Deep Convolutional Gaussian Mixture Model is a hierarchical model consisting of layers in analogy to CNNs.1 Each layer with index L expects an input tensor A ( L−1 ) ∈R4 of dimensions N , H ( L−1 ) , W ( L−1 ) , C ( L−1 ) and produces an output tensor A ( L ) ∈R4 of dimensions N , H ( L ) , W ( L ) , C ( L ) . Layers can have internal variables θ ( L ) that are adapted during SGD training . An DCGMM layer L has two basic operating modes ( see Figure 1 ) : for ( density ) estimation , an input tensor A ( L−1 ) from layer L− 1 is transformed into an output tensor A ( L ) . For sampling , the direction is reversed : each layer receives a control signal T ( L+1 ) from layer L+1 ( same dimensions as A ( L ) ) , which is transformed into a control signal T ( L ) to layer L-1 ( same dimensions as A ( L−1 ) ) . 3.1 LAYER TYPES . We define three layer types : Folding ( F ) , Pooling ( P ) and convolutional GMM ( G ) . Each layer implements distinct operations for each of the two modes , i.e. , estimation and sampling . 1TensorFlow code is available under https : //github.com/iclr2021-dcgmm/dcgmm Folding Layer For density estimation , this layer performs a part of the well-known convolution operation known from CNNs . Based on the filter sizes f ( L ) X , f ( L ) Y as well as the filter strides ∆ ( L ) X , ∆ ( L ) Y , all entries of the input tensor inside the range of the sliding filter window are dumped into the channel dimension of the output tensor . We thus obtain an output tensor of dimensions N , H ( L ) = 1 + H ( L−1 ) −f ( L ) Y ∆ ( L ) Y , W ( L ) = 1 + W ( L−1 ) −f ( L ) X ∆ ( L ) X and C ( L ) =C ( L ) f ( L ) X f ( L ) Y , whose entries are computed as A ( L ) nhwc = A ( L−1 ) nh′w′c′ with h=h ′/f ( L ) Y , w=w′/f ( L ) X and c= c ′+ ( ( h′−h∆ ( L ) Y ) f ( L ) X +w ′−w∆ ( L ) X ) C ( L−1 ) + c′ . When sampling , it performs the inverse mapping which is not a one-to-one correspondence : input tensor elements which receive several contributions are simply averaged over all contributions . Pooling Layer For density estimation , pooling layers perform the same operations as standard ( max- ) pooling layers in CNNs based on the kernel sizes k ( L ) Y , k ( L ) X and strides ∆ ( L ) X , ∆ ( L ) Y . When sampling , pooling layers perform a simple nearest-neighbor up-sampling by a factor indicated by the kernel sizes and strides . GMM Layer This layer type contains K GMM components , each of which is associated with trainable parameters πk , µk and Σk , k = 1 . . .K , representing the GMM weights , centroids and covariances . What makes GMM layers convolutional is that they do not model single input vectors , but the channel content at all positions h , w of the input A ( L−1 ) n , w , h , : , using a shared set of parameters . This is analog to the way a CNN layer models image content at all sliding window positions using the same filters . A GMM layer thus maps the input tensor A ( L−1 ) ∈RN , H ( L−1 ) , W ( L−1 ) , C ( L−1 ) to A ( L ) ∈RN , H ( L−1 ) , W ( L−1 ) , K , each GMM component k ∈ { 0 , . . . , K } contributing the likelihood A ( L ) nhwk of having generated the channel content at position h , w ( for sample n in the mini-batch ) . This likelihood is often referred to as responsibility and is computed as pnhwk ( A ( L−1 ) ) = Nk ( A ( L−1 ) nhw : ; µk , Σk ) A ( L ) nhwk ≡ pnhwk∑ c′ pnhwc′ . ( 2 ) For training the GMM layer , we optimize the GMM log-likelihood L ( L ) for each layer L : L ( L ) hw = ∑ n log ∑ k πkpnhwk ( A ( L−1 ) ) L ( L ) = ∑ hw L ( L ) hw H ( L−1 ) W ( L−1 ) ( 3 ) Training is performed by SGD according to the technique , and with the recommended parameters , presented by Gepperth & Pflb ( 2020 ) , which uses a max-component approximation to L ( L ) . In sampling mode , a control signal T ( L ) is produced by standard GMM sampling , performed separately for all positions h , w . GMM sampling at position h , w first selects a component by drawing from a multinomial distribution . If the GMM layer is the last layer of a DCGMM instance , the multinomial ’ s parameters are the mixing weights π : for each position h , w . Otherwise , the control signal T ( L+1 ) nhw : received from layer L+ 1 is used . It is consistent to use the control signal for component selection in layer L , since it was sampled by layer L+ 1 , which was in turn trained on the component responsibilities of layer L. The selected component ( still at position h , w ) then samples T ( L ) nhw : . It is often beneficial for sampling to restrict component selection to the S components with the highest control signal ( top-S sampling ) .
In this manuscript the authors present a variant of stacked Gaussian mixture models they propose for modeling images called Deep Convolutional Gaussian Mixture Model. This model may contain analogues of convolutional layers and nonlinearities between the stacked Gaussian mixture models. This model can then be trained using stochastic gradient decent on the gradients propagated through the model. Finally the authors show some experimental evaluation on FashionMNIST and MNIST.
SP:9a657957e2dff8496f11c119ee364f0aa2cc1c21
Image Modeling with Deep Convolutional Gaussian Mixture Models
1 INTRODUCTION . This conceptual work is in the context of probabilistic image modeling , whose main objectives are density estimation and image generation ( sampling ) . Since images usually do not precisely follow a Gaussian mixture distribution , such a treatment is inherently approximative in nature . This implies that clustering , even though it is possible and has a long history in the context of Gaussian Mixture Models ( GMMs ) , is not a main objective . Sampling is an active research topic mainly relying on Generative Adverserial Networks ( GANs ) discussed in Section 1.2 . Similar techniques are being investigated for generating videos ( Ghazvinian Zanjani et al. , 2018 ; Piergiovanni & Ryoo , 2019 ) . An issue with GANs is that their probabilistic interpretation remains unclear . This is outlined by the fact that there is no easy-to-compute probabilistic measure of the current fit-to-data that is optimized by GAN training . Recent evidence seems to indicate that GANs may not model the full image distribution as given by training data ( Richardson & Weiss , 2018 ) . Besides , images generated by GANs appear extremely realistic and diverse , and the GAN model has been adapted to perform a wide range of visually impressive functionalities . In contrast , GMMs explicitly describe the distribution p ( X ) , given by a set of training data X = { xn } , as a weighted mixture of K Gaussian component densities N ( x ; µk , Σk ) ≡Nk ( x ) : p ( x ) = ∑K k πkNk ( x ) . GMMs require the mixture weights to be normalized : ∑ k πk = 1 and the covariance matrices to be positive definite : xTΣkx > 0 ∀x . The quality of the current fit-to-data is expressed by the log-likelihood L ( X ) = En [ log ∑ k πkNk ( xn ) ] , ( 1 ) which is what GMM training optimizes , usually by variants of Expectation-Maximization ( EM ) ( Dempster et al. , 1977 ) . It can be shown that arbitrary distributions can , given enough components , be approximated by mixtures of Gaussians ( Goodfellow et al. , 2016 ) . Thus , GMMs are guaranteed to model the complete data distribution , but only to the extent allowed by the number of componentsK . In this respect , GMMs are similar to flat neural networks with a single hidden layer : although , by the universal approximation theorem of Pinkus ( 1999 ) and Hornik et al . ( 1989 ) , they can approximate arbitrary functions ( from certain rather broad function classes ) , they fail to do so in practice . The reason for this is that the number of required hidden layer elements is unknown , and usually beyond the reach of any reasonable computational capacity . For images , this problem was largely solved by introducing deep Convolutional Neural Networks ( CNNs ) . CNNs model the statistical structure of images ( hierarchical organization and translation invariance ) by chaining multiple convolution and pooling layers . Thus the number of parameters without compromising accuracy can be reduced . 1.1 OBJECTIVE , CONTRIBUTION AND NOVELTY . The objectives of this article are to introduce a GMM architecture which exploits the same principles that led to the performance explosion of CNNs . In particular , the genuinely novel characteristics are : • formulation of GMMs as a deep hierarchy , including convolution and pooling layers , • end-to-end training by SGD from random initial conditions ( no k-means initialization ) , • generation of realistic samples by a new sharpening procedure , • better empirical performance than vanilla GMMs for sampling , clustering and outlier detection . In addition , we provide a publicly available TensorFlow implementation which supports a Keras-like flexible construction of Deep Convolutional Gaussian Mixture Models instances . 1.2 RELATED WORK . Generative Adverserial Networks The currently most widely used models of image modeling and generation are Generative Adverserial Networks ( Arjovsky et al. , 2017 ; Mirza & Osindero , 2014 ; Goodfellow et al. , 2014 ) . Variational Autoencoders ( VAEs ) follow the classic autoencoder principle ( Kingma & Welling , 2013 ) , trying to reconstruct their inputs through a bottleneck layer , whose activities are additionally constrained to have a Gaussian distribution . GANs are trained adversarially , mapping Gaussian noise to image instances , while trying to fool an additional discriminator network , which in turn aims to distinguish real from generated samples . They are capable of generating photo-realistic images ( Richardson & Weiss , 2018 ) , although their probabilistic interpretation remains unclear since they do not possess a differentiable loss function that is minimized by training . They may suffer from what is termed mode collapse , which is hard to detect automatically due to the absence of a loss function . Due to their ability to generate realistic images , they are prominently used in models of continual learning ( Shin et al. , 2018 ) . Hierarchical GMMs Mixture of Factor Analyzers ( MFAs ) models ( McLachlan & Peel , 2005 ; Ghahramani & Hinton , 1997 ) can be considered as hierarchical GMMs because they are formulated in terms of a lower-dimensional latent-variable representation , which is mapped to a higherdimensional space . The use of MFAs for describing natural images is discussed in detail in Richardson & Weiss ( 2018 ) , showing that the MFA model alone , without further hierarchical structure , compares quite favorably to GANs when considering image generation . A straightforward hierarchical extension of GMMs is presented by Liu et al . ( 2002 ) with the goal of unsupervised clustering : responsibilities of one GMM are treated as inputs to a subsequent GMM , together with an adaptive mechanism that determines the depth of the hierarchy . Garcia et al . ( 2010 ) present a comparable , more information-theoretic approach . A hierarchy of MFA layers with sampling in mind is presented by Viroli & McLachlan ( 2019 ) , where each layer is sampling values for the latent variables of the previous one , although transformations between layers are exclusively linear . Van Den Oord & Schrauwen ( 2014 ) and ( Tang et al. , 2012 ) pursue a similar approach . All described approaches use ( quite complex ) extensions of the EM algorithm initialized by k-means for training hierarchical GMMs , except Richardson & Weiss ( 2018 ) use Stochastic Gradient Descent ( SGD ) , although with a k-means initialization . None of these models consider convolutional or max-pooling operations which have been proven to be important for modeling the statistical structure of images . Convolutional GMMs The only work we could identify proposing to estimate hierarchical convolutional GMMs is Ghazvinian Zanjani et al . ( 2018 ) , although the article described a hybrid model where a CNN and a GMM are combined . SGD and End-to-End GMM Training Training GMMs by SGD is challenging due to local optima and the need to enforce model constraints , most notably the constraint of positive-definite covariance matrices . This has recently been discussed in Hosseini & Sra ( 2020 ) , although the proposed solution requires parameter initialization by k-means and introduces several new hyper-parameters and is , thus , unlikely to work as-is in a hierarchical structure . An SGD approach that achieves robust convergence even without k-means-based parameter initialization is presented by Gepperth & Pflb ( 2020 ) . Undesirable local optima caused by random parameter initialization are circumvented by an adaptive annealing strategy . 2 DATA . For the evaluation we use the following image data sets : MNIST ( LeCun et al. , 1998 ) is the common benchmark for computer vision systems and classification problems . It consists of 60 000 28× 28 gray scale images of handwritten digits ( 0-9 ) . FashionMNIST ( Xiao et al. , 2017 ) consists of images of clothes in 10 categories and is structured like the MNIST dataset . Although these datasets are not particularly challenging for classification , their dimensionality of 784 is at least one magnitude higher than datasets used for validating other hierarchical GMM approaches in the literature . 3 DCGMM : MODEL OVERVIEW . The Deep Convolutional Gaussian Mixture Model is a hierarchical model consisting of layers in analogy to CNNs.1 Each layer with index L expects an input tensor A ( L−1 ) ∈R4 of dimensions N , H ( L−1 ) , W ( L−1 ) , C ( L−1 ) and produces an output tensor A ( L ) ∈R4 of dimensions N , H ( L ) , W ( L ) , C ( L ) . Layers can have internal variables θ ( L ) that are adapted during SGD training . An DCGMM layer L has two basic operating modes ( see Figure 1 ) : for ( density ) estimation , an input tensor A ( L−1 ) from layer L− 1 is transformed into an output tensor A ( L ) . For sampling , the direction is reversed : each layer receives a control signal T ( L+1 ) from layer L+1 ( same dimensions as A ( L ) ) , which is transformed into a control signal T ( L ) to layer L-1 ( same dimensions as A ( L−1 ) ) . 3.1 LAYER TYPES . We define three layer types : Folding ( F ) , Pooling ( P ) and convolutional GMM ( G ) . Each layer implements distinct operations for each of the two modes , i.e. , estimation and sampling . 1TensorFlow code is available under https : //github.com/iclr2021-dcgmm/dcgmm Folding Layer For density estimation , this layer performs a part of the well-known convolution operation known from CNNs . Based on the filter sizes f ( L ) X , f ( L ) Y as well as the filter strides ∆ ( L ) X , ∆ ( L ) Y , all entries of the input tensor inside the range of the sliding filter window are dumped into the channel dimension of the output tensor . We thus obtain an output tensor of dimensions N , H ( L ) = 1 + H ( L−1 ) −f ( L ) Y ∆ ( L ) Y , W ( L ) = 1 + W ( L−1 ) −f ( L ) X ∆ ( L ) X and C ( L ) =C ( L ) f ( L ) X f ( L ) Y , whose entries are computed as A ( L ) nhwc = A ( L−1 ) nh′w′c′ with h=h ′/f ( L ) Y , w=w′/f ( L ) X and c= c ′+ ( ( h′−h∆ ( L ) Y ) f ( L ) X +w ′−w∆ ( L ) X ) C ( L−1 ) + c′ . When sampling , it performs the inverse mapping which is not a one-to-one correspondence : input tensor elements which receive several contributions are simply averaged over all contributions . Pooling Layer For density estimation , pooling layers perform the same operations as standard ( max- ) pooling layers in CNNs based on the kernel sizes k ( L ) Y , k ( L ) X and strides ∆ ( L ) X , ∆ ( L ) Y . When sampling , pooling layers perform a simple nearest-neighbor up-sampling by a factor indicated by the kernel sizes and strides . GMM Layer This layer type contains K GMM components , each of which is associated with trainable parameters πk , µk and Σk , k = 1 . . .K , representing the GMM weights , centroids and covariances . What makes GMM layers convolutional is that they do not model single input vectors , but the channel content at all positions h , w of the input A ( L−1 ) n , w , h , : , using a shared set of parameters . This is analog to the way a CNN layer models image content at all sliding window positions using the same filters . A GMM layer thus maps the input tensor A ( L−1 ) ∈RN , H ( L−1 ) , W ( L−1 ) , C ( L−1 ) to A ( L ) ∈RN , H ( L−1 ) , W ( L−1 ) , K , each GMM component k ∈ { 0 , . . . , K } contributing the likelihood A ( L ) nhwk of having generated the channel content at position h , w ( for sample n in the mini-batch ) . This likelihood is often referred to as responsibility and is computed as pnhwk ( A ( L−1 ) ) = Nk ( A ( L−1 ) nhw : ; µk , Σk ) A ( L ) nhwk ≡ pnhwk∑ c′ pnhwc′ . ( 2 ) For training the GMM layer , we optimize the GMM log-likelihood L ( L ) for each layer L : L ( L ) hw = ∑ n log ∑ k πkpnhwk ( A ( L−1 ) ) L ( L ) = ∑ hw L ( L ) hw H ( L−1 ) W ( L−1 ) ( 3 ) Training is performed by SGD according to the technique , and with the recommended parameters , presented by Gepperth & Pflb ( 2020 ) , which uses a max-component approximation to L ( L ) . In sampling mode , a control signal T ( L ) is produced by standard GMM sampling , performed separately for all positions h , w . GMM sampling at position h , w first selects a component by drawing from a multinomial distribution . If the GMM layer is the last layer of a DCGMM instance , the multinomial ’ s parameters are the mixing weights π : for each position h , w . Otherwise , the control signal T ( L+1 ) nhw : received from layer L+ 1 is used . It is consistent to use the control signal for component selection in layer L , since it was sampled by layer L+ 1 , which was in turn trained on the component responsibilities of layer L. The selected component ( still at position h , w ) then samples T ( L ) nhw : . It is often beneficial for sampling to restrict component selection to the S components with the highest control signal ( top-S sampling ) .
This paper defines encoding and decoding procedures which use transformations inspired by Gaussian mixture models (GMMs). The decoding procedure further involves "sharpening" steps. A heuristic for training the parameters shared by the encoder and decoder is proposed which optimizes the likelihoods of GMMs defined on various outputs of the encoder. The decoder is evaluated in terms of clustering performance, sample quality, and outlier detection.
SP:9a657957e2dff8496f11c119ee364f0aa2cc1c21
Image Modeling with Deep Convolutional Gaussian Mixture Models
1 INTRODUCTION . This conceptual work is in the context of probabilistic image modeling , whose main objectives are density estimation and image generation ( sampling ) . Since images usually do not precisely follow a Gaussian mixture distribution , such a treatment is inherently approximative in nature . This implies that clustering , even though it is possible and has a long history in the context of Gaussian Mixture Models ( GMMs ) , is not a main objective . Sampling is an active research topic mainly relying on Generative Adverserial Networks ( GANs ) discussed in Section 1.2 . Similar techniques are being investigated for generating videos ( Ghazvinian Zanjani et al. , 2018 ; Piergiovanni & Ryoo , 2019 ) . An issue with GANs is that their probabilistic interpretation remains unclear . This is outlined by the fact that there is no easy-to-compute probabilistic measure of the current fit-to-data that is optimized by GAN training . Recent evidence seems to indicate that GANs may not model the full image distribution as given by training data ( Richardson & Weiss , 2018 ) . Besides , images generated by GANs appear extremely realistic and diverse , and the GAN model has been adapted to perform a wide range of visually impressive functionalities . In contrast , GMMs explicitly describe the distribution p ( X ) , given by a set of training data X = { xn } , as a weighted mixture of K Gaussian component densities N ( x ; µk , Σk ) ≡Nk ( x ) : p ( x ) = ∑K k πkNk ( x ) . GMMs require the mixture weights to be normalized : ∑ k πk = 1 and the covariance matrices to be positive definite : xTΣkx > 0 ∀x . The quality of the current fit-to-data is expressed by the log-likelihood L ( X ) = En [ log ∑ k πkNk ( xn ) ] , ( 1 ) which is what GMM training optimizes , usually by variants of Expectation-Maximization ( EM ) ( Dempster et al. , 1977 ) . It can be shown that arbitrary distributions can , given enough components , be approximated by mixtures of Gaussians ( Goodfellow et al. , 2016 ) . Thus , GMMs are guaranteed to model the complete data distribution , but only to the extent allowed by the number of componentsK . In this respect , GMMs are similar to flat neural networks with a single hidden layer : although , by the universal approximation theorem of Pinkus ( 1999 ) and Hornik et al . ( 1989 ) , they can approximate arbitrary functions ( from certain rather broad function classes ) , they fail to do so in practice . The reason for this is that the number of required hidden layer elements is unknown , and usually beyond the reach of any reasonable computational capacity . For images , this problem was largely solved by introducing deep Convolutional Neural Networks ( CNNs ) . CNNs model the statistical structure of images ( hierarchical organization and translation invariance ) by chaining multiple convolution and pooling layers . Thus the number of parameters without compromising accuracy can be reduced . 1.1 OBJECTIVE , CONTRIBUTION AND NOVELTY . The objectives of this article are to introduce a GMM architecture which exploits the same principles that led to the performance explosion of CNNs . In particular , the genuinely novel characteristics are : • formulation of GMMs as a deep hierarchy , including convolution and pooling layers , • end-to-end training by SGD from random initial conditions ( no k-means initialization ) , • generation of realistic samples by a new sharpening procedure , • better empirical performance than vanilla GMMs for sampling , clustering and outlier detection . In addition , we provide a publicly available TensorFlow implementation which supports a Keras-like flexible construction of Deep Convolutional Gaussian Mixture Models instances . 1.2 RELATED WORK . Generative Adverserial Networks The currently most widely used models of image modeling and generation are Generative Adverserial Networks ( Arjovsky et al. , 2017 ; Mirza & Osindero , 2014 ; Goodfellow et al. , 2014 ) . Variational Autoencoders ( VAEs ) follow the classic autoencoder principle ( Kingma & Welling , 2013 ) , trying to reconstruct their inputs through a bottleneck layer , whose activities are additionally constrained to have a Gaussian distribution . GANs are trained adversarially , mapping Gaussian noise to image instances , while trying to fool an additional discriminator network , which in turn aims to distinguish real from generated samples . They are capable of generating photo-realistic images ( Richardson & Weiss , 2018 ) , although their probabilistic interpretation remains unclear since they do not possess a differentiable loss function that is minimized by training . They may suffer from what is termed mode collapse , which is hard to detect automatically due to the absence of a loss function . Due to their ability to generate realistic images , they are prominently used in models of continual learning ( Shin et al. , 2018 ) . Hierarchical GMMs Mixture of Factor Analyzers ( MFAs ) models ( McLachlan & Peel , 2005 ; Ghahramani & Hinton , 1997 ) can be considered as hierarchical GMMs because they are formulated in terms of a lower-dimensional latent-variable representation , which is mapped to a higherdimensional space . The use of MFAs for describing natural images is discussed in detail in Richardson & Weiss ( 2018 ) , showing that the MFA model alone , without further hierarchical structure , compares quite favorably to GANs when considering image generation . A straightforward hierarchical extension of GMMs is presented by Liu et al . ( 2002 ) with the goal of unsupervised clustering : responsibilities of one GMM are treated as inputs to a subsequent GMM , together with an adaptive mechanism that determines the depth of the hierarchy . Garcia et al . ( 2010 ) present a comparable , more information-theoretic approach . A hierarchy of MFA layers with sampling in mind is presented by Viroli & McLachlan ( 2019 ) , where each layer is sampling values for the latent variables of the previous one , although transformations between layers are exclusively linear . Van Den Oord & Schrauwen ( 2014 ) and ( Tang et al. , 2012 ) pursue a similar approach . All described approaches use ( quite complex ) extensions of the EM algorithm initialized by k-means for training hierarchical GMMs , except Richardson & Weiss ( 2018 ) use Stochastic Gradient Descent ( SGD ) , although with a k-means initialization . None of these models consider convolutional or max-pooling operations which have been proven to be important for modeling the statistical structure of images . Convolutional GMMs The only work we could identify proposing to estimate hierarchical convolutional GMMs is Ghazvinian Zanjani et al . ( 2018 ) , although the article described a hybrid model where a CNN and a GMM are combined . SGD and End-to-End GMM Training Training GMMs by SGD is challenging due to local optima and the need to enforce model constraints , most notably the constraint of positive-definite covariance matrices . This has recently been discussed in Hosseini & Sra ( 2020 ) , although the proposed solution requires parameter initialization by k-means and introduces several new hyper-parameters and is , thus , unlikely to work as-is in a hierarchical structure . An SGD approach that achieves robust convergence even without k-means-based parameter initialization is presented by Gepperth & Pflb ( 2020 ) . Undesirable local optima caused by random parameter initialization are circumvented by an adaptive annealing strategy . 2 DATA . For the evaluation we use the following image data sets : MNIST ( LeCun et al. , 1998 ) is the common benchmark for computer vision systems and classification problems . It consists of 60 000 28× 28 gray scale images of handwritten digits ( 0-9 ) . FashionMNIST ( Xiao et al. , 2017 ) consists of images of clothes in 10 categories and is structured like the MNIST dataset . Although these datasets are not particularly challenging for classification , their dimensionality of 784 is at least one magnitude higher than datasets used for validating other hierarchical GMM approaches in the literature . 3 DCGMM : MODEL OVERVIEW . The Deep Convolutional Gaussian Mixture Model is a hierarchical model consisting of layers in analogy to CNNs.1 Each layer with index L expects an input tensor A ( L−1 ) ∈R4 of dimensions N , H ( L−1 ) , W ( L−1 ) , C ( L−1 ) and produces an output tensor A ( L ) ∈R4 of dimensions N , H ( L ) , W ( L ) , C ( L ) . Layers can have internal variables θ ( L ) that are adapted during SGD training . An DCGMM layer L has two basic operating modes ( see Figure 1 ) : for ( density ) estimation , an input tensor A ( L−1 ) from layer L− 1 is transformed into an output tensor A ( L ) . For sampling , the direction is reversed : each layer receives a control signal T ( L+1 ) from layer L+1 ( same dimensions as A ( L ) ) , which is transformed into a control signal T ( L ) to layer L-1 ( same dimensions as A ( L−1 ) ) . 3.1 LAYER TYPES . We define three layer types : Folding ( F ) , Pooling ( P ) and convolutional GMM ( G ) . Each layer implements distinct operations for each of the two modes , i.e. , estimation and sampling . 1TensorFlow code is available under https : //github.com/iclr2021-dcgmm/dcgmm Folding Layer For density estimation , this layer performs a part of the well-known convolution operation known from CNNs . Based on the filter sizes f ( L ) X , f ( L ) Y as well as the filter strides ∆ ( L ) X , ∆ ( L ) Y , all entries of the input tensor inside the range of the sliding filter window are dumped into the channel dimension of the output tensor . We thus obtain an output tensor of dimensions N , H ( L ) = 1 + H ( L−1 ) −f ( L ) Y ∆ ( L ) Y , W ( L ) = 1 + W ( L−1 ) −f ( L ) X ∆ ( L ) X and C ( L ) =C ( L ) f ( L ) X f ( L ) Y , whose entries are computed as A ( L ) nhwc = A ( L−1 ) nh′w′c′ with h=h ′/f ( L ) Y , w=w′/f ( L ) X and c= c ′+ ( ( h′−h∆ ( L ) Y ) f ( L ) X +w ′−w∆ ( L ) X ) C ( L−1 ) + c′ . When sampling , it performs the inverse mapping which is not a one-to-one correspondence : input tensor elements which receive several contributions are simply averaged over all contributions . Pooling Layer For density estimation , pooling layers perform the same operations as standard ( max- ) pooling layers in CNNs based on the kernel sizes k ( L ) Y , k ( L ) X and strides ∆ ( L ) X , ∆ ( L ) Y . When sampling , pooling layers perform a simple nearest-neighbor up-sampling by a factor indicated by the kernel sizes and strides . GMM Layer This layer type contains K GMM components , each of which is associated with trainable parameters πk , µk and Σk , k = 1 . . .K , representing the GMM weights , centroids and covariances . What makes GMM layers convolutional is that they do not model single input vectors , but the channel content at all positions h , w of the input A ( L−1 ) n , w , h , : , using a shared set of parameters . This is analog to the way a CNN layer models image content at all sliding window positions using the same filters . A GMM layer thus maps the input tensor A ( L−1 ) ∈RN , H ( L−1 ) , W ( L−1 ) , C ( L−1 ) to A ( L ) ∈RN , H ( L−1 ) , W ( L−1 ) , K , each GMM component k ∈ { 0 , . . . , K } contributing the likelihood A ( L ) nhwk of having generated the channel content at position h , w ( for sample n in the mini-batch ) . This likelihood is often referred to as responsibility and is computed as pnhwk ( A ( L−1 ) ) = Nk ( A ( L−1 ) nhw : ; µk , Σk ) A ( L ) nhwk ≡ pnhwk∑ c′ pnhwc′ . ( 2 ) For training the GMM layer , we optimize the GMM log-likelihood L ( L ) for each layer L : L ( L ) hw = ∑ n log ∑ k πkpnhwk ( A ( L−1 ) ) L ( L ) = ∑ hw L ( L ) hw H ( L−1 ) W ( L−1 ) ( 3 ) Training is performed by SGD according to the technique , and with the recommended parameters , presented by Gepperth & Pflb ( 2020 ) , which uses a max-component approximation to L ( L ) . In sampling mode , a control signal T ( L ) is produced by standard GMM sampling , performed separately for all positions h , w . GMM sampling at position h , w first selects a component by drawing from a multinomial distribution . If the GMM layer is the last layer of a DCGMM instance , the multinomial ’ s parameters are the mixing weights π : for each position h , w . Otherwise , the control signal T ( L+1 ) nhw : received from layer L+ 1 is used . It is consistent to use the control signal for component selection in layer L , since it was sampled by layer L+ 1 , which was in turn trained on the component responsibilities of layer L. The selected component ( still at position h , w ) then samples T ( L ) nhw : . It is often beneficial for sampling to restrict component selection to the S components with the highest control signal ( top-S sampling ) .
The paper proposes a model that combines hierarchical Gaussian Mixture Models with a convolutional architecture, supporting both estimation and sampling. The model is trained end-to-end via SGD and is composed of 3 types of layers: standard convolutional and max-pooling layers and a newly proposed GMM layer. The latter operates by modeling the stack of channels at each spatial location as vectors sampled from a GMM. The outputs of the layer are the component probabilities at each location, followed by channel-wise normalization. The loss function is the average log-likelihood of every location at every GMM layer. The paper argues for using it as an alternative to other, less interpretable, probabilistic models of images and demonstrates its capacity to model the MNIST and FashionMNIST datasets.
SP:9a657957e2dff8496f11c119ee364f0aa2cc1c21
World Model as a Graph: Learning Latent Landmarks for Planning
1 INTRODUCTION . An intelligent agent should be able to solve difficult problems by breaking them down into sequences of simpler problems . Classically , planning algorithms have been the tool of choice for endowing AI agents with the ability to reason over complex long-horizon problems ( Doran & Michie , 1966 ; Hart et al. , 1968 ) . Recent years have seen an uptick in monographs examining the intersection of classical planning techniques – which excel at temporal abstraction – with deep reinforcement learning ( RL ) algorithms – which excel at state abstraction . Perhaps the ripest fruit born of this relationship is the AlphaGo algorithm , wherein a model free policy is combined with a MCTS ( Coulom , 2006 ) planning algorithm to achieve superhuman performance on the game of Go ( Silver et al. , 2016a ) . In the field of robotics , progress on combining planning and reinforcement learning has been somewhat less rapid , although still resolute . Indeed , the laws of physics in the real world are infinitely more complex than the simple rules of Go . Unlike board games such as chess and Go , which have deterministic and known dynamics and discrete action space , robots have to deal with a probabilistic and unpredictable world , and the action space for robots is oftentimes continuous . As a result , planning in robotics presents a much harder problem . One general class of methods ( Sutton , 1991 ) seeks to combine model-based planning and deep RL . These methods can be thought of as an extension of model-predictive control ( MPC ) algorithms , with the key difference being that the agent is trained over hypothetical experience in addition to the actually collected experience . The primary shortcoming of this class of methods is that , like MCTS in AlphaGo , they resort to planning with action sequences – forcing the robot to plan for each action at every hundred milliseconds . Planning on the level of action sequences is fundamentally bottlenecked by the accuracy of the learned dynamics model and the horizon of a task , as the learned world model quickly diverges over a long horizon . This limitation shows that world models in the traditional Model-based RL ( MBRL ) setting often fail to deliver the promise of planning . Another general class of methods , Hierarchical RL ( HRL ) , introduces a higher-level learner to address the problem of planning ( Dayan & Hinton , 1993 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018 ) . In this scenario , a goal-based RL agent serves as the worker , and a manager learns what sequences of goals it must set for the worker to achieve a complex task . While this is apparently a sound solution to the problem of planning , hierarchical learners neither explicitly learn a higher-level model of the world nor take advantage of the graph structure inherent to the problem of search . To better combine classical planning and reinforcement learning , we propose to learn graph-structured world models composed of sparse multi-step transitions . To model the world as a graph , we borrow a concept from the navigation literature – the idea of landmarks ( Wang et al. , 2008 ) . Landmarks are essentially states that an agent can navigate between in order to complete tasks . However , rather than simply using previously seen states as landmarks , as is traditionally done , we will instead develop a novel algorithm to learn the landmarks used for planning . Our key insight is that by mapping previously achieved goals into a latent space that captures the temporal distance between goals , we can perform clustering in the latent space to group together goals that are easily reachable from one another . Subsequently , we can then decode the latent centroids to obtain a set of goals scattered ( in terms of reachability ) across the goal space . Since our learned landmarks are obtained from latent clustering , we call them latent landmarks . The chief algorithmic contribution of this paper is a new method for planning over learned latent landmarks for high-dimensional continuous control domains , which we name Learning Latent Landmarks for Planning ( L3P ) . The idea of reducing planning in RL to a graph search problem has enjoyed some attention recently ( Savinov et al. , 2018a ; Eysenbach et al. , 2019 ; Huang et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2020 ; Laskin et al. , 2020 ) . A key difference between those works and L3P is that our use of latent landmarks allows us to substantially reduce the size of the search space . What ’ s more , we make improvements to the graph search module and the online planning algorithm to improve the robustness and sample efficiency of our method . As a result of those decisions , our algorithm is able to achieve superior performance on a variety of robotics domains involving both navigation and manipulation . In addition to the results presented in Section 5 , videos of our algorithm ’ s performance , and an analysis of the sub-tasks discovered by the latent landmarks , may be found at https : //sites.google.com/view/latent-landmarks/ . 2 RELATED WORKS . The problem of learning landmarks to aid in robotics problems has a long and rich history ( Gillner & Mallot , 1998 ; Wang & Spelke , 2002 ; Wang et al. , 2008 ) . Prior art has been deeply rooted in the classical planning literature . For example , traditional methods would utilize Dijkstra et al . ( 1959 ) to plan over generated waypoints , SLAM ( Durrant-Whyte & Bailey , 2006 ) to simultaneously integrate mapping , or the RRT algorithm ( LaValle , 1998 ) for explicit path planning . The A * algorithm ( Hart et al. , 1968 ) further improved the computational efficiency of Dijkstra . Those types of methods often heavily rely on a hand-crafted configuration space that provides prior knowledge . Planning is intimately related to model-based RL ( MBRL ) , as the core ideas underlying learned models and planners can enjoy considerable overlap . Perhaps the most clear instance of this overlap is Model Predictive Control ( MPC ) , and the related Dyna algorithm ( Sutton , 1991 ) . When combined with modern techniques ( Kurutach et al. , 2018 ; Luo et al. , 2018 ; Nagabandi et al. , 2018 ; Ha & Schmidhuber , 2018 ; Hafner et al. , 2019 ; Wang & Ba , 2019 ; Janner et al. , 2019 ) , MBRL is able to achieve some level of success . Corneil et al . ( 2018 ) and Hafner et al . ( 2020 ) also learn a discrete latent representation of the environment in the MBRL framework . As discussed in the introduction , planning on action sequences will fundamentally struggle to scale in robotics . Our method will make extensive use of a parametric goal-based RL agent to accomplish low-level navigation between states . This area has seen rapid progress recently , largely stemming from the success of Hindsight Experience Replay ( HER ) ( Andrychowicz et al. , 2017 ) . Several improvements to HER augment the goal relabeling and sampling strategies to improve performance ( Nair et al. , 2018 ; Pong et al. , 2018 ; 2019 ; Zhao et al. , 2019 ; Pitis et al. , 2020 ) . There have also been attempts at incorporating search as inductive biases within the value function ( Silver et al. , 2016b ; Tamar et al. , 2016 ; Farquhar et al. , 2017 ; Racanière et al. , 2017 ; Lee et al. , 2018 ; Srinivas et al. , 2018 ) . The focus of this line of work is to improve the low-level policy and is thus orthogonal to our work . Recent work in Hierarchical RL ( HRL ) builds upon goal-based RL by learning a high-level parametric manager that feeds goals to the low-level goal-based agent ( Dayan & Hinton , 1993 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018 ) . This can be viewed as a parametric alternative to classical planning , as discussed in the introduction . Recently , Jurgenson et al . ( 2020 ) ; Pertsch et al . ( 2020 ) have derived HRL methods that are intimately tied to tree search algorithms . These papers are further connected to a recent trend in the literature wherein classical search methods are combined with parametric control ( Savinov et al. , 2018a ; Eysenbach et al. , 2019 ; Huang et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2020 ; Laskin et al. , 2020 ) . Several of these articles will be discussed throughout this paper . LEAP ( Nasiriany et al. , 2019 ) also considers the problem of proposing sub-goals for a goal-conditioned agent : it uses a VAE ( Kingma & Welling , 2013 ) and does CEM on the prior distribution to form the landmarks . Our method constrains the latent space with temporal reachability between goals , a concept previously explored in Savinov et al . ( 2018b ) , and uses latent clustering and graph search rather than sampling-based methods to learn and propose sub-goals . 3 BACKGROUND . We consider the problem of Multi-Goal RL under a Markov Decision Process ( MDP ) that is parameterized by ( S , A , P , G , Ψ , R , ρ0 ) . S and A are the state and action space . The probability distribution of the initial states is given by ρ0 ( s ) , andP ( s′|s , a ) is the transition probability . Ψ : S 7→ G is a mapping from the state space to the goal space , which assumes that every state s can be mapped to a corresponding achieved goal g. The reward function R can be defined as R ( s , a , s′ , g ) = −1 { Ψ ( s′ ) 6= g } . We further assume that each episode has a fixed horizon T . The goal-conditioned policy is a probability distribution π : S ×G× A→ R+ . The policy gives rise to trajectory samples of the form τ = { s0 , a0 , g , s1 , · · · sT } . The purpose of the policy π is to learn how to reach the goals drawn from the goal distribution pg , which means maximizing the cumulative rewards . Together with a discount factor γ ∈ ( 0 , 1 ) , the objective is to maximize J ( π ) = Eg∼pg , τ∼π ( g ) [ ∑T−1 t=0 γ t · R ( st , at , st+1 , g ) ] . Q-learning provides a sample-efficient way to optimize the above objective by utilizing off-policy data stored in a replay buffer B. Q ( s , a , g ) estimates the reward-to-go under the current policy π conditioned upon the given goal . An additional technique , called Hindsight Experience Replay , or HER ( Andrychowicz et al. , 2017 ) , uses hindsight relabelling to drastically speed up training . This relabeling crucially relies upon the mapping Ψ : S 7→ G in the multi-goal MDP setting . We can write the the joint objective of multi-goal Q-learning with HER as minimizing : min Q E τ∼B , t∼ { 0···T−1 } ( st , at , st+1 ) ∼τ k∼ { t+1···T } , g=Ψ ( sk ) a′∼π ( ·|st+1 , g ) ( Q ( st , at , g ) − ( R ( st , at , st+1 , g ) + γ ·Q ( st+1 , a′ , g ) ) ) 2 ( 1 ) 4 THE L3P ALGORITHM Our overall objective in this section is to derive an algorithm that learns a small number of landmarks scattered across goal space in terms of reachability and use those learned landmarks for planning . There are three chief difficulties we must overcome when considering such an algorithm . First , how can we group together goals that are easily reachable from one another ? The answer is to embed goals into a latent space , where the latent representation captures some notion of temporal distance between goals – in the sense that goals that would take many timesteps to navigate between are further apart in latent space . Second , we need to find a way to learn a sparse set of landmarks used for planning . Our method performs clustering on the constrained latent space , and decodes the learned centroids as the landmarks we seek . Finally , we need to develop a non-parametric planning algorithm responsible for selecting sequences of landmarks the agent must traverse to accomplish its high-level goal . The proposed online planning algorithm is simple , scalable , and robust .
This paper approaches long horizon planning by learning a sparse graphical representation. The proposed algorithm, L3P, proceeds by learning a latent space which enforces a distance measure, where this distance is learned to mimic the number of steps between states via a goal conditioned Q-function. A clustering algorithm is then used to represent this latent space through only a small, efficient set of latent landmarks. These landmarks are then connected if nearby via the distance, the estimate of which is refined via soft value iterations over the graph. L3P is demonstrated on a number of environments to be both data efficient and high performing compared to baselines.
SP:fc6a56751f44bda7afbc532fa41167fce6ac286d
World Model as a Graph: Learning Latent Landmarks for Planning
1 INTRODUCTION . An intelligent agent should be able to solve difficult problems by breaking them down into sequences of simpler problems . Classically , planning algorithms have been the tool of choice for endowing AI agents with the ability to reason over complex long-horizon problems ( Doran & Michie , 1966 ; Hart et al. , 1968 ) . Recent years have seen an uptick in monographs examining the intersection of classical planning techniques – which excel at temporal abstraction – with deep reinforcement learning ( RL ) algorithms – which excel at state abstraction . Perhaps the ripest fruit born of this relationship is the AlphaGo algorithm , wherein a model free policy is combined with a MCTS ( Coulom , 2006 ) planning algorithm to achieve superhuman performance on the game of Go ( Silver et al. , 2016a ) . In the field of robotics , progress on combining planning and reinforcement learning has been somewhat less rapid , although still resolute . Indeed , the laws of physics in the real world are infinitely more complex than the simple rules of Go . Unlike board games such as chess and Go , which have deterministic and known dynamics and discrete action space , robots have to deal with a probabilistic and unpredictable world , and the action space for robots is oftentimes continuous . As a result , planning in robotics presents a much harder problem . One general class of methods ( Sutton , 1991 ) seeks to combine model-based planning and deep RL . These methods can be thought of as an extension of model-predictive control ( MPC ) algorithms , with the key difference being that the agent is trained over hypothetical experience in addition to the actually collected experience . The primary shortcoming of this class of methods is that , like MCTS in AlphaGo , they resort to planning with action sequences – forcing the robot to plan for each action at every hundred milliseconds . Planning on the level of action sequences is fundamentally bottlenecked by the accuracy of the learned dynamics model and the horizon of a task , as the learned world model quickly diverges over a long horizon . This limitation shows that world models in the traditional Model-based RL ( MBRL ) setting often fail to deliver the promise of planning . Another general class of methods , Hierarchical RL ( HRL ) , introduces a higher-level learner to address the problem of planning ( Dayan & Hinton , 1993 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018 ) . In this scenario , a goal-based RL agent serves as the worker , and a manager learns what sequences of goals it must set for the worker to achieve a complex task . While this is apparently a sound solution to the problem of planning , hierarchical learners neither explicitly learn a higher-level model of the world nor take advantage of the graph structure inherent to the problem of search . To better combine classical planning and reinforcement learning , we propose to learn graph-structured world models composed of sparse multi-step transitions . To model the world as a graph , we borrow a concept from the navigation literature – the idea of landmarks ( Wang et al. , 2008 ) . Landmarks are essentially states that an agent can navigate between in order to complete tasks . However , rather than simply using previously seen states as landmarks , as is traditionally done , we will instead develop a novel algorithm to learn the landmarks used for planning . Our key insight is that by mapping previously achieved goals into a latent space that captures the temporal distance between goals , we can perform clustering in the latent space to group together goals that are easily reachable from one another . Subsequently , we can then decode the latent centroids to obtain a set of goals scattered ( in terms of reachability ) across the goal space . Since our learned landmarks are obtained from latent clustering , we call them latent landmarks . The chief algorithmic contribution of this paper is a new method for planning over learned latent landmarks for high-dimensional continuous control domains , which we name Learning Latent Landmarks for Planning ( L3P ) . The idea of reducing planning in RL to a graph search problem has enjoyed some attention recently ( Savinov et al. , 2018a ; Eysenbach et al. , 2019 ; Huang et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2020 ; Laskin et al. , 2020 ) . A key difference between those works and L3P is that our use of latent landmarks allows us to substantially reduce the size of the search space . What ’ s more , we make improvements to the graph search module and the online planning algorithm to improve the robustness and sample efficiency of our method . As a result of those decisions , our algorithm is able to achieve superior performance on a variety of robotics domains involving both navigation and manipulation . In addition to the results presented in Section 5 , videos of our algorithm ’ s performance , and an analysis of the sub-tasks discovered by the latent landmarks , may be found at https : //sites.google.com/view/latent-landmarks/ . 2 RELATED WORKS . The problem of learning landmarks to aid in robotics problems has a long and rich history ( Gillner & Mallot , 1998 ; Wang & Spelke , 2002 ; Wang et al. , 2008 ) . Prior art has been deeply rooted in the classical planning literature . For example , traditional methods would utilize Dijkstra et al . ( 1959 ) to plan over generated waypoints , SLAM ( Durrant-Whyte & Bailey , 2006 ) to simultaneously integrate mapping , or the RRT algorithm ( LaValle , 1998 ) for explicit path planning . The A * algorithm ( Hart et al. , 1968 ) further improved the computational efficiency of Dijkstra . Those types of methods often heavily rely on a hand-crafted configuration space that provides prior knowledge . Planning is intimately related to model-based RL ( MBRL ) , as the core ideas underlying learned models and planners can enjoy considerable overlap . Perhaps the most clear instance of this overlap is Model Predictive Control ( MPC ) , and the related Dyna algorithm ( Sutton , 1991 ) . When combined with modern techniques ( Kurutach et al. , 2018 ; Luo et al. , 2018 ; Nagabandi et al. , 2018 ; Ha & Schmidhuber , 2018 ; Hafner et al. , 2019 ; Wang & Ba , 2019 ; Janner et al. , 2019 ) , MBRL is able to achieve some level of success . Corneil et al . ( 2018 ) and Hafner et al . ( 2020 ) also learn a discrete latent representation of the environment in the MBRL framework . As discussed in the introduction , planning on action sequences will fundamentally struggle to scale in robotics . Our method will make extensive use of a parametric goal-based RL agent to accomplish low-level navigation between states . This area has seen rapid progress recently , largely stemming from the success of Hindsight Experience Replay ( HER ) ( Andrychowicz et al. , 2017 ) . Several improvements to HER augment the goal relabeling and sampling strategies to improve performance ( Nair et al. , 2018 ; Pong et al. , 2018 ; 2019 ; Zhao et al. , 2019 ; Pitis et al. , 2020 ) . There have also been attempts at incorporating search as inductive biases within the value function ( Silver et al. , 2016b ; Tamar et al. , 2016 ; Farquhar et al. , 2017 ; Racanière et al. , 2017 ; Lee et al. , 2018 ; Srinivas et al. , 2018 ) . The focus of this line of work is to improve the low-level policy and is thus orthogonal to our work . Recent work in Hierarchical RL ( HRL ) builds upon goal-based RL by learning a high-level parametric manager that feeds goals to the low-level goal-based agent ( Dayan & Hinton , 1993 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018 ) . This can be viewed as a parametric alternative to classical planning , as discussed in the introduction . Recently , Jurgenson et al . ( 2020 ) ; Pertsch et al . ( 2020 ) have derived HRL methods that are intimately tied to tree search algorithms . These papers are further connected to a recent trend in the literature wherein classical search methods are combined with parametric control ( Savinov et al. , 2018a ; Eysenbach et al. , 2019 ; Huang et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2020 ; Laskin et al. , 2020 ) . Several of these articles will be discussed throughout this paper . LEAP ( Nasiriany et al. , 2019 ) also considers the problem of proposing sub-goals for a goal-conditioned agent : it uses a VAE ( Kingma & Welling , 2013 ) and does CEM on the prior distribution to form the landmarks . Our method constrains the latent space with temporal reachability between goals , a concept previously explored in Savinov et al . ( 2018b ) , and uses latent clustering and graph search rather than sampling-based methods to learn and propose sub-goals . 3 BACKGROUND . We consider the problem of Multi-Goal RL under a Markov Decision Process ( MDP ) that is parameterized by ( S , A , P , G , Ψ , R , ρ0 ) . S and A are the state and action space . The probability distribution of the initial states is given by ρ0 ( s ) , andP ( s′|s , a ) is the transition probability . Ψ : S 7→ G is a mapping from the state space to the goal space , which assumes that every state s can be mapped to a corresponding achieved goal g. The reward function R can be defined as R ( s , a , s′ , g ) = −1 { Ψ ( s′ ) 6= g } . We further assume that each episode has a fixed horizon T . The goal-conditioned policy is a probability distribution π : S ×G× A→ R+ . The policy gives rise to trajectory samples of the form τ = { s0 , a0 , g , s1 , · · · sT } . The purpose of the policy π is to learn how to reach the goals drawn from the goal distribution pg , which means maximizing the cumulative rewards . Together with a discount factor γ ∈ ( 0 , 1 ) , the objective is to maximize J ( π ) = Eg∼pg , τ∼π ( g ) [ ∑T−1 t=0 γ t · R ( st , at , st+1 , g ) ] . Q-learning provides a sample-efficient way to optimize the above objective by utilizing off-policy data stored in a replay buffer B. Q ( s , a , g ) estimates the reward-to-go under the current policy π conditioned upon the given goal . An additional technique , called Hindsight Experience Replay , or HER ( Andrychowicz et al. , 2017 ) , uses hindsight relabelling to drastically speed up training . This relabeling crucially relies upon the mapping Ψ : S 7→ G in the multi-goal MDP setting . We can write the the joint objective of multi-goal Q-learning with HER as minimizing : min Q E τ∼B , t∼ { 0···T−1 } ( st , at , st+1 ) ∼τ k∼ { t+1···T } , g=Ψ ( sk ) a′∼π ( ·|st+1 , g ) ( Q ( st , at , g ) − ( R ( st , at , st+1 , g ) + γ ·Q ( st+1 , a′ , g ) ) ) 2 ( 1 ) 4 THE L3P ALGORITHM Our overall objective in this section is to derive an algorithm that learns a small number of landmarks scattered across goal space in terms of reachability and use those learned landmarks for planning . There are three chief difficulties we must overcome when considering such an algorithm . First , how can we group together goals that are easily reachable from one another ? The answer is to embed goals into a latent space , where the latent representation captures some notion of temporal distance between goals – in the sense that goals that would take many timesteps to navigate between are further apart in latent space . Second , we need to find a way to learn a sparse set of landmarks used for planning . Our method performs clustering on the constrained latent space , and decodes the learned centroids as the landmarks we seek . Finally , we need to develop a non-parametric planning algorithm responsible for selecting sequences of landmarks the agent must traverse to accomplish its high-level goal . The proposed online planning algorithm is simple , scalable , and robust .
This paper presents a method for learning a sparse set of latent subgoal states during training. Using a goal-conditioned policy and the latent states, a simple planning algorithm that performs soft value iteration between the subgoal states is proposed to facilitate within-dataset generalization. The proposed method outperforms competing approaches on multiple simulated navigation and robotics tasks.
SP:fc6a56751f44bda7afbc532fa41167fce6ac286d
World Model as a Graph: Learning Latent Landmarks for Planning
1 INTRODUCTION . An intelligent agent should be able to solve difficult problems by breaking them down into sequences of simpler problems . Classically , planning algorithms have been the tool of choice for endowing AI agents with the ability to reason over complex long-horizon problems ( Doran & Michie , 1966 ; Hart et al. , 1968 ) . Recent years have seen an uptick in monographs examining the intersection of classical planning techniques – which excel at temporal abstraction – with deep reinforcement learning ( RL ) algorithms – which excel at state abstraction . Perhaps the ripest fruit born of this relationship is the AlphaGo algorithm , wherein a model free policy is combined with a MCTS ( Coulom , 2006 ) planning algorithm to achieve superhuman performance on the game of Go ( Silver et al. , 2016a ) . In the field of robotics , progress on combining planning and reinforcement learning has been somewhat less rapid , although still resolute . Indeed , the laws of physics in the real world are infinitely more complex than the simple rules of Go . Unlike board games such as chess and Go , which have deterministic and known dynamics and discrete action space , robots have to deal with a probabilistic and unpredictable world , and the action space for robots is oftentimes continuous . As a result , planning in robotics presents a much harder problem . One general class of methods ( Sutton , 1991 ) seeks to combine model-based planning and deep RL . These methods can be thought of as an extension of model-predictive control ( MPC ) algorithms , with the key difference being that the agent is trained over hypothetical experience in addition to the actually collected experience . The primary shortcoming of this class of methods is that , like MCTS in AlphaGo , they resort to planning with action sequences – forcing the robot to plan for each action at every hundred milliseconds . Planning on the level of action sequences is fundamentally bottlenecked by the accuracy of the learned dynamics model and the horizon of a task , as the learned world model quickly diverges over a long horizon . This limitation shows that world models in the traditional Model-based RL ( MBRL ) setting often fail to deliver the promise of planning . Another general class of methods , Hierarchical RL ( HRL ) , introduces a higher-level learner to address the problem of planning ( Dayan & Hinton , 1993 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018 ) . In this scenario , a goal-based RL agent serves as the worker , and a manager learns what sequences of goals it must set for the worker to achieve a complex task . While this is apparently a sound solution to the problem of planning , hierarchical learners neither explicitly learn a higher-level model of the world nor take advantage of the graph structure inherent to the problem of search . To better combine classical planning and reinforcement learning , we propose to learn graph-structured world models composed of sparse multi-step transitions . To model the world as a graph , we borrow a concept from the navigation literature – the idea of landmarks ( Wang et al. , 2008 ) . Landmarks are essentially states that an agent can navigate between in order to complete tasks . However , rather than simply using previously seen states as landmarks , as is traditionally done , we will instead develop a novel algorithm to learn the landmarks used for planning . Our key insight is that by mapping previously achieved goals into a latent space that captures the temporal distance between goals , we can perform clustering in the latent space to group together goals that are easily reachable from one another . Subsequently , we can then decode the latent centroids to obtain a set of goals scattered ( in terms of reachability ) across the goal space . Since our learned landmarks are obtained from latent clustering , we call them latent landmarks . The chief algorithmic contribution of this paper is a new method for planning over learned latent landmarks for high-dimensional continuous control domains , which we name Learning Latent Landmarks for Planning ( L3P ) . The idea of reducing planning in RL to a graph search problem has enjoyed some attention recently ( Savinov et al. , 2018a ; Eysenbach et al. , 2019 ; Huang et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2020 ; Laskin et al. , 2020 ) . A key difference between those works and L3P is that our use of latent landmarks allows us to substantially reduce the size of the search space . What ’ s more , we make improvements to the graph search module and the online planning algorithm to improve the robustness and sample efficiency of our method . As a result of those decisions , our algorithm is able to achieve superior performance on a variety of robotics domains involving both navigation and manipulation . In addition to the results presented in Section 5 , videos of our algorithm ’ s performance , and an analysis of the sub-tasks discovered by the latent landmarks , may be found at https : //sites.google.com/view/latent-landmarks/ . 2 RELATED WORKS . The problem of learning landmarks to aid in robotics problems has a long and rich history ( Gillner & Mallot , 1998 ; Wang & Spelke , 2002 ; Wang et al. , 2008 ) . Prior art has been deeply rooted in the classical planning literature . For example , traditional methods would utilize Dijkstra et al . ( 1959 ) to plan over generated waypoints , SLAM ( Durrant-Whyte & Bailey , 2006 ) to simultaneously integrate mapping , or the RRT algorithm ( LaValle , 1998 ) for explicit path planning . The A * algorithm ( Hart et al. , 1968 ) further improved the computational efficiency of Dijkstra . Those types of methods often heavily rely on a hand-crafted configuration space that provides prior knowledge . Planning is intimately related to model-based RL ( MBRL ) , as the core ideas underlying learned models and planners can enjoy considerable overlap . Perhaps the most clear instance of this overlap is Model Predictive Control ( MPC ) , and the related Dyna algorithm ( Sutton , 1991 ) . When combined with modern techniques ( Kurutach et al. , 2018 ; Luo et al. , 2018 ; Nagabandi et al. , 2018 ; Ha & Schmidhuber , 2018 ; Hafner et al. , 2019 ; Wang & Ba , 2019 ; Janner et al. , 2019 ) , MBRL is able to achieve some level of success . Corneil et al . ( 2018 ) and Hafner et al . ( 2020 ) also learn a discrete latent representation of the environment in the MBRL framework . As discussed in the introduction , planning on action sequences will fundamentally struggle to scale in robotics . Our method will make extensive use of a parametric goal-based RL agent to accomplish low-level navigation between states . This area has seen rapid progress recently , largely stemming from the success of Hindsight Experience Replay ( HER ) ( Andrychowicz et al. , 2017 ) . Several improvements to HER augment the goal relabeling and sampling strategies to improve performance ( Nair et al. , 2018 ; Pong et al. , 2018 ; 2019 ; Zhao et al. , 2019 ; Pitis et al. , 2020 ) . There have also been attempts at incorporating search as inductive biases within the value function ( Silver et al. , 2016b ; Tamar et al. , 2016 ; Farquhar et al. , 2017 ; Racanière et al. , 2017 ; Lee et al. , 2018 ; Srinivas et al. , 2018 ) . The focus of this line of work is to improve the low-level policy and is thus orthogonal to our work . Recent work in Hierarchical RL ( HRL ) builds upon goal-based RL by learning a high-level parametric manager that feeds goals to the low-level goal-based agent ( Dayan & Hinton , 1993 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018 ) . This can be viewed as a parametric alternative to classical planning , as discussed in the introduction . Recently , Jurgenson et al . ( 2020 ) ; Pertsch et al . ( 2020 ) have derived HRL methods that are intimately tied to tree search algorithms . These papers are further connected to a recent trend in the literature wherein classical search methods are combined with parametric control ( Savinov et al. , 2018a ; Eysenbach et al. , 2019 ; Huang et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2020 ; Laskin et al. , 2020 ) . Several of these articles will be discussed throughout this paper . LEAP ( Nasiriany et al. , 2019 ) also considers the problem of proposing sub-goals for a goal-conditioned agent : it uses a VAE ( Kingma & Welling , 2013 ) and does CEM on the prior distribution to form the landmarks . Our method constrains the latent space with temporal reachability between goals , a concept previously explored in Savinov et al . ( 2018b ) , and uses latent clustering and graph search rather than sampling-based methods to learn and propose sub-goals . 3 BACKGROUND . We consider the problem of Multi-Goal RL under a Markov Decision Process ( MDP ) that is parameterized by ( S , A , P , G , Ψ , R , ρ0 ) . S and A are the state and action space . The probability distribution of the initial states is given by ρ0 ( s ) , andP ( s′|s , a ) is the transition probability . Ψ : S 7→ G is a mapping from the state space to the goal space , which assumes that every state s can be mapped to a corresponding achieved goal g. The reward function R can be defined as R ( s , a , s′ , g ) = −1 { Ψ ( s′ ) 6= g } . We further assume that each episode has a fixed horizon T . The goal-conditioned policy is a probability distribution π : S ×G× A→ R+ . The policy gives rise to trajectory samples of the form τ = { s0 , a0 , g , s1 , · · · sT } . The purpose of the policy π is to learn how to reach the goals drawn from the goal distribution pg , which means maximizing the cumulative rewards . Together with a discount factor γ ∈ ( 0 , 1 ) , the objective is to maximize J ( π ) = Eg∼pg , τ∼π ( g ) [ ∑T−1 t=0 γ t · R ( st , at , st+1 , g ) ] . Q-learning provides a sample-efficient way to optimize the above objective by utilizing off-policy data stored in a replay buffer B. Q ( s , a , g ) estimates the reward-to-go under the current policy π conditioned upon the given goal . An additional technique , called Hindsight Experience Replay , or HER ( Andrychowicz et al. , 2017 ) , uses hindsight relabelling to drastically speed up training . This relabeling crucially relies upon the mapping Ψ : S 7→ G in the multi-goal MDP setting . We can write the the joint objective of multi-goal Q-learning with HER as minimizing : min Q E τ∼B , t∼ { 0···T−1 } ( st , at , st+1 ) ∼τ k∼ { t+1···T } , g=Ψ ( sk ) a′∼π ( ·|st+1 , g ) ( Q ( st , at , g ) − ( R ( st , at , st+1 , g ) + γ ·Q ( st+1 , a′ , g ) ) ) 2 ( 1 ) 4 THE L3P ALGORITHM Our overall objective in this section is to derive an algorithm that learns a small number of landmarks scattered across goal space in terms of reachability and use those learned landmarks for planning . There are three chief difficulties we must overcome when considering such an algorithm . First , how can we group together goals that are easily reachable from one another ? The answer is to embed goals into a latent space , where the latent representation captures some notion of temporal distance between goals – in the sense that goals that would take many timesteps to navigate between are further apart in latent space . Second , we need to find a way to learn a sparse set of landmarks used for planning . Our method performs clustering on the constrained latent space , and decodes the learned centroids as the landmarks we seek . Finally , we need to develop a non-parametric planning algorithm responsible for selecting sequences of landmarks the agent must traverse to accomplish its high-level goal . The proposed online planning algorithm is simple , scalable , and robust .
This paper proposes an approach for automatically learning state abstraction on a RL problem, which can then be used for temporally extended planning using a search algorithm. The main contribution is introducing the concept of latent *landmarks*, a clustering of low dimensional state embeddings. Landmarks are defined on a latent space wherein the distance between two latents code is small if their corresponding high-dimensional states can reach each other in few environment steps. The paper proposes to cluster latent states, so that each cluster contains states that are easy to reach from each other; the landmarks correspond to the centers of these clusters. An algorithm for automatically learning this clustering is introduced in the paper. With landmarks in hand, the paper proposes a soft-value iteration method to compute shortest path distances to the problem's goal. The approach is evaluated in a variety of domains, and compares favorably with recent state-of-the-art methods.
SP:fc6a56751f44bda7afbc532fa41167fce6ac286d
Just How Toxic is Data Poisoning? A Benchmark for Backdoor and Data Poisoning Attacks
1 INTRODUCTION . Data poisoning is a security threat to machine learning systems in which an attacker controls the behavior of a system by manipulating its training data . This class of threats is particularly germane to deep learning systems because they require large amounts of data to train and are therefore often trained ( or pre-trained ) on large datasets scraped from the web . For example , the Open Images and the Amazon Products datasets contain approximately 9 million and 233 million samples , respectively , that are scraped from a wide range of potentially insecure , and in many cases unknown , sources ( Kuznetsova et al. , 2020 ; Ni , 2018 ) . At this scale , it is often infeasible to properly vet content . Furthermore , many practitioners create datasets by harvesting system inputs ( e.g. , emails received , files uploaded ) or scraping user-created content ( e.g. , profiles , text messages , advertisements ) without any mechanisms to bar malicious actors from contributing data . The dependence of industrial AI systems on datasets that are not manually inspected has led to fear that corrupted training data could produce faulty models ( Jiang et al. , 2017 ) . In fact , a recent survey of 28 industry organizations found that these companies are significantly more afraid of data poisoning than other threats from adversarial machine learning ( Kumar et al. , 2020 ) . A spectrum of poisoning attacks exists in the literature . Backdoor data poisoning causes a model to misclassify test-time samples that contain a trigger – a visual feature in images or a particular character sequence in the natural language setting ( Chen et al. , 2017 ; Dai et al. , 2019 ; Saha et al. , 2019 ; Turner et al. , 2018 ) . For example , one might tamper with training images so that a vision system fails to identify any person wearing a shirt with the trigger symbol printed on it . In this threat model , the attacker modifies data at both train time ( by placing poisons ) and at inference time ( by inserting the trigger ) . Triggerless poisoning attacks , on the other hand , do not require modification at inference time ( Biggio et al. , 2012 ; Huang et al. , 2020 ; Muñoz-González et al. , 2017 ; Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . A variety of innovative backdoor and triggerless poisoning attacks – and defenses – have emerged in recent years , but inconsistent and perfunctory experimentation has rendered performance evaluations and comparisons misleading . In this paper , we develop a framework for benchmarking and evaluating a wide range of poison attacks on image classifiers . Specifically , we provide a way to compare attack strategies and shed light on the differences between them . Our goal is to address the following weaknesses in the current literature . First , we observe that the reported success of poisoning attacks in the literature is often dependent on specific ( and sometimes unrealistic ) choices of network architecture and training protocol , making it difficult to assess the viability of attacks in real-world scenarios . Second , we find that the percentage of training data that an attacker can modify , the standard budget measure in the poisoning literature , is not a useful metric for comparisons . The flaw in this metric invalidates comparisons because even with a fixed percentage of the dataset poisoned , the success rate of an attack can still be strongly dependent on the dataset size , which is not standardized across experiments to date . Third , we find that some attacks that claim to be “ clean label , ” such that poisoned data still appears natural and properly labeled upon human inspection , are not . Our proposed benchmarks measure the effectiveness of attacks in standardized scenarios using modern network architectures . We benchmark from-scratch training scenarios and also white-box and black-box transfer learning settings . Also , we constrain poisoned images to be clean in the sense of small perturbations . Furthermore , our benchmarks are publicly available as a proving ground for existing and future data poisoning attacks . The data poisoning literature contains attacks in a variety of settings including image classification , facial recognition , and text classification ( Shafahi et al. , 2018 ; Chen et al. , 2017 ; Dai et al. , 2019 ) . Attacks on the fairness of models , on on speech recognition , and recommendation engines have also been developed ( Solans et al. , 2020 ; Aghakhani et al. , 2020a ; Li et al. , 2016 ; Fang et al. , 2018 ; Hu et al. , 2019 ; Fang et al. , 2020 ) . While we acknowledge the merits of studying poisoning in a range of modalities , our benchmark focuses on image classification since it is by far the most common setting in the existing literature . 2 A SYNOPSIS OF TRIGGERLESS AND BACKDOOR DATA POISONING . Early poisoning attacks targeted support vector machines and simple neural networks ( Biggio et al. , 2012 ; Koh & Liang , 2017 ) . As poisoning gained popularity , various strategies for triggerless attacks on deep architectures emerged ( Muñoz-González et al. , 2017 ; Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Huang et al. , 2020 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . The early backdoor attacks contained triggers in the poisoned data and in some cases changed the label , thus were not clean-label ( Chen et al. , 2017 ; Gu et al. , 2017 ; Liu et al. , 2017 ) . However , methods that produce poison examples which don ’ t visibly contain a trigger also show positive results ( Chen et al. , 2017 ; Turner et al. , 2018 ; Saha et al. , 2019 ) . Poisoning attacks have also precipitated several defense strategies , but sanitization-based defenses may be overwhelmed by some attacks ( Koh et al. , 2018 ; Liu et al. , 2018 ; Chacon et al. , 2019 ; Peri et al. , 2019 ) . We focus on attacks that achieve targeted misclassification . That is , under both the triggerless and backdoor threat models , the end goal of an attacker is to cause a target sample to be misclassified as another specified class . Other objectives , such as decreasing overall test accuracy , have been studied , but less work exists on this topic with respect to neural networks ( Xiao et al. , 2015 ; Liu et al. , 2019 ) . In both triggerless and backdoor data poisoning , the clean images , called base images , that are modified by an attacker come from a single class , the base class . This class is often chosen to be precisely the same class into which the attacker wants the target image or class to be misclassified . There are two major differences between triggerless and backdoor threat models in the literature . First and foremost , backdoor attacks alter their targets during inference by adding a trigger . In the works we consider , triggers take the form of small patches added to an image ( Turner et al. , 2018 ; Saha et al. , 2019 ) . Second , these works on backdoor attacks cause a victim to misclassify any image containing the trigger rather than a particular sample . Triggerless attacks instead cause the victim to misclassify an individual image called the target image ( Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . This second distinction between the two threat models is not essential ; for example , triggerless attacks could be designed to cause the victim to misclassify a collection of images rather than a single target . To be consistent with the literature at large , we focus on triggerless attacks that target individual samples and backdoor attacks that target whole classes of images . We focus on the clean-label backdoor attack and the hidden trigger backdoor attack , where poisons are crafted with optimization procedures and do not contain noticeable patches ( Saha et al. , 2019 ; Turner et al. , 2018 ) . For triggerless attacks , we focus on the feature collision and convex polytope methods , the most highly cited attacks of the last two years that have appeared at prominent ML conferences ( Shafahi et al. , 2018 ; Zhu et al. , 2019 ) . We include the recent triggerless methods Bullseye Polytope ( BP ) and Witches ’ Brew ( WiB ) in the section where we present metrics on our benchmark problems ( Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . The following section details the attacks that serve as the subjects of our experiments . Technical details Before formally describing various poisoning methods , we begin with notation . Let Xc be the set of all clean training data , and let Xp = { x ( j ) p } Jj=1 denote the set of J poison examples with corresponding clean base image { x ( j ) b } Jj=1 . Let xt be the target image . Labels are denoted by y and Y for a single image and a set of images , respectively , and are indexed to match the data . We use f to denote a feature extractor network . Feature Collision ( FC ) Poisons in this attack are crafted by adding small perturbations to base images so that their feature representations lie extremely close to that of the target ( Shafahi et al. , 2018 ) . Formally , each poison is the solution to the following optimization problem . x ( j ) p = argmin x ‖f ( x ) − f ( xt ) ‖22 + β‖x− x ( j ) b ‖ 2 2 . ( 1 ) When we enforce ` ∞-norm constraints , we drop the last term in Equation ( 1 ) and instead enforce ‖x ( j ) p − x ( j ) b ‖∞ ≤ ε , ∀j by projecting onto the ` ∞ ball after each iteration . Convex Polytope ( CP ) This attack crafts poisons such that the target ’ s feature representation is a convex combination of the poisons ’ feature representations by solving the following optimization problem ( Zhu et al. , 2019 ) . X=p argmin { cj } , { x ( j ) } 1 2 ‖f ( xt ) − ∑J j=1 cjf ( x ( j ) ) ‖22 ‖f ( xt ) ‖22 subject to ∑J j=1 cj = 1 and cj ≥ 0 ∀ j , and ‖x ( j ) − x ( j ) b ‖∞ ≤ ε ∀j ( 2 ) Clean Label Backdoor ( CLBD ) This backdoor attack begins by computing an adversarial perturbation to each base image ( Turner et al. , 2018 ) . Formally , x̂ ( j ) p = x ( j ) b + argmax ‖δ‖∞≤ε L ( x ( j ) b + δ , y ( j ) ; θ ) , ( 3 ) where L denotes cross-entropy loss . Then , a patch is added to each image in { x̂ ( j ) p } to generate the final poisons { x ( j ) p } . The patched image is subject to an ` ∞-norm constraint . Hidden Trigger Backdoor ( HTBD ) A backdoor analogue of the FC attack , where poisons are crafted to remain close to the base images but collide in feature space with a patched image from the target class ( Saha et al. , 2019 ) . Let x̃ ( j ) t denote a patched training image from the target class ( this image is not clean ) , then we solve the following optimization problem to find poison images . x ( j ) p = argmin x ‖f ( x ) − f ( x̃ ( j ) t ) ‖22 s.t . ‖x− x ( j ) b ‖∞ ≤ ε ( 4 )
The authors study a number of existing data poisoning attacks, ablating different design choices of these attacks and evaluating them on a common benchmark. They find that many of these attacks are quite brittle to changes in their original experimental evaluation and fail to generalize to more realistic/challenging scenarios. Then, they propose a unified benchmarks for evaluating these attacks.
SP:b6258f8002510a53ee5a6ee63f8a35ac7e3b076b
Just How Toxic is Data Poisoning? A Benchmark for Backdoor and Data Poisoning Attacks
1 INTRODUCTION . Data poisoning is a security threat to machine learning systems in which an attacker controls the behavior of a system by manipulating its training data . This class of threats is particularly germane to deep learning systems because they require large amounts of data to train and are therefore often trained ( or pre-trained ) on large datasets scraped from the web . For example , the Open Images and the Amazon Products datasets contain approximately 9 million and 233 million samples , respectively , that are scraped from a wide range of potentially insecure , and in many cases unknown , sources ( Kuznetsova et al. , 2020 ; Ni , 2018 ) . At this scale , it is often infeasible to properly vet content . Furthermore , many practitioners create datasets by harvesting system inputs ( e.g. , emails received , files uploaded ) or scraping user-created content ( e.g. , profiles , text messages , advertisements ) without any mechanisms to bar malicious actors from contributing data . The dependence of industrial AI systems on datasets that are not manually inspected has led to fear that corrupted training data could produce faulty models ( Jiang et al. , 2017 ) . In fact , a recent survey of 28 industry organizations found that these companies are significantly more afraid of data poisoning than other threats from adversarial machine learning ( Kumar et al. , 2020 ) . A spectrum of poisoning attacks exists in the literature . Backdoor data poisoning causes a model to misclassify test-time samples that contain a trigger – a visual feature in images or a particular character sequence in the natural language setting ( Chen et al. , 2017 ; Dai et al. , 2019 ; Saha et al. , 2019 ; Turner et al. , 2018 ) . For example , one might tamper with training images so that a vision system fails to identify any person wearing a shirt with the trigger symbol printed on it . In this threat model , the attacker modifies data at both train time ( by placing poisons ) and at inference time ( by inserting the trigger ) . Triggerless poisoning attacks , on the other hand , do not require modification at inference time ( Biggio et al. , 2012 ; Huang et al. , 2020 ; Muñoz-González et al. , 2017 ; Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . A variety of innovative backdoor and triggerless poisoning attacks – and defenses – have emerged in recent years , but inconsistent and perfunctory experimentation has rendered performance evaluations and comparisons misleading . In this paper , we develop a framework for benchmarking and evaluating a wide range of poison attacks on image classifiers . Specifically , we provide a way to compare attack strategies and shed light on the differences between them . Our goal is to address the following weaknesses in the current literature . First , we observe that the reported success of poisoning attacks in the literature is often dependent on specific ( and sometimes unrealistic ) choices of network architecture and training protocol , making it difficult to assess the viability of attacks in real-world scenarios . Second , we find that the percentage of training data that an attacker can modify , the standard budget measure in the poisoning literature , is not a useful metric for comparisons . The flaw in this metric invalidates comparisons because even with a fixed percentage of the dataset poisoned , the success rate of an attack can still be strongly dependent on the dataset size , which is not standardized across experiments to date . Third , we find that some attacks that claim to be “ clean label , ” such that poisoned data still appears natural and properly labeled upon human inspection , are not . Our proposed benchmarks measure the effectiveness of attacks in standardized scenarios using modern network architectures . We benchmark from-scratch training scenarios and also white-box and black-box transfer learning settings . Also , we constrain poisoned images to be clean in the sense of small perturbations . Furthermore , our benchmarks are publicly available as a proving ground for existing and future data poisoning attacks . The data poisoning literature contains attacks in a variety of settings including image classification , facial recognition , and text classification ( Shafahi et al. , 2018 ; Chen et al. , 2017 ; Dai et al. , 2019 ) . Attacks on the fairness of models , on on speech recognition , and recommendation engines have also been developed ( Solans et al. , 2020 ; Aghakhani et al. , 2020a ; Li et al. , 2016 ; Fang et al. , 2018 ; Hu et al. , 2019 ; Fang et al. , 2020 ) . While we acknowledge the merits of studying poisoning in a range of modalities , our benchmark focuses on image classification since it is by far the most common setting in the existing literature . 2 A SYNOPSIS OF TRIGGERLESS AND BACKDOOR DATA POISONING . Early poisoning attacks targeted support vector machines and simple neural networks ( Biggio et al. , 2012 ; Koh & Liang , 2017 ) . As poisoning gained popularity , various strategies for triggerless attacks on deep architectures emerged ( Muñoz-González et al. , 2017 ; Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Huang et al. , 2020 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . The early backdoor attacks contained triggers in the poisoned data and in some cases changed the label , thus were not clean-label ( Chen et al. , 2017 ; Gu et al. , 2017 ; Liu et al. , 2017 ) . However , methods that produce poison examples which don ’ t visibly contain a trigger also show positive results ( Chen et al. , 2017 ; Turner et al. , 2018 ; Saha et al. , 2019 ) . Poisoning attacks have also precipitated several defense strategies , but sanitization-based defenses may be overwhelmed by some attacks ( Koh et al. , 2018 ; Liu et al. , 2018 ; Chacon et al. , 2019 ; Peri et al. , 2019 ) . We focus on attacks that achieve targeted misclassification . That is , under both the triggerless and backdoor threat models , the end goal of an attacker is to cause a target sample to be misclassified as another specified class . Other objectives , such as decreasing overall test accuracy , have been studied , but less work exists on this topic with respect to neural networks ( Xiao et al. , 2015 ; Liu et al. , 2019 ) . In both triggerless and backdoor data poisoning , the clean images , called base images , that are modified by an attacker come from a single class , the base class . This class is often chosen to be precisely the same class into which the attacker wants the target image or class to be misclassified . There are two major differences between triggerless and backdoor threat models in the literature . First and foremost , backdoor attacks alter their targets during inference by adding a trigger . In the works we consider , triggers take the form of small patches added to an image ( Turner et al. , 2018 ; Saha et al. , 2019 ) . Second , these works on backdoor attacks cause a victim to misclassify any image containing the trigger rather than a particular sample . Triggerless attacks instead cause the victim to misclassify an individual image called the target image ( Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . This second distinction between the two threat models is not essential ; for example , triggerless attacks could be designed to cause the victim to misclassify a collection of images rather than a single target . To be consistent with the literature at large , we focus on triggerless attacks that target individual samples and backdoor attacks that target whole classes of images . We focus on the clean-label backdoor attack and the hidden trigger backdoor attack , where poisons are crafted with optimization procedures and do not contain noticeable patches ( Saha et al. , 2019 ; Turner et al. , 2018 ) . For triggerless attacks , we focus on the feature collision and convex polytope methods , the most highly cited attacks of the last two years that have appeared at prominent ML conferences ( Shafahi et al. , 2018 ; Zhu et al. , 2019 ) . We include the recent triggerless methods Bullseye Polytope ( BP ) and Witches ’ Brew ( WiB ) in the section where we present metrics on our benchmark problems ( Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . The following section details the attacks that serve as the subjects of our experiments . Technical details Before formally describing various poisoning methods , we begin with notation . Let Xc be the set of all clean training data , and let Xp = { x ( j ) p } Jj=1 denote the set of J poison examples with corresponding clean base image { x ( j ) b } Jj=1 . Let xt be the target image . Labels are denoted by y and Y for a single image and a set of images , respectively , and are indexed to match the data . We use f to denote a feature extractor network . Feature Collision ( FC ) Poisons in this attack are crafted by adding small perturbations to base images so that their feature representations lie extremely close to that of the target ( Shafahi et al. , 2018 ) . Formally , each poison is the solution to the following optimization problem . x ( j ) p = argmin x ‖f ( x ) − f ( xt ) ‖22 + β‖x− x ( j ) b ‖ 2 2 . ( 1 ) When we enforce ` ∞-norm constraints , we drop the last term in Equation ( 1 ) and instead enforce ‖x ( j ) p − x ( j ) b ‖∞ ≤ ε , ∀j by projecting onto the ` ∞ ball after each iteration . Convex Polytope ( CP ) This attack crafts poisons such that the target ’ s feature representation is a convex combination of the poisons ’ feature representations by solving the following optimization problem ( Zhu et al. , 2019 ) . X=p argmin { cj } , { x ( j ) } 1 2 ‖f ( xt ) − ∑J j=1 cjf ( x ( j ) ) ‖22 ‖f ( xt ) ‖22 subject to ∑J j=1 cj = 1 and cj ≥ 0 ∀ j , and ‖x ( j ) − x ( j ) b ‖∞ ≤ ε ∀j ( 2 ) Clean Label Backdoor ( CLBD ) This backdoor attack begins by computing an adversarial perturbation to each base image ( Turner et al. , 2018 ) . Formally , x̂ ( j ) p = x ( j ) b + argmax ‖δ‖∞≤ε L ( x ( j ) b + δ , y ( j ) ; θ ) , ( 3 ) where L denotes cross-entropy loss . Then , a patch is added to each image in { x̂ ( j ) p } to generate the final poisons { x ( j ) p } . The patched image is subject to an ` ∞-norm constraint . Hidden Trigger Backdoor ( HTBD ) A backdoor analogue of the FC attack , where poisons are crafted to remain close to the base images but collide in feature space with a patched image from the target class ( Saha et al. , 2019 ) . Let x̃ ( j ) t denote a patched training image from the target class ( this image is not clean ) , then we solve the following optimization problem to find poison images . x ( j ) p = argmin x ‖f ( x ) − f ( x̃ ( j ) t ) ‖22 s.t . ‖x− x ( j ) b ‖∞ ≤ ε ( 4 )
This paper discusses many issues in the data poisoning literature. They call into question the real world applicability of data poisoning attacks and discuss the short coming in the literature. They present several issues in the comparison of such attacks. Notably they show that many attributes of a data poisoning attack assumed to be irrelevant to the success of the attack are in fact statistically significant, such as a dataset size. Finally they present a new benchmark which attempts to standardize the comparison between data poisoning attacks.
SP:b6258f8002510a53ee5a6ee63f8a35ac7e3b076b
Just How Toxic is Data Poisoning? A Benchmark for Backdoor and Data Poisoning Attacks
1 INTRODUCTION . Data poisoning is a security threat to machine learning systems in which an attacker controls the behavior of a system by manipulating its training data . This class of threats is particularly germane to deep learning systems because they require large amounts of data to train and are therefore often trained ( or pre-trained ) on large datasets scraped from the web . For example , the Open Images and the Amazon Products datasets contain approximately 9 million and 233 million samples , respectively , that are scraped from a wide range of potentially insecure , and in many cases unknown , sources ( Kuznetsova et al. , 2020 ; Ni , 2018 ) . At this scale , it is often infeasible to properly vet content . Furthermore , many practitioners create datasets by harvesting system inputs ( e.g. , emails received , files uploaded ) or scraping user-created content ( e.g. , profiles , text messages , advertisements ) without any mechanisms to bar malicious actors from contributing data . The dependence of industrial AI systems on datasets that are not manually inspected has led to fear that corrupted training data could produce faulty models ( Jiang et al. , 2017 ) . In fact , a recent survey of 28 industry organizations found that these companies are significantly more afraid of data poisoning than other threats from adversarial machine learning ( Kumar et al. , 2020 ) . A spectrum of poisoning attacks exists in the literature . Backdoor data poisoning causes a model to misclassify test-time samples that contain a trigger – a visual feature in images or a particular character sequence in the natural language setting ( Chen et al. , 2017 ; Dai et al. , 2019 ; Saha et al. , 2019 ; Turner et al. , 2018 ) . For example , one might tamper with training images so that a vision system fails to identify any person wearing a shirt with the trigger symbol printed on it . In this threat model , the attacker modifies data at both train time ( by placing poisons ) and at inference time ( by inserting the trigger ) . Triggerless poisoning attacks , on the other hand , do not require modification at inference time ( Biggio et al. , 2012 ; Huang et al. , 2020 ; Muñoz-González et al. , 2017 ; Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . A variety of innovative backdoor and triggerless poisoning attacks – and defenses – have emerged in recent years , but inconsistent and perfunctory experimentation has rendered performance evaluations and comparisons misleading . In this paper , we develop a framework for benchmarking and evaluating a wide range of poison attacks on image classifiers . Specifically , we provide a way to compare attack strategies and shed light on the differences between them . Our goal is to address the following weaknesses in the current literature . First , we observe that the reported success of poisoning attacks in the literature is often dependent on specific ( and sometimes unrealistic ) choices of network architecture and training protocol , making it difficult to assess the viability of attacks in real-world scenarios . Second , we find that the percentage of training data that an attacker can modify , the standard budget measure in the poisoning literature , is not a useful metric for comparisons . The flaw in this metric invalidates comparisons because even with a fixed percentage of the dataset poisoned , the success rate of an attack can still be strongly dependent on the dataset size , which is not standardized across experiments to date . Third , we find that some attacks that claim to be “ clean label , ” such that poisoned data still appears natural and properly labeled upon human inspection , are not . Our proposed benchmarks measure the effectiveness of attacks in standardized scenarios using modern network architectures . We benchmark from-scratch training scenarios and also white-box and black-box transfer learning settings . Also , we constrain poisoned images to be clean in the sense of small perturbations . Furthermore , our benchmarks are publicly available as a proving ground for existing and future data poisoning attacks . The data poisoning literature contains attacks in a variety of settings including image classification , facial recognition , and text classification ( Shafahi et al. , 2018 ; Chen et al. , 2017 ; Dai et al. , 2019 ) . Attacks on the fairness of models , on on speech recognition , and recommendation engines have also been developed ( Solans et al. , 2020 ; Aghakhani et al. , 2020a ; Li et al. , 2016 ; Fang et al. , 2018 ; Hu et al. , 2019 ; Fang et al. , 2020 ) . While we acknowledge the merits of studying poisoning in a range of modalities , our benchmark focuses on image classification since it is by far the most common setting in the existing literature . 2 A SYNOPSIS OF TRIGGERLESS AND BACKDOOR DATA POISONING . Early poisoning attacks targeted support vector machines and simple neural networks ( Biggio et al. , 2012 ; Koh & Liang , 2017 ) . As poisoning gained popularity , various strategies for triggerless attacks on deep architectures emerged ( Muñoz-González et al. , 2017 ; Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Huang et al. , 2020 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . The early backdoor attacks contained triggers in the poisoned data and in some cases changed the label , thus were not clean-label ( Chen et al. , 2017 ; Gu et al. , 2017 ; Liu et al. , 2017 ) . However , methods that produce poison examples which don ’ t visibly contain a trigger also show positive results ( Chen et al. , 2017 ; Turner et al. , 2018 ; Saha et al. , 2019 ) . Poisoning attacks have also precipitated several defense strategies , but sanitization-based defenses may be overwhelmed by some attacks ( Koh et al. , 2018 ; Liu et al. , 2018 ; Chacon et al. , 2019 ; Peri et al. , 2019 ) . We focus on attacks that achieve targeted misclassification . That is , under both the triggerless and backdoor threat models , the end goal of an attacker is to cause a target sample to be misclassified as another specified class . Other objectives , such as decreasing overall test accuracy , have been studied , but less work exists on this topic with respect to neural networks ( Xiao et al. , 2015 ; Liu et al. , 2019 ) . In both triggerless and backdoor data poisoning , the clean images , called base images , that are modified by an attacker come from a single class , the base class . This class is often chosen to be precisely the same class into which the attacker wants the target image or class to be misclassified . There are two major differences between triggerless and backdoor threat models in the literature . First and foremost , backdoor attacks alter their targets during inference by adding a trigger . In the works we consider , triggers take the form of small patches added to an image ( Turner et al. , 2018 ; Saha et al. , 2019 ) . Second , these works on backdoor attacks cause a victim to misclassify any image containing the trigger rather than a particular sample . Triggerless attacks instead cause the victim to misclassify an individual image called the target image ( Shafahi et al. , 2018 ; Zhu et al. , 2019 ; Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . This second distinction between the two threat models is not essential ; for example , triggerless attacks could be designed to cause the victim to misclassify a collection of images rather than a single target . To be consistent with the literature at large , we focus on triggerless attacks that target individual samples and backdoor attacks that target whole classes of images . We focus on the clean-label backdoor attack and the hidden trigger backdoor attack , where poisons are crafted with optimization procedures and do not contain noticeable patches ( Saha et al. , 2019 ; Turner et al. , 2018 ) . For triggerless attacks , we focus on the feature collision and convex polytope methods , the most highly cited attacks of the last two years that have appeared at prominent ML conferences ( Shafahi et al. , 2018 ; Zhu et al. , 2019 ) . We include the recent triggerless methods Bullseye Polytope ( BP ) and Witches ’ Brew ( WiB ) in the section where we present metrics on our benchmark problems ( Aghakhani et al. , 2020b ; Geiping et al. , 2020 ) . The following section details the attacks that serve as the subjects of our experiments . Technical details Before formally describing various poisoning methods , we begin with notation . Let Xc be the set of all clean training data , and let Xp = { x ( j ) p } Jj=1 denote the set of J poison examples with corresponding clean base image { x ( j ) b } Jj=1 . Let xt be the target image . Labels are denoted by y and Y for a single image and a set of images , respectively , and are indexed to match the data . We use f to denote a feature extractor network . Feature Collision ( FC ) Poisons in this attack are crafted by adding small perturbations to base images so that their feature representations lie extremely close to that of the target ( Shafahi et al. , 2018 ) . Formally , each poison is the solution to the following optimization problem . x ( j ) p = argmin x ‖f ( x ) − f ( xt ) ‖22 + β‖x− x ( j ) b ‖ 2 2 . ( 1 ) When we enforce ` ∞-norm constraints , we drop the last term in Equation ( 1 ) and instead enforce ‖x ( j ) p − x ( j ) b ‖∞ ≤ ε , ∀j by projecting onto the ` ∞ ball after each iteration . Convex Polytope ( CP ) This attack crafts poisons such that the target ’ s feature representation is a convex combination of the poisons ’ feature representations by solving the following optimization problem ( Zhu et al. , 2019 ) . X=p argmin { cj } , { x ( j ) } 1 2 ‖f ( xt ) − ∑J j=1 cjf ( x ( j ) ) ‖22 ‖f ( xt ) ‖22 subject to ∑J j=1 cj = 1 and cj ≥ 0 ∀ j , and ‖x ( j ) − x ( j ) b ‖∞ ≤ ε ∀j ( 2 ) Clean Label Backdoor ( CLBD ) This backdoor attack begins by computing an adversarial perturbation to each base image ( Turner et al. , 2018 ) . Formally , x̂ ( j ) p = x ( j ) b + argmax ‖δ‖∞≤ε L ( x ( j ) b + δ , y ( j ) ; θ ) , ( 3 ) where L denotes cross-entropy loss . Then , a patch is added to each image in { x̂ ( j ) p } to generate the final poisons { x ( j ) p } . The patched image is subject to an ` ∞-norm constraint . Hidden Trigger Backdoor ( HTBD ) A backdoor analogue of the FC attack , where poisons are crafted to remain close to the base images but collide in feature space with a patched image from the target class ( Saha et al. , 2019 ) . Let x̃ ( j ) t denote a patched training image from the target class ( this image is not clean ) , then we solve the following optimization problem to find poison images . x ( j ) p = argmin x ‖f ( x ) − f ( x̃ ( j ) t ) ‖22 s.t . ‖x− x ( j ) b ‖∞ ≤ ε ( 4 )
This paper studies 4 different previously proposed (clean label and targeted) poisoning attacks and compares them in a systematic way. The authors argue that the experimental setup in these papers are significantly different and comparing them with each other is hard. This incentivizes them to use a benchmark to test all in a unified way. They show that these 4 attacks are not robust to changing parameters of learning algorithm or the experimental setting. To fix this issue, the paper suggest a benchmark for testing poisoning attacks. Their benchmark is only for "clean label" and "targeted" poisoning attacks. They identify several issues with the experimental settings of previous poisoning attacks and suggest some guidelines on for evaluating poisoning attacks.
SP:b6258f8002510a53ee5a6ee63f8a35ac7e3b076b