paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Benchmarking Multi-Agent Deep Reinforcement Learning Algorithms
We benchmark commonly used multi-agent deep reinforcement learning ( MARL ) algorithms on a variety of cooperative multi-agent games . While there has been significant innovation in MARL algorithms , algorithms tend to be tested and tuned on a single domain and their average performance across multiple domains is less characterized . Furthermore , since the hyperparameters of the algorithms are carefully tuned to the task of interest , it is unclear whether hyperparameters can easily be found that allow the algorithm to be repurposed for other cooperative tasks with different reward structure and environment dynamics . To investigate the consistency of the performance of MARL algorithms , we build an open-source library of multi-agent algorithms including DDPG/TD3/SAC with centralized Q functions , PPO with centralized value functions , as well as QMix , and test them across a range of tasks that vary in coordination difficulty and agent number . The domains include the Multi-agent Particle World environments , StarCraftII micromanagement challenges , the Hanabi challenges , and the Hide-And-Seek environments . Finally , we investigate the ease of hyperparameters tuning for each of the algorithms by tuning hyperparameters in one environment per domain and re-using them in the other environments within the domain . The open-source code and more details can be found in our website : https : //sites.google . com/view/marlbenchmarks . 1 INTRODUCTION . Widespread availability of high-speed computing , neural network architectures , and advances in reinforcement learning ( RL ) algorithms have led to a continuing series of interesting results in building cooperative artificial agents : agents collectively playing Hanabi to an expert level ( Hu & Foerster , 2019 ) , designing cooperative StarCraftII bots ( Rashid et al. , 2018 ) that outperform hand-designed heuristics , and constructing emergent languages between agents ( Mordatch & Abbeel , 2017 ) . Each of these aforementioned results have often come with the introduction of a new algorithm , leading to a proliferation of new algorithms that is rapidly advancing the field . However , these algorithms are often designed and tuned to get optimal performance in a particular deployment environment . In particular , it is not unusual for each new algorithm to come with a new proposed benchmark on which it is evaluated . Consequently it is not obvious that these algorithms can easily be re-purposed for new tasks ; subtle interactions between the algorithm , the architecture and the environment may lead to high asymptotic performance on one task and total failure when applied to a new task . Without examining an algorithm across a range of tasks , it is difficult to assess how general purpose it is . Furthermore , the high asymptotic rewards that are often presented may hide complexities in using the algorithms in practice . The amount of time that researchers spent in finding optimal hyperparameters is often obscured , making it unclear how extensive of a hyperparameter search was needed to find the good hyperparameters . That is , researchers will often report a grid search of hyperparameters but not the prior work that was done to pick out a hyperparameter grid that actually contained good hyperparameters . Furthermore , the amount of computation provided to tune the studied algorithm may not be provided to the baseline algorithms that it will be compared against . This can lead to an inflated performance of the proposed algorithm relative to the benchmarks . All these problems can arise without any ill intent on the part of the authors , but they make the problem of assessing algorithms quite challenging . The downstream consequence of this proliferation of algorithms coupled with an absence of standard benchmarks is a lack of clarity on the part of practitioners as to which algorithm will give consistent , high performance with minimal tuning . Researchers are often operating under computational constraints that limit how extensive of a hyper-parameter sweep they can perform ; the ease with which good hyperparameters can be found is consequently a useful metric . When tackling a new multi-agent problem , researchers have no clear answer to the questions : 1 ) which MARL algorithm should I use to maximize performance and 2 ) given my computational resources , which algorithm is likeliest to work under my constraints ? We present an attempt to evaluate the performance , robustness and the relative ease of using these algorithms by benchmarking them across a wide variety of environments that vary in both agent number , exploration difficulty , and coordination complexity . By exploring a large range of possible environments , we identify algorithms that perform well on average and serve as a strong starting point for a variety of problems . We tackle the question of relative difficulty in finding hyperparameters by looking at how hyperparameters transfer across settings : tuning hyperparameters on one set of environments and applying them without re-tuning on the remaining environments . Using this procedure , we can provide effective recommendations on algorithm choice for researchers attempting to deploy deep multi-agent reinforcement learning while operating under constrained hyper-parameter budgets . We test Proximal Policy Optimization ( Schulman et al. , 2017 ) with centralized value functions ( MAPPO ) , Multi-Agent DDPG ( MADDPG ) ( Lowe et al. , 2017 ) , Multi-Agent TD3 ( Fujimoto et al. , 2018a ) ( MATD3 ) , a Multi-Agent variant of Soft Actor Critic ( Haarnoja et al. , 2018 ) ( MASAC ) , and QMix ( Rashid et al. , 2018 ) . We focus specifically on the performance of these algorithms on fully cooperative tasks , as this avoids game theoretic issues around computing the distance to Nash equilibria , and allows us to solely characterize performance in terms of asymptotic reward . The contributions of this paper are the following • Benchmarking multi-agent variants of single-agent algorithms across a wide range of possible tasks including StarCraftII micromanagement ( Rashid et al. , 2019 ) , Multi-agent Particle World ( Mordatch & Abbeel , 2017 ) , Hanabi ( Bard et al. , 2020 ) , and the Hide-AndSeek domain ( Baker et al. , 2019 ) . • Establishing that under constrained hyperparameter searching budgets , the multi-agent variant of PPO appears to be the most consistent algorithm across different domains . • The design and release of a new multi-agent library of various on/off-policy learning algorithms with recurrent policy support . 2 RELATED WORK . MARL algorithms have a long history but have , until recently , primarily been applied in tabular settings ( Littman , 1994 ; Busoniu et al. , 2008 ) . Notions of using a Q-function that operated on the actions of all agents , known as Joint-Action Learners ( Claus & Boutilier , 1998 ) have existed in the literature since its inception with algorithms like Hyper-Q ( Tesauro , 2004 ) using inferred estimates of other agent strategies in the Q-function . Recent MARL algorithms have built upon these ideas by incorporating neural networks ( Tampuu et al. , 2017 ) , policy-gradient methods ( Foerster et al. , 2017 ) , and finding ways to combine local and centralized Q-functions to enable centralized learning with decentralized execution ( Lowe et al. , 2017 ; Sunehag et al. , 2018 ) . Alongside the proliferation of algorithms has come a wide variety of new , cooperative MARL benchmarks . Unlike single-agent RL , where MuJoCo ( Todorov et al. , 2012 ) and Atari ( Mnih et al. , 2013 ) have become standard benchmarks , there is significantly less consensus on appropriate benchmarks . In this work , we consider 4 popular multi-agent environments , which we believe are the most representative in the community . Besides those we considered in this work , other interesting cooperative environments may include MAgent ( Zheng et al. , 2017 ) , a platform that can efficiently support hundreds of particle agents for cooperative tasks , multi-agent MuJoCo , in which each joint is an independent agent ( Schroeder de Witt et al. , 2020 ) , and CityFlow ( Zhang et al. , 2019 ) , which studies large-scale decentralized traffic light control . There also has been a variety of attempts to benchmark MARL algorithms that differ in scope from our paper . Gupta et al . ( 2017 ) benchmarks a similar set of algorithms to ours on a wide variety of environments . However , they do not consider algorithms that train in a centralized fashion while acting decentralized and instead perform a comparison between fully centralized training and execution and full decentralized algorithms . They establish that parameter sharing is an essential component of getting quick convergence in MARL algorithms . Schroeder de Witt et al . ( 2020 ) benchmark algorithms with centralized Q and value functions on a decentralized variant of the MuJoCo environments ; however , they primarily study variants of QMix and MADDPG and do not compare with on-policy algorithms . 3 MARL ALGORITHMS . 3.1 PRELIMINARIES . We study decentralized partially observed Markov decision processes ( DEC-POMDP ) ( Oliehoek et al. , 2016 ) with global rewards . A DEC-POMDP is defined by an eight tuple 〈S , U , P , r , Z , O , n , γ〉 . s ∈ S is a state space describing a sufficient set of state variables to make the system dynamics Markovian . For simplicity we assume the agents share action space U and each agent a ∈ { 1 , . . . , n } picks an action ua ∈ U which are concatenated to form join action u ∈ Un . We denote the joint action without the action of agent a as u−a . Joint actions u and state are fed to state transition function P ( s′|s , u ) : S × U × S → [ 0 , 1 ] . These are cooperative tasks so all agents share a bounded reward function r ( s , u ) : S × Un → R and have shared discount factor γ ∈ [ 0 , 1 ] Each agent i has an observation function Oa ( s ) : S → Z which defines how the global state is mapped onto a local observation z ∈ Z . Each agent maintains an action-observation history τa ∈ T ∈ ( Z ×U ) ∗ which it conditions its policy πa ( ua|τa ) : T×U → [ 0 , 1 ] on . Finally , given the joint policy π ( u ) = ∏ i π a ( ua|τa ) we can define a joint value function V π ( st ) = Est+1 : ∞ [ ∑∞ i=0 γ irt+i|st ] and joint Q function Qπ ( st , ut ) = Est+1 : ∞ [ ∑∞ i=0 γ irt+i|st , ut ] . We assume that the learning algorithm has access to both true states S , as well as the trajectories of all agents τa . The agents however , only have access to τa for computing their policy . The goal of the agents is to jointly optimize the quantity Jπ = E [ ∑∞ i=0 γ ir ( st , u ) ] . 3.2 BASELINE ALGORITHMS . We introduce all the baseline algorithms we consider , including MADDPG , MATD3 , MASAC , QMix and MAPPO . For all problems considered , the action space is discrete . More algorithmic details and the complete pseudo-code can be found in the appendix . MADDPG : The MADDPG algorithm is perhaps the most popular general-purpose off-policy MARL algorithm . The algorithm was proposed by Lowe et al . ( 2017 ) , based on the DDPG algorithm ( Lillicrap et al. , 2015 ) , and uses a centralized Q-function taking observations and actions from all the agents to alleviate the non-stationarity issue and stabilize multi-agent training . Note that although DDPG was originally designed for continuous actions , MADDPG adopts the gumbel-softmax ( Jang et al. , 2016 ) trick to handle discrete actions . MATD3 : The TD3 algorithm ( Fujimoto et al. , 2018b ) is a popular enhanced version of the standard DDPG algorithm ( Lillicrap et al. , 2016 ) . We similarly apply the same centralized critic technique introduced in MADDPG to TD3 to derive a multi-agent variant of TD3 , i.e. , MATD3 . The only difference between MATD3 and MADDPG is the use of twin delayed critics and the addition of small amounts of noise to the actions sampled from the buffer . MASAC : The Soft Actor-Critic ( SAC ) algorithm ( Haarnoja et al. , 2018 ) is an extremely popular off-policy algorithm and has been considered as a state-of-the-art baseline for a diverse range of RL problems with continuous actions . Similar to MADDPG , we introduce a centralized critic in SAC to achieve another general-purpose MARL algorithm , MASAC . QMix : QMix ( Rashid et al. , 2018 ) is a Q-learning algorithm designed for multi-agent cooperative tasks with a global reward . The core idea of QMix is value decomposition , which formulates the global Q function , Qtot as the output of a ” mixer ” neural network whose inputs are the individual agent Q functions , Qa ; The weights of this ” mixer ” network are constrained to be positive in order to insure that ∂Qtot∂Qa ≥ 0 , ∀ agents a . This ensures that by acting greedily to maximize their local Q functions , agents will also be maximizing the global Q function . QMix was first introduced in the StarCraftII micromanagement and has been a popular benchmark algorithm for this challenge . However , it is rarely tested in other domains . MAPPO : In addition to the off-policy algorithms above , we also consider an on-policy MARL algorithm , i.e. , a multi-agent variant of PPO ( MAPPO ) . We enhance the standard decentralized PPO algorithm by learning a centralized critic that takes in the global state or the concatenation of each agent ’ s local observation ( when global state is not available ) . This idea of centralized value functions was originally introduced in the COMA algorithm ( Foerster et al. , 2018 ) . Our implementation follows the details in Baker et al . ( 2019 ) , including using two separate networks for policy and value function , GAE , advantage normalization and a Pop-Art value normalizer ( Hessel et al. , 2019 ) , which uses running statistics of the values to normalizes the regression target of value network to zero mean and a standard deviation of one .
The paper aims to benchmark a suite of Multi-Agent Deep Reinforcement Learning algorithms across different environments in the cooperative multi-agent setting. The paper compares standard algorithms alongside extensions of well-known policy gradient algorithms to the multi-agent setting, i.e. PPO (MAPPO), SAC (MASAC) and TD3 (MATD3). The paper investigates the ease of using an algorithm by doing a fair hyperparameter search for different algorithms. The paper concludes by saying that MAPPO is a promising choice for tackling a multi-agent problem.
SP:2e305b4762d57663e3c96ae164a9cd385dfe9549
A Multi-Modal and Multitask Benchmark in the Clinical Domain
Healthcare represents one of the most promising application areas for machine learning algorithms , including modern methods based on deep learning . Modern deep learning algorithms perform best on large datasets and on unstructured modalities such as text or image data ; advances in deep learning have often been driven by the availability of such large datasets . Here , we introduce Multi-Modal Multi-Task MIMIC-III ( M3 ) — a dataset and benchmark for evaluating machine learning algorithms in the healthcare domain . This dataset contains multi-modal patient data collected from intensive care units — including physiological time series , clinical notes , ECG waveforms , and tabular inputs — and defines six clinical tasks — including predicting mortality , decompensation , readmission , and other outcomes — which serve as benchmarks for comparing algorithms . We introduce new multi-modal and multi-task models for this dataset , and show that they outperform previous state-of-the-art results that only rely on a subset of all tasks and modalities . This highlights the potential of multi-task and multi-modal learning to improve the performance of algorithms in the healthcare domain . More generally , we envision M3 as a general resource that will help accelerate research in applying machine learning to healthcare . 1 INTRODUCTION . Healthcare and medicine are the some of the most promising areas in which machine learning algorithms can have an impact ( Yu et al. , 2018 ) . Techniques relying on machine learning have found successful applications in dermatology , ophthalmology , and many other fields of medicine ( Esteva et al. , 2017 ; Gulshan et al. , 2016 ; Hannun et al. , 2019 ) . Modern machine learning techniques — including algorithms based on deep learning — perform best on large datasets and on unstructured inputs , such as text , images , and other forms of raw signal data ( You et al. , 2016 ; Agrawal et al. , 2016 ) . Progress in modern machine learning has in large part been driven by the availability of these types of large datasets as well as by competitive benchmarks on which algorithms are evaluated ( Deng et al. , 2009 ; Lin et al. , 2014 ) . Recently , machine learning algorithms that combine data from multiple domains and that are trained to simultaneously solve a large number of tasks have achieved performance gains in domains such as machine translation and drug discovery ( Johnson et al. , 2017 ; Ramsundar et al. , 2015 ) . Current research in this area is driven by widely adopted computational benchmarks , particularly in the field of natural language processing ( Wang et al. , 2018a ; 2019 ) . In this paper , we argue that multi-modal and multitask benchmarks can similarly drive progress in applications of machine learning to healthcare . In many healthcare settings , we have access to data coming from diverse modalities — including radiology images , clinical notes , wearable sensor data , and others — and we are solving many tasks — for example , estimating disease risk , predicting readmission , and forecasting decompensation events . These kinds of settings are naturally suited to modern deep learning algorithms ; developing models that effectively leverage diverse tasks and modalities has the potential to greatly improve the performance of machine learning algorithms in the clinical domain . As a first step in this research direction , we introduce in this paper Multi-Modal Multi-Task MIMICIII ( M3 ) 1 , a dataset and benchmark for evaluating machine learning algorithms in healthcare that is inspired by popular multitask benchmarks in other application domains , such as natural language processing ( Wang et al. , 2018b ; McCann et al. , 2018 ) . Previous clinical datasets and benchmarks have either focused on specific tasks in isolation as in Khadanga et al . ( 2020 ) or on multiple tasks over a single input modality ( Harutyunyan et al. , 2019 ) . Our work is the first to combine multiple tasks and modalities into one benchmark . More specifically , we propose a dataset that is derived from the MIMIC-III database and is comprised of data collected from over forty thousand patients who stayed in intensive care units ( ICUs ) of the Beth Israel Deaconess Medical Center between 2001 and 2012 ( Johnson et al. , 2016 ) . As part of this dataset , we have collected data from four modalities — including physiological time series , clinical notes , ECG waveforms , and tabular data — and have defined six clinical tasks — mortality prediction , decompensation , readmission , and others . We also propose an evaluation framework to benchmark models on this dataset . As a demonstration of how the M3 benchmark can drive progress in clinical applications of machine learning , we propose a first set of multi-modal and multitask models and evaluate them on our new benchmark . We find that these models achieve high performance levels and may serve as strong baselines for future work . In particular , our models outperform previous state-of-the-art results that only rely on a subset of all tasks and modalities . These results highlight the potential of multitask and multi-modal learning to improve the performance of algorithms in the healthcare domain . We envision M3 as a general resource that will help accelerate research in applying machine learning to healthcare . To facilitate such uses , we release M3 and our models as an easy-to-use open-source package for the research community . Contributions . In summary , our paper makes the following contributions . • We define a new benchmark for machine learning algorithms in the clinical domain . It defines six clinical tasks , and is the first to collect data across multiple modalities . • We introduce new multi-modal and multitask machine learning models which outperform previous state-of-the-art methods that only rely on a subset of tasks or modalities . This highlights the importance of multi-modal and multitask learning in clinical settings . • We package our benchmark into an easy to use format such that the clinical machine learning community can further build upon our work . 2 BACKGROUND . Machine Learning in the Clinical Domain . Machine learning has been successfully applied throughout healthcare , including in areas such as medical imaging , drug discovery , and many others ( Rajpurkar et al. , 2017 ; Vamathevan et al. , 2019 ) . In this paper , we restrict our attention to a specific healthcare setting — intensive care . The Medical Information Mart for Intensive Care ( MIMIC-III ) database is one of the most important resources for applying machine learning to intensive care ( Johnson et al. , 2016 ) . Data collected in the ICUs includes vital signs , lab events , medical interventions , and socio-demographic information . Multi-Modal and Multi-Task Learning . Multitask learning trains models to simultaneously solve multiple tasks ( Ruder , 2017 ) . Successful applications of multitask learning include machine translation and drug discovery ( Johnson et al. , 2017 ; Ramsundar et al. , 2015 ) . Current research in this area is driven by popular benchmarks , particularly in the field of natural language processing ( Wang et al. , 2018b ; 2019 ; Rajpurkar et al. , 2016 ) . Multi-modal machine learning combines and models data of different modalities such as vision , language , speech . A key challenge in multi-modal learning is to combine representations over diverse input types . Applications of multi-modal learning include image captioning and visual question answering ( Anderson et al. , 2018 ; Agrawal et al. , 2016 ; Moradi et al. , 2018 ; Nguyen et al. , 2019 ) . 1Our code is available here : https : //github.com/DoubleBlindGithub/M3 The clinical domain lends itself naturally to multi-modal learning , given the prevalence of data in different modalities , including physiological signals , clinical notes , medical images , tabular inputs and genome sequences . In this work , we propose the first multitask and multi-modal benchmark over this diverse clinical data . 3 THE MULTI-MODAL MULTI-TASK MIMIC BENCHMARK . Next , we introduce Multi-Modal Multi-Task MIMIC-III ( M3 ) , a dataset and benchmark for evaluating machine learning algorithms in healthcare . This dataset is derived from the MIMIC-III database and is comprised of data collected from over forty thousand patients . It contains data from four diverse modalities and defines six clinical tasks . It also proposes an evaluation framework to benchmark models and comes in an easy-to-use open source package . Each patient in the dataset completes a number of stays in an ICU , with 13 % of patients completing more than one stay . Over the course of each stay , the ICU collects measurements of vital signs and other clinical variables at irregular intervals , as well as clinical notes describing the state of the patient . 3.1 DESIGN PRINCIPLES . The goal of the M3 benchmark is to accelerate progress in applications of machine learning to healthcare . The design of this benchmark is guided by the principles of multi-modality — we collect data from diverse and unstructured modalities found in healthcare and that can be leveraged by modern deep learning algorithms — as well as task relevance , diversity , and evaluability — we choose diverse real-world clinical tasks that enhance model performance when solved jointly and that have well-defined success metrics . Finally , we are concerned with accessibility : in order to ensure that our benchmark can be widely adopted , we base it on datasets that can be obtained with minimum overhead and that satisfy privacy and legal requirements . 3.2 TASKS . The M3 benchmark includes 6 different clinical prediction tasks . Each task is performed at specific time points within the ICU stay of a patient.More details can be found in Table 1 . In Hospital Mortality . We observe the first 48 hours of a patient ’ s data , and then predict whether the patient will die by the end of their stay ( Harutyunyan et al. , 2019 ; Khadanga et al. , 2020 ; Purushotham et al. , 2017 ; Wang et al. , 2020 ; Tang et al. , 2020 ) . Mortality is one of the major concerns for any ICU unit , with limiting mortality being an ultimate goal for most ICUs . Decompensation . Starting from the fifth hour of the stay , a prediction is made at every hour about whether the patient will die within the next 24 hours given all the data collected to that point . Unlike in the IHM task , predictions are made on an hourly basis rather than after a set amount of time and concern the next 24 hours rather than the entire stay . As such , this task may better reflect the changing landscape of available patient information . Length of Stay . We predict the total duration time from admission to discharge . This task could provide useful information for medical resources allocation and scheduling . We formulate this task as a multiclass classification problem with three classes/bins ( 0-3 days , 3-7 days , and longer than 7 days ) using only data from the 24 hours of the stay . Phenotyping . A prediction of the patient ’ s phenotype is made at discharge time . This is a multilabel classification task . The target label is derived from the billing code at a patients discharge , which we then convert to our 25 labels following the procedure from Harutyunyan et al . ( 2019 ) . Readmission . We predict if another ICU stay will occur to the same patient after the discharge time of an ICU stay . Predicting readmission is useful to identify higher risk patients and minimize the waste of financial resources . We define this as a multiclass classification problem with 5 classes — readmission within 7 , 7-30 , 30-90 , 90-365 , and 365+ days or no readmission . Long-Term Mortality . For each ICU stay , we predict if the patient survives for more than 1 year after discharge . We frame this as a binary classification problem . Predicting long-term mortality is useful for assessing patients ’ well-being after discharge .
This paper defines a new task for clinical data by combing multi-modal and multi-task settings into one task. It collects a dataset called M3 as the benchmark for the multi-modal and multi-task benchmark in the clinical domain. The dataset has 6 prediction tasks, i.e., in-hospital mortality, decompensation, length of stay, phenotyping, readmission, and long-term mortality, and it has 4 modalities, i.e., physiological time series, clinical notes, tabular data, and waveforms. Specifically, this paper also provides a multi-modal multi-task model where the time series data are encoded by LSTM, clinical notes are encoded by text CNN and tabular data are also encoded by existing methods. In experiments, the authors conduct an ablation study and compare the proposed method with the method of Harutyunyan et al. and Khadanga et al.
SP:834d63ae7b52ef284c72e35188bb5722141fcd5d
A Multi-Modal and Multitask Benchmark in the Clinical Domain
Healthcare represents one of the most promising application areas for machine learning algorithms , including modern methods based on deep learning . Modern deep learning algorithms perform best on large datasets and on unstructured modalities such as text or image data ; advances in deep learning have often been driven by the availability of such large datasets . Here , we introduce Multi-Modal Multi-Task MIMIC-III ( M3 ) — a dataset and benchmark for evaluating machine learning algorithms in the healthcare domain . This dataset contains multi-modal patient data collected from intensive care units — including physiological time series , clinical notes , ECG waveforms , and tabular inputs — and defines six clinical tasks — including predicting mortality , decompensation , readmission , and other outcomes — which serve as benchmarks for comparing algorithms . We introduce new multi-modal and multi-task models for this dataset , and show that they outperform previous state-of-the-art results that only rely on a subset of all tasks and modalities . This highlights the potential of multi-task and multi-modal learning to improve the performance of algorithms in the healthcare domain . More generally , we envision M3 as a general resource that will help accelerate research in applying machine learning to healthcare . 1 INTRODUCTION . Healthcare and medicine are the some of the most promising areas in which machine learning algorithms can have an impact ( Yu et al. , 2018 ) . Techniques relying on machine learning have found successful applications in dermatology , ophthalmology , and many other fields of medicine ( Esteva et al. , 2017 ; Gulshan et al. , 2016 ; Hannun et al. , 2019 ) . Modern machine learning techniques — including algorithms based on deep learning — perform best on large datasets and on unstructured inputs , such as text , images , and other forms of raw signal data ( You et al. , 2016 ; Agrawal et al. , 2016 ) . Progress in modern machine learning has in large part been driven by the availability of these types of large datasets as well as by competitive benchmarks on which algorithms are evaluated ( Deng et al. , 2009 ; Lin et al. , 2014 ) . Recently , machine learning algorithms that combine data from multiple domains and that are trained to simultaneously solve a large number of tasks have achieved performance gains in domains such as machine translation and drug discovery ( Johnson et al. , 2017 ; Ramsundar et al. , 2015 ) . Current research in this area is driven by widely adopted computational benchmarks , particularly in the field of natural language processing ( Wang et al. , 2018a ; 2019 ) . In this paper , we argue that multi-modal and multitask benchmarks can similarly drive progress in applications of machine learning to healthcare . In many healthcare settings , we have access to data coming from diverse modalities — including radiology images , clinical notes , wearable sensor data , and others — and we are solving many tasks — for example , estimating disease risk , predicting readmission , and forecasting decompensation events . These kinds of settings are naturally suited to modern deep learning algorithms ; developing models that effectively leverage diverse tasks and modalities has the potential to greatly improve the performance of machine learning algorithms in the clinical domain . As a first step in this research direction , we introduce in this paper Multi-Modal Multi-Task MIMICIII ( M3 ) 1 , a dataset and benchmark for evaluating machine learning algorithms in healthcare that is inspired by popular multitask benchmarks in other application domains , such as natural language processing ( Wang et al. , 2018b ; McCann et al. , 2018 ) . Previous clinical datasets and benchmarks have either focused on specific tasks in isolation as in Khadanga et al . ( 2020 ) or on multiple tasks over a single input modality ( Harutyunyan et al. , 2019 ) . Our work is the first to combine multiple tasks and modalities into one benchmark . More specifically , we propose a dataset that is derived from the MIMIC-III database and is comprised of data collected from over forty thousand patients who stayed in intensive care units ( ICUs ) of the Beth Israel Deaconess Medical Center between 2001 and 2012 ( Johnson et al. , 2016 ) . As part of this dataset , we have collected data from four modalities — including physiological time series , clinical notes , ECG waveforms , and tabular data — and have defined six clinical tasks — mortality prediction , decompensation , readmission , and others . We also propose an evaluation framework to benchmark models on this dataset . As a demonstration of how the M3 benchmark can drive progress in clinical applications of machine learning , we propose a first set of multi-modal and multitask models and evaluate them on our new benchmark . We find that these models achieve high performance levels and may serve as strong baselines for future work . In particular , our models outperform previous state-of-the-art results that only rely on a subset of all tasks and modalities . These results highlight the potential of multitask and multi-modal learning to improve the performance of algorithms in the healthcare domain . We envision M3 as a general resource that will help accelerate research in applying machine learning to healthcare . To facilitate such uses , we release M3 and our models as an easy-to-use open-source package for the research community . Contributions . In summary , our paper makes the following contributions . • We define a new benchmark for machine learning algorithms in the clinical domain . It defines six clinical tasks , and is the first to collect data across multiple modalities . • We introduce new multi-modal and multitask machine learning models which outperform previous state-of-the-art methods that only rely on a subset of tasks or modalities . This highlights the importance of multi-modal and multitask learning in clinical settings . • We package our benchmark into an easy to use format such that the clinical machine learning community can further build upon our work . 2 BACKGROUND . Machine Learning in the Clinical Domain . Machine learning has been successfully applied throughout healthcare , including in areas such as medical imaging , drug discovery , and many others ( Rajpurkar et al. , 2017 ; Vamathevan et al. , 2019 ) . In this paper , we restrict our attention to a specific healthcare setting — intensive care . The Medical Information Mart for Intensive Care ( MIMIC-III ) database is one of the most important resources for applying machine learning to intensive care ( Johnson et al. , 2016 ) . Data collected in the ICUs includes vital signs , lab events , medical interventions , and socio-demographic information . Multi-Modal and Multi-Task Learning . Multitask learning trains models to simultaneously solve multiple tasks ( Ruder , 2017 ) . Successful applications of multitask learning include machine translation and drug discovery ( Johnson et al. , 2017 ; Ramsundar et al. , 2015 ) . Current research in this area is driven by popular benchmarks , particularly in the field of natural language processing ( Wang et al. , 2018b ; 2019 ; Rajpurkar et al. , 2016 ) . Multi-modal machine learning combines and models data of different modalities such as vision , language , speech . A key challenge in multi-modal learning is to combine representations over diverse input types . Applications of multi-modal learning include image captioning and visual question answering ( Anderson et al. , 2018 ; Agrawal et al. , 2016 ; Moradi et al. , 2018 ; Nguyen et al. , 2019 ) . 1Our code is available here : https : //github.com/DoubleBlindGithub/M3 The clinical domain lends itself naturally to multi-modal learning , given the prevalence of data in different modalities , including physiological signals , clinical notes , medical images , tabular inputs and genome sequences . In this work , we propose the first multitask and multi-modal benchmark over this diverse clinical data . 3 THE MULTI-MODAL MULTI-TASK MIMIC BENCHMARK . Next , we introduce Multi-Modal Multi-Task MIMIC-III ( M3 ) , a dataset and benchmark for evaluating machine learning algorithms in healthcare . This dataset is derived from the MIMIC-III database and is comprised of data collected from over forty thousand patients . It contains data from four diverse modalities and defines six clinical tasks . It also proposes an evaluation framework to benchmark models and comes in an easy-to-use open source package . Each patient in the dataset completes a number of stays in an ICU , with 13 % of patients completing more than one stay . Over the course of each stay , the ICU collects measurements of vital signs and other clinical variables at irregular intervals , as well as clinical notes describing the state of the patient . 3.1 DESIGN PRINCIPLES . The goal of the M3 benchmark is to accelerate progress in applications of machine learning to healthcare . The design of this benchmark is guided by the principles of multi-modality — we collect data from diverse and unstructured modalities found in healthcare and that can be leveraged by modern deep learning algorithms — as well as task relevance , diversity , and evaluability — we choose diverse real-world clinical tasks that enhance model performance when solved jointly and that have well-defined success metrics . Finally , we are concerned with accessibility : in order to ensure that our benchmark can be widely adopted , we base it on datasets that can be obtained with minimum overhead and that satisfy privacy and legal requirements . 3.2 TASKS . The M3 benchmark includes 6 different clinical prediction tasks . Each task is performed at specific time points within the ICU stay of a patient.More details can be found in Table 1 . In Hospital Mortality . We observe the first 48 hours of a patient ’ s data , and then predict whether the patient will die by the end of their stay ( Harutyunyan et al. , 2019 ; Khadanga et al. , 2020 ; Purushotham et al. , 2017 ; Wang et al. , 2020 ; Tang et al. , 2020 ) . Mortality is one of the major concerns for any ICU unit , with limiting mortality being an ultimate goal for most ICUs . Decompensation . Starting from the fifth hour of the stay , a prediction is made at every hour about whether the patient will die within the next 24 hours given all the data collected to that point . Unlike in the IHM task , predictions are made on an hourly basis rather than after a set amount of time and concern the next 24 hours rather than the entire stay . As such , this task may better reflect the changing landscape of available patient information . Length of Stay . We predict the total duration time from admission to discharge . This task could provide useful information for medical resources allocation and scheduling . We formulate this task as a multiclass classification problem with three classes/bins ( 0-3 days , 3-7 days , and longer than 7 days ) using only data from the 24 hours of the stay . Phenotyping . A prediction of the patient ’ s phenotype is made at discharge time . This is a multilabel classification task . The target label is derived from the billing code at a patients discharge , which we then convert to our 25 labels following the procedure from Harutyunyan et al . ( 2019 ) . Readmission . We predict if another ICU stay will occur to the same patient after the discharge time of an ICU stay . Predicting readmission is useful to identify higher risk patients and minimize the waste of financial resources . We define this as a multiclass classification problem with 5 classes — readmission within 7 , 7-30 , 30-90 , 90-365 , and 365+ days or no readmission . Long-Term Mortality . For each ICU stay , we predict if the patient survives for more than 1 year after discharge . We frame this as a binary classification problem . Predicting long-term mortality is useful for assessing patients ’ well-being after discharge .
This paper discusses the Multi-Modal Multi-Task MIMIC-III (M3) dataset and benchmark, which extends previous efforts in this space to provide a benchmark on the MIMIC-III dataset. In particular, this work considers the inclusion of multiple modalities, including time series, clinical notes, ECG waveforms, and tabular input. It also defines six clinical tasks, some of which overlap with existing efforts and others which appear to be new.
SP:834d63ae7b52ef284c72e35188bb5722141fcd5d
Efficient Empowerment Estimation for Unsupervised Stabilization
1 INTRODUCTION . Intrinsic motivation allows artificial and biological agents to acquire useful behaviours without external knowledge ( Barto et al . ( 2004 ) ; Chentanez et al . ( 2005 ) ; Schmidhuber ( 2010 ) ; Barto ( 2013 ) ; Oudeyer et al . ( 2016 ) ) . In the framework of reinforcement learning ( RL ) , this external knowledge is usually provided by an expert through a task-specific reward , which is optimized by an artificial agent towards a desired behavior ( Mnih et al . ( 2013 ) ; Schulman et al . ( 2017 ) ) . In contrast , an intrinsic reward can arise solely from the interaction between the agent and environment , which eliminates the need for domain knowledge and reward engineering in some settings ( Mohamed & Rezende ( 2015 ) ; Houthooft et al . ( 2017 ) ; Pathak et al . ( 2017 ) ) . Previously , it was shown that maximizing mutual information ( Cover & Thomas ( 2012 ) ) between an agent ’ s actuators and sensors can guide the agent towards states in the environment with higher potential to achieve a larger number of eventual goals ( Klyubin et al . ( 2005 ) ; Wissner-Gross & Freer ( 2013 ) ) . Maximizing this kind of mutual information is known as the empowerment principle ( Klyubin et al . ( 2005 ) ; Salge et al . ( 2014 ) ) . Previously , it was found that an agent maximizing its empowerment converges to an unstable equilibrium of the environment in various dynamical control systems ( Jung et al . ( 2011 ) ; Salge et al . ( 2013 ) ; Karl et al . ( 2019 ) ) . In this application , ascending the gradient of the empowerment function coincides with the objective of optimal control for stabilization at an unstable equilibrium ( Strogatz ( 2018 ) ) , which is an important task for both engineering ( Todorov ( 2006 ) ) and 1Project page : https : //sites.google.com/view/latent-gce biological2 systems ; we refer to this as the essential property of empowerment . It follows from the aforementioned prior works that a plausible estimate of the empowerment function should possess this essential property . Empowerment has been found to be useful for a broad spectrum of applications , including : unsupervised skill discovery ( Sharma et al . ( 2020 ) ; Eysenbach et al . ( 2019 ) ; Gregor et al . ( 2017 ) ; Karl et al . ( 2019 ) ; Campos et al . ( 2020 ) ; human-agent coordination ( Salge & Polani ( 2017 ) ; Guckelsberger et al . ( 2016 ) ) ; assistance ( Du et al . ( 2021 ) ) ; and stabilization ( Tiomkin et al . ( 2017 ) ) . Past work has utilized variational lower bounds ( VLBs ) ( Poole et al . ( 2019 ) ; Alemi et al . ( 2017 ) ; Tschannen et al . ( 2020 ) ; Mohamed & Rezende ( 2015 ) ) to achieve an estimate of the empowerment . However , VLB approaches to empowerment in dynamical control systems ( Sharma et al . ( 2020 ) ; Achiam et al . ( 2018 ) ) have high sample complexity , are often unstable in training , and may be biased . Moreover , it was not previously studied if empowerment estimators learned via VLBs possess the essential properties of empowerment . In this work , we introduce a new method , Latent Gaussian Channel Empowerment ( Latent-GCE ) , for empowerment estimation and utilize the above-mentioned property as an “ indicator ” for the quality of the estimation . Specifically , we propose a particular representation for dynamical control systems using deep neural networks which is learned from state-action trajectories . This representation admits an efficient estimation of empowerment by convex optimization ( Cover & Thomas ( 2012 ) ) , both from raw state and from images . We propose an algorithm for simultaneous estimation and maximization of empowerment using standard RL algorithms such as Proximal Policy Optimization ( Schulman et al . ( 2017 ) ) , and Soft Actor-Critic ( Haarnoja et al . ( 2018 ) ) . We test our method on the task of unsupervised stabilization of dynamical systems with solely intrinsic reward , showing our estimator exhibits essential properties of the empowerment function . We demonstrate the advantages of our method through comparisons to the existing state-of-the-art empowerment estimators in different dynamical systems from the OpenAI Gym simulator ( Brockman et al . ( 2016 ) ) . We find that our method ( i ) has a lower sample complexity , ( ii ) is more stable in training , ( iii ) possesses the essential properties of the empowerment function , and ( iv ) allows us to accurately estimate empowerment from images . We hope such a review of the existing methods for empowerment estimation will help push this research direction . 2 PRELIMINARIES . In this section , we review the necessary background for our method , consisting of the reinforcement learning setting , various empowerment estimators , and the Gaussian channel capacity . We also review the underlying components in relevant prior work which we use for comparison to our method . 2.1 REINFORCEMENT LEARNING . The reinforcement learning ( RL ) setting is modeled as an infinite-horizon Markov Decision Process ( MDP ) defined by : the state space S , the action space A , the transition probabilities p ( s′|s , a ) , the initial state distribution p0 ( s ) , the reward function r ( s , a ) ∈ R , and the discount factor γ . The goal of RL is to find an optimal control policy π ( a|s ) that maximizes the expected return , i.e . maxπ Es0∼p0 , at∼π , st+1∼p [ ∑∞ t=0 γ tr ( st , at ) ] ( Sutton & Barto ( 2018 ) ) . 2.2 EMPOWERMENT . Interaction between an agent and its environment is plausibly described by the perception-action cycle ( PAC ) , ( Tishby & Polani ( 2011 ) ) , where the agent observes the state of the environment via its sensors and responds with its actuators . The maximal information rate from actuators to sensors is an inherent property of PAC which characterizes the empowerment of the agent , formally defined below . Empowerment ( Klyubin et al . ( 2005 ) ) is defined by the maximal mutual information rate ( Cover & Thomas ( 2012 ) ) between the agent ’ s sensor observations o ∈ O and actuators a ∈ A given the current state s ∈ S . It is fully specified by a fixed probability distribution of sensor observations conditioned 2Broadly speaking , an increase in the rate of information flow in the perception-action loop ( Tishby & Polani ( 2011 ) ) could be an impetus for the development of homosapiens , as hypothesized in ( Yuval ( 2014 ) ) . on the actuators and the state , p ( O | A , s ) , denoted by “ channel ” , and by a free probability of the actuator signals conditioned on the state , ω ( A | s ) , denoted by “ source ” . The empowerment E is the capacity of the channel , which is found via optimization of the source distribution ω ( A | s ) : E ( s ) = max ω ( A|s ) I [ O ; A | s ] = max ω ( A|s ) ∑ O , A p ( O , A | s ) log ( p ( A | O , s ) ω ( A | s ) ) ( 1 ) where I [ O ; A | s ] is the mutual information , reflecting the difference between the entropy of the sensor inputs , H ( O | s ) and the corresponding conditional entropy , H ( O | A , s ) 3 . In this work , we follow the original empowerment formulation ( Klyubin et al . ( 2005 ) ) , where A is an action sequence of length T starting from the state s and O is the resulting observation sequence . However , our method is applicable to other choices of observation and control sequences . Remark 1 The source distribution in Equation 1 , ω∗ ( A | s ) , is used only for the estimation of empowerment . Another policy , π ( a | s ) , is calculated using empowerment as an intrinsic reward by either reinforcement learning ( Karl et al . ( 2019 ) ) or a 1-step greedy algorithm ( Jung et al . ( 2011 ) ; Salge et al . ( 2013 ) ) to reach the states with maximal empowerment . Strictly speaking , the source distribution ω maximizes the mutual information , ( i.e . estimates the empowerment ) , while the policy distribution π maximizes expected accumulated empowerment along trajectories . In general , the capacity of an arbitrary channel for a continuous random variable is unknown except for a few special cases such as the Gaussian linear channel , as reviewed below . As a result , past works have largely relied on variational lower bounds instead . 2.2.1 EMPOWERMENT BY VARIATIONAL LOWER BOUNDS . The mutual information in Equation 1 can be bounded from below as follows ( Mohamed & Rezende ( 2015 ) ; Gregor et al . ( 2017 ) ; Karl et al . ( 2019 ) ; Poole et al . ( 2019 ) ) : ∑ O , A p ( O , A | s ) log ( p ( A | O , s ) ω ( A | s ) ) = ∑ O , A p ( O , A | s ) log ( q ( A | O , s ) ω ( A | s ) ) +DKL [ p ( A | O , s ) || q ( A | O , s ) ] ≤ ∑ O , A p ( O , A | s ) log ( q ( A | O , s ) ω ( A | s ) ) ( 2 ) where q ( A | O , s ) and ω ( A | s ) are represented by neural networks with parameters φ and ψ respectively . The lower bound in Equation 2 can be estimated from samples using reinforcement learning with intrinsic reward r ( st , at ) = ∑T t log qφ ( at | ot , s ) − logωψ ( at | st ) , as detailed in ( Gregor et al . ( 2017 ) ; Karl et al . ( 2019 ) ) . To apply this variational lower bound on empowerment to unsupervised stabilization of dynamical systems one needs to learn three distributions : qφ ( at | ot , s ) and ωψ ( at | st ) for the lower bound in Equation 2 , and π ( a | s ) as the control policy ( see Remark 1 ) . Developing the mutual information in Equation 1 in the opposite direction , one gets another lower bound on empowerment , an approximation of which was used in ( Sharma et al . ( 2020 ) ) : ∑ O , A p ( O , A | s ) log ( p ( O | A , s ) ω ( O | s ) ) = ∑ O , A p ( O , A | s ) log ( q ( O | A , s ) ω ( O | s ) ) +DKL [ p ( O | A , s ) || q ( O | A , s ) ] ≤ ∑ O , A p ( O , A | s ) log ( q ( O | A , s ) ω ( O | s ) ) . ( 3 ) For sake of the clarity of the exposition , the above-explained variational empowerment is schematically depicted in Figure 1 . The controller policy , πθ ( a | s ) , collects transitions in environment , 3when the agent does not have an access to the true state , s , empowerment is calculated as the maximal mutual information between actuators and sensors given an estimated state . ( s , a , s′ ) . The source policy ωψ ( a | s ) generates the action a at every state s visited by the controller policy , and the environment transits to the next state , s′ ( yellow block ) . The inverse channel policy qφ ( a | s , s′ ) is regressed to a given s and and s′ , generating the intrinsic reward , C = logωψ ( a | s ) − log qφ ( a | s , s′ ) , which is used as the reward to improve the controller policy via reinforcement learning . This scheme aims to transfer the intrinsically motivated agent to the state of the maximal empowerment in the environment .
The paper proposes an new algorithm to simultaneously estimate and maximise empowerment for achieving unsupervised stabilization. The method relies on the formulation of a dynamic system as a linear Gaussian channel. In this formulation, empowerment can be efficiently estimated by solving a line search problem. The authors propose to learn the channel matrix G(s) from samples and exploit then linear formulation to learn a corresponding policy maximising empowerment. These two steps are done in an alternating fashion until convergence. In the experiments the method is compared to previous approaches for unsupervised control via empowerment. The authors show convergence close to the true empowerment landscape and prove the sample efficiency and low variance of their method. Additionally, their method is capable of unsupervised control based on image observations.
SP:dc768f825220140d0fa00fe2f63673803973c19c
Efficient Empowerment Estimation for Unsupervised Stabilization
1 INTRODUCTION . Intrinsic motivation allows artificial and biological agents to acquire useful behaviours without external knowledge ( Barto et al . ( 2004 ) ; Chentanez et al . ( 2005 ) ; Schmidhuber ( 2010 ) ; Barto ( 2013 ) ; Oudeyer et al . ( 2016 ) ) . In the framework of reinforcement learning ( RL ) , this external knowledge is usually provided by an expert through a task-specific reward , which is optimized by an artificial agent towards a desired behavior ( Mnih et al . ( 2013 ) ; Schulman et al . ( 2017 ) ) . In contrast , an intrinsic reward can arise solely from the interaction between the agent and environment , which eliminates the need for domain knowledge and reward engineering in some settings ( Mohamed & Rezende ( 2015 ) ; Houthooft et al . ( 2017 ) ; Pathak et al . ( 2017 ) ) . Previously , it was shown that maximizing mutual information ( Cover & Thomas ( 2012 ) ) between an agent ’ s actuators and sensors can guide the agent towards states in the environment with higher potential to achieve a larger number of eventual goals ( Klyubin et al . ( 2005 ) ; Wissner-Gross & Freer ( 2013 ) ) . Maximizing this kind of mutual information is known as the empowerment principle ( Klyubin et al . ( 2005 ) ; Salge et al . ( 2014 ) ) . Previously , it was found that an agent maximizing its empowerment converges to an unstable equilibrium of the environment in various dynamical control systems ( Jung et al . ( 2011 ) ; Salge et al . ( 2013 ) ; Karl et al . ( 2019 ) ) . In this application , ascending the gradient of the empowerment function coincides with the objective of optimal control for stabilization at an unstable equilibrium ( Strogatz ( 2018 ) ) , which is an important task for both engineering ( Todorov ( 2006 ) ) and 1Project page : https : //sites.google.com/view/latent-gce biological2 systems ; we refer to this as the essential property of empowerment . It follows from the aforementioned prior works that a plausible estimate of the empowerment function should possess this essential property . Empowerment has been found to be useful for a broad spectrum of applications , including : unsupervised skill discovery ( Sharma et al . ( 2020 ) ; Eysenbach et al . ( 2019 ) ; Gregor et al . ( 2017 ) ; Karl et al . ( 2019 ) ; Campos et al . ( 2020 ) ; human-agent coordination ( Salge & Polani ( 2017 ) ; Guckelsberger et al . ( 2016 ) ) ; assistance ( Du et al . ( 2021 ) ) ; and stabilization ( Tiomkin et al . ( 2017 ) ) . Past work has utilized variational lower bounds ( VLBs ) ( Poole et al . ( 2019 ) ; Alemi et al . ( 2017 ) ; Tschannen et al . ( 2020 ) ; Mohamed & Rezende ( 2015 ) ) to achieve an estimate of the empowerment . However , VLB approaches to empowerment in dynamical control systems ( Sharma et al . ( 2020 ) ; Achiam et al . ( 2018 ) ) have high sample complexity , are often unstable in training , and may be biased . Moreover , it was not previously studied if empowerment estimators learned via VLBs possess the essential properties of empowerment . In this work , we introduce a new method , Latent Gaussian Channel Empowerment ( Latent-GCE ) , for empowerment estimation and utilize the above-mentioned property as an “ indicator ” for the quality of the estimation . Specifically , we propose a particular representation for dynamical control systems using deep neural networks which is learned from state-action trajectories . This representation admits an efficient estimation of empowerment by convex optimization ( Cover & Thomas ( 2012 ) ) , both from raw state and from images . We propose an algorithm for simultaneous estimation and maximization of empowerment using standard RL algorithms such as Proximal Policy Optimization ( Schulman et al . ( 2017 ) ) , and Soft Actor-Critic ( Haarnoja et al . ( 2018 ) ) . We test our method on the task of unsupervised stabilization of dynamical systems with solely intrinsic reward , showing our estimator exhibits essential properties of the empowerment function . We demonstrate the advantages of our method through comparisons to the existing state-of-the-art empowerment estimators in different dynamical systems from the OpenAI Gym simulator ( Brockman et al . ( 2016 ) ) . We find that our method ( i ) has a lower sample complexity , ( ii ) is more stable in training , ( iii ) possesses the essential properties of the empowerment function , and ( iv ) allows us to accurately estimate empowerment from images . We hope such a review of the existing methods for empowerment estimation will help push this research direction . 2 PRELIMINARIES . In this section , we review the necessary background for our method , consisting of the reinforcement learning setting , various empowerment estimators , and the Gaussian channel capacity . We also review the underlying components in relevant prior work which we use for comparison to our method . 2.1 REINFORCEMENT LEARNING . The reinforcement learning ( RL ) setting is modeled as an infinite-horizon Markov Decision Process ( MDP ) defined by : the state space S , the action space A , the transition probabilities p ( s′|s , a ) , the initial state distribution p0 ( s ) , the reward function r ( s , a ) ∈ R , and the discount factor γ . The goal of RL is to find an optimal control policy π ( a|s ) that maximizes the expected return , i.e . maxπ Es0∼p0 , at∼π , st+1∼p [ ∑∞ t=0 γ tr ( st , at ) ] ( Sutton & Barto ( 2018 ) ) . 2.2 EMPOWERMENT . Interaction between an agent and its environment is plausibly described by the perception-action cycle ( PAC ) , ( Tishby & Polani ( 2011 ) ) , where the agent observes the state of the environment via its sensors and responds with its actuators . The maximal information rate from actuators to sensors is an inherent property of PAC which characterizes the empowerment of the agent , formally defined below . Empowerment ( Klyubin et al . ( 2005 ) ) is defined by the maximal mutual information rate ( Cover & Thomas ( 2012 ) ) between the agent ’ s sensor observations o ∈ O and actuators a ∈ A given the current state s ∈ S . It is fully specified by a fixed probability distribution of sensor observations conditioned 2Broadly speaking , an increase in the rate of information flow in the perception-action loop ( Tishby & Polani ( 2011 ) ) could be an impetus for the development of homosapiens , as hypothesized in ( Yuval ( 2014 ) ) . on the actuators and the state , p ( O | A , s ) , denoted by “ channel ” , and by a free probability of the actuator signals conditioned on the state , ω ( A | s ) , denoted by “ source ” . The empowerment E is the capacity of the channel , which is found via optimization of the source distribution ω ( A | s ) : E ( s ) = max ω ( A|s ) I [ O ; A | s ] = max ω ( A|s ) ∑ O , A p ( O , A | s ) log ( p ( A | O , s ) ω ( A | s ) ) ( 1 ) where I [ O ; A | s ] is the mutual information , reflecting the difference between the entropy of the sensor inputs , H ( O | s ) and the corresponding conditional entropy , H ( O | A , s ) 3 . In this work , we follow the original empowerment formulation ( Klyubin et al . ( 2005 ) ) , where A is an action sequence of length T starting from the state s and O is the resulting observation sequence . However , our method is applicable to other choices of observation and control sequences . Remark 1 The source distribution in Equation 1 , ω∗ ( A | s ) , is used only for the estimation of empowerment . Another policy , π ( a | s ) , is calculated using empowerment as an intrinsic reward by either reinforcement learning ( Karl et al . ( 2019 ) ) or a 1-step greedy algorithm ( Jung et al . ( 2011 ) ; Salge et al . ( 2013 ) ) to reach the states with maximal empowerment . Strictly speaking , the source distribution ω maximizes the mutual information , ( i.e . estimates the empowerment ) , while the policy distribution π maximizes expected accumulated empowerment along trajectories . In general , the capacity of an arbitrary channel for a continuous random variable is unknown except for a few special cases such as the Gaussian linear channel , as reviewed below . As a result , past works have largely relied on variational lower bounds instead . 2.2.1 EMPOWERMENT BY VARIATIONAL LOWER BOUNDS . The mutual information in Equation 1 can be bounded from below as follows ( Mohamed & Rezende ( 2015 ) ; Gregor et al . ( 2017 ) ; Karl et al . ( 2019 ) ; Poole et al . ( 2019 ) ) : ∑ O , A p ( O , A | s ) log ( p ( A | O , s ) ω ( A | s ) ) = ∑ O , A p ( O , A | s ) log ( q ( A | O , s ) ω ( A | s ) ) +DKL [ p ( A | O , s ) || q ( A | O , s ) ] ≤ ∑ O , A p ( O , A | s ) log ( q ( A | O , s ) ω ( A | s ) ) ( 2 ) where q ( A | O , s ) and ω ( A | s ) are represented by neural networks with parameters φ and ψ respectively . The lower bound in Equation 2 can be estimated from samples using reinforcement learning with intrinsic reward r ( st , at ) = ∑T t log qφ ( at | ot , s ) − logωψ ( at | st ) , as detailed in ( Gregor et al . ( 2017 ) ; Karl et al . ( 2019 ) ) . To apply this variational lower bound on empowerment to unsupervised stabilization of dynamical systems one needs to learn three distributions : qφ ( at | ot , s ) and ωψ ( at | st ) for the lower bound in Equation 2 , and π ( a | s ) as the control policy ( see Remark 1 ) . Developing the mutual information in Equation 1 in the opposite direction , one gets another lower bound on empowerment , an approximation of which was used in ( Sharma et al . ( 2020 ) ) : ∑ O , A p ( O , A | s ) log ( p ( O | A , s ) ω ( O | s ) ) = ∑ O , A p ( O , A | s ) log ( q ( O | A , s ) ω ( O | s ) ) +DKL [ p ( O | A , s ) || q ( O | A , s ) ] ≤ ∑ O , A p ( O , A | s ) log ( q ( O | A , s ) ω ( O | s ) ) . ( 3 ) For sake of the clarity of the exposition , the above-explained variational empowerment is schematically depicted in Figure 1 . The controller policy , πθ ( a | s ) , collects transitions in environment , 3when the agent does not have an access to the true state , s , empowerment is calculated as the maximal mutual information between actuators and sensors given an estimated state . ( s , a , s′ ) . The source policy ωψ ( a | s ) generates the action a at every state s visited by the controller policy , and the environment transits to the next state , s′ ( yellow block ) . The inverse channel policy qφ ( a | s , s′ ) is regressed to a given s and and s′ , generating the intrinsic reward , C = logωψ ( a | s ) − log qφ ( a | s , s′ ) , which is used as the reward to improve the controller policy via reinforcement learning . This scheme aims to transfer the intrinsically motivated agent to the state of the maximal empowerment in the environment .
The paper studies reward-free reinforcement learning (RL) methods based on empowerment. The authors propose a technique for empowerment estimation under the assumption that a state after H timesteps can be factorized as a product of the current action and a matrix G(s) that depends on the current state. In contrast to the existing methods that rely on the optimization of variational lower bounds on mutual information for empowerment estimation, the technique allows having an almost closed-form expression for empowerment. The authors qualitatively demonstrate the convergence of their method to the true empowerment function on simple environments such as 2D ball-in-box as well on image-based Pendulum environment.
SP:dc768f825220140d0fa00fe2f63673803973c19c
Pretrain Knowledge-Aware Language Models
1 INTRODUCTION . The strong effectiveness and rich generalization ability of pretrained language models ( PLMs ) ( 1 ; 2 ; 3 ; 4 ; 5 ) have raised many questions about what is captured in transformer networks and why . Recent explorations found the pretrained language models may “ rediscover ” the linguistic pipeline at various transformer layers ( 6 ) , can serve as implicit knowledge bases for relation extraction ( 7 ) , perform soft reasoning tasks ( 8 ; 9 ) , and conduct some language tasks reasonably in a fully unsupervised , zero-shot , fashion ( 3 ; 10 ) . With sufficiently large amount of parameters , i.e . several billions , and enough task-specific supervision , the pretrained language models can even directly generate answers for natural language questions , at the same accuracy with state-of-the-art reading comprehension systems , without using any context documents or knowledge graphs ( 11 ) . Impressive as they are , language models are still far from ready to serve as an “ unsupervised multi-task learner ” that learns knowledge directly from human language and generalizes to downstream language tasks ( 3 ) . There are notable gaps of language models ’ performances on downstream tasks between models with ( 11 ; 12 ) and without ( 3 ) large amounts of task-specific fine-tuning . The language models still ( de- ) generate dull , factually-incorrect , or dream-like text when used in natural language generation ( 13 ; 14 ; 15 ; 16 ) . These challenges often necessitate over-parameterization ( 17 ) , grounding on external structural semantics ( 14 ; 16 ; 18 ; 19 ) , or large amount of task-specific fine-tuning ( 11 ) , which are costly , complicated , and not always feasible for every language task . One potential limitation of these language models is their style of pretraining , e.g , auto-regressive language modeling ( 3 ) or masked language modeling ( 1 ) , wherein transformer networks process a sequence of words and are asked to predict the next/masked words . There is no explicit guidance to the transformers that humans prefer them to capture correct , real-world information . As a result , all the knowledge captured in these pretrained language models is only signaled by patterns of co-occuring words in the input sequence that is learned implicitly during pretraining . In this paper , instead of creating bigger models or adding knowledge-specific architectures , we propose to more efficiently leverage the existing parameters in the standard transformer language model , by simply making them aware of the various forms an entity can manifest itself as , and its role in the surrounding text . More specifically , this knowledge-awareness is communicated via the input fed to PLMs and in the output expected from them during pretraining . For input-awareness , we use an entity-name ( surface form ) dictionary that tokenizes word spans to their most popularly referred-to entity , e.g. , as fuzzy frequency-based entity annotations ( 20 ) , and serve these entity tokens as a parallel input channel along with the word tokens . For output-awareness , in addition to the language modeling objective , we add an entity prediction task that guides the model to distinguish the correct entity from various negative distractions . The two objectives together explicitly guide the language model to predict not only the correct words , but also the correct entity behind those words during pretraining , without changing the network architecture . By adding knowledge awareness to GPT-2 style auto-regressive language models , our pretrained language model , “ Knowledge-Aware Language Model ” ( KALM ) , shows significantly improved handling of knowledge-sensitive tasks . In the LAMA knowledge probing tasks ( 7 ) , KALM outperforms its entity-unaware baseline , GPT-2 , by about 25 % across all tasks at both base and large transformer sizes . Our 24 layer KALM ( Large ) is even comparable with the 17 Billion parameter GPT-2 on some tasks . It more accurately captures commonsense knowledge , factual semantics , and also relation semantics in these LAMA tests . The knowledge signals also aid generic language understanding : we have observed better language modeling perplexity and word prediction accuracy with KALM too . The advantages in language modeling also transfer to downstream tasks . In zero-shot question answering , the exact match accuracy of the answers generated by KALM are 20 % -100 % better than those of an equivalent GPT-2 model . We did not use any task-specific supervision or additional gradient updates , relying solely on the unsupervised knowledge learned in KALM . We only feed in a few example question-answer pairs as templates to format how generated answers should look . Injecting rich knowledge signals leads to improvements approximately equal to those gained by doubling the transformer layers , indicating that PLMs can be trained more efficiently – growing the parameters exponentially is not the only way to improve language understanding . To better understand pretraining and the advantage of knowledge awareness , we leverage the edge probe technique ( 6 ; 21 ) and dissect what is learned in the representations at various gradient step numbers throughout pretraining . We observe that the auto-regressive transformers start to learn the basis of language in the beginning of the pretraining , and gradually learns more complex semantics in the process ; adding knowledge-awareness greatly accelerates learning of higher level semantics , e.g. , coreferences and entity types , and helps the model perform better in those more complicated tasks . 2 PRETRAINING KNOWLEDGE-AWARE LANGUAGE MODELS . In this section we first present preliminaries in language modeling and then how we add knowledgeawareness in their pretraining . 2.1 PRELIMINARY . In this paper , without loss of generality , we mainly focus on the auto-regressive language modeling . Considering the text X as a sequence of tokens ( words or sub-words ) : X = { w1 , ... , wi , ... , wn } , the classical unidirectional factorization of language probabilities ( 22 ; 23 ) describes : p ( X ) = ∏ i p ( wi|w < i ) , ( 1 ) where w < i refers to all the tokens appear before i . This conditional probability can be parameterized in various ways . An effective choice is to use the uni-directional transformer , as done in GPT-2 ( 3 ) : p ( wi|w < i ) = transformer ( wi|w < i ) . The language modeling task provides a large amount of data to pretrain very deep transformer networks ( 5 ; 24 ; 25 ) . Scaling up the transformer parameter sizes will lead to significant improvements in the language model capability : with wider and deeper transformer layers , it is observed that transformer language models start to output more complicated semantics beyond lexical and syntactic patterns ( 6 ; 8 ; 7 ) . On the other hand , a roughly log-linear relationship between transformer size and output quality has been established , e.g . doubling the quality requires ten times more parameters and training data ( 3 ; 17 ; 10 ) . Even in industry , the marginal gain of increasing parameters will eventually be outweighed by the cost to train and serve such models . 2.2 KNOWLEDGE-AWARE PRETRAINING . As shown in Eqn . 1 , the pretraining is solely at the token level . All the semantics in PLMs are captured by the transformer indirectly ; there is no explicit requirement in pretraining to better capture knowledge – yet we expect them capture knowledge beneath the raw word sequences implicitly , e.g. , to generate factually correct statements . In this work we mitigate this discrepancy by making transformer networks aware of knowledge in language model pretraining . Instead of stacking more layers or adding external knowledge storage , we present a knowledge-aware language modeling ( KALM ) framework that packs more information into the same amount of transformer parameters . The first step to introduce knowledge awareness is an entity tokenizer that forms an additional entity token sequence ( 26 ) to signal the existence of entities in the input and output of the pretraining process . Entity Tokenizer . An entity tokenizer segments the text sequence into entity ids using a surface form dictionary , which maps word-ngrams to entities : wi : i+k dict look up−−−−−−→ ei , where ei is the most popular entity referred by the word k-gram wi : i+k , and ei = null if wi is not part of any known entity surface names . This simple dictionary look-up can be conducted efficiently , similar to the ( sub ) word tokenizer . Simultaneously , the text is tokenized into two channels – a word-entity duet token sequence ( 26 ) : Xduet = { { w1 , ... , wi , ... , wT } Word Sequence ; { e1 , ... , ei , ... , eT } Entity Sequence . ( 2 ) The two sequences are aligned position by position . If multiple ( sub ) words together form an entity name , the corresponding entity id is duplicated in each position corresponding to these words . For example , the name “ United States ” at wi : i+2 is mapped to entity “ USA ” in ei and ei+1 . Instead of enlisting a more precise entity linker or supervisions from entity labels ( 16 ; 18 ) , a fuzzy frequency-based dictionary look up places higher expectations on the model to use clues in the text to jointly build token and entity representations that better reflect how language conveys knowledge . Using a highly tuned entity linker would propagate its own biases into the transformer . Knowledge-Aware Input . Just as there is an input embedding for every word token , we allow the model to learn an entity embedding for each entity : ~ei = Embeddinge ( ei ) ∈ Rde , ( 3 ) ~wi = Embeddingw ( wi ) ∈ Rdw . ( 4 ) The two embeddings are combined to form the knowledge aware input : ~ti = ~wi + Lineart ( ~ei ) , Lineart ∈ Rde×dw . ( 5 ) All the embeddings are randomly initialized and learned in pretraining . Knowledge-Aware Output . The knowledge-aware input is fed into standard transformer layers , the same as the word-only input . Then in pretraining , besides the next-word prediction task , we also employ a next-entity prediction task to further incorporate knowledge-awareness . Specifically , we use one output head for the word probability , one for the entity , and share all transformer layers between words and entities . If there are L transformer layers and hLi is the output of the final layer ’ s i-th token , the loss for position i is computed as le ( ei|t < i ) = max ( 0 , s ( ~hi L , ~ei ) − s ( ~hi L , ~e− ) + λ ) , ( 6 ) s ( ~hi L , ~ej ) = cos ( Linear ( ~hi L ) , ~ej ) , ( 7 ) ~hi L = transformerL ( t < i ) . ( 8 ) The transformers in Eqn . 8 are stacked multiple times similar to GPT-2 . The scoring function in Eqn . 7 projects the hidden state into the embedding space with a Linear layer and takes the cosine similarity with an arbitrary entity ej . Assuming that position i is linked by our entity linker to ei , we carefully choose a corresponding negative entity e− to contrast with ei using margin loss with margin λ in Eqn . 6 . Pretraining . The knowledge-aware input and output are incorporated in the standard multi-task set up for our KALM knowledge-aware language model pretraining : lKALM ( Xduet ) = ∑ i lw ( p ( wi|t < i ) ) + αle ( ei|t < i ) . ( 9 ) It combines the language modeling loss lw ( ) – cross-entropy as in standard PLMs – with the entity prediction loss le ( ) , where α is a hyper-parameter to balance the two . Inference . At inference time – whenever generating output text – KALM use the word prediction head p ( wi|t < i ) , which is consistent with GPT-2 . The entity prediction task is an auxiliary task that guides the model to attend to the entity semantics during pretraining ; in inference only the shared transformer representations is used upon the input word and entity tokens . Compared with the standard GPT-2 style PLMs , the architecture of KALM only differs with an enlarged tokenization vocabulary with additional entity tokens , and their entity embeddings before the input to the transformer network . The transformer architecture and its layer configurations are kept consistent .
This paper presents a knowledge-aware language model pretraining method without changing model architecture. Specifically, they add entity prediction task along with language modeling task to make the model aware of knowledge. Experiments show improved results on the LAMA knowledge probing task compared to GPT-2 models. They also show comparable results on zero-shot question answering task, even with only 2% transformer parameters compared to GPT-2 17B.
SP:1f15c0a7d7bdf113c303a89650afb22f9d56abad
Pretrain Knowledge-Aware Language Models
1 INTRODUCTION . The strong effectiveness and rich generalization ability of pretrained language models ( PLMs ) ( 1 ; 2 ; 3 ; 4 ; 5 ) have raised many questions about what is captured in transformer networks and why . Recent explorations found the pretrained language models may “ rediscover ” the linguistic pipeline at various transformer layers ( 6 ) , can serve as implicit knowledge bases for relation extraction ( 7 ) , perform soft reasoning tasks ( 8 ; 9 ) , and conduct some language tasks reasonably in a fully unsupervised , zero-shot , fashion ( 3 ; 10 ) . With sufficiently large amount of parameters , i.e . several billions , and enough task-specific supervision , the pretrained language models can even directly generate answers for natural language questions , at the same accuracy with state-of-the-art reading comprehension systems , without using any context documents or knowledge graphs ( 11 ) . Impressive as they are , language models are still far from ready to serve as an “ unsupervised multi-task learner ” that learns knowledge directly from human language and generalizes to downstream language tasks ( 3 ) . There are notable gaps of language models ’ performances on downstream tasks between models with ( 11 ; 12 ) and without ( 3 ) large amounts of task-specific fine-tuning . The language models still ( de- ) generate dull , factually-incorrect , or dream-like text when used in natural language generation ( 13 ; 14 ; 15 ; 16 ) . These challenges often necessitate over-parameterization ( 17 ) , grounding on external structural semantics ( 14 ; 16 ; 18 ; 19 ) , or large amount of task-specific fine-tuning ( 11 ) , which are costly , complicated , and not always feasible for every language task . One potential limitation of these language models is their style of pretraining , e.g , auto-regressive language modeling ( 3 ) or masked language modeling ( 1 ) , wherein transformer networks process a sequence of words and are asked to predict the next/masked words . There is no explicit guidance to the transformers that humans prefer them to capture correct , real-world information . As a result , all the knowledge captured in these pretrained language models is only signaled by patterns of co-occuring words in the input sequence that is learned implicitly during pretraining . In this paper , instead of creating bigger models or adding knowledge-specific architectures , we propose to more efficiently leverage the existing parameters in the standard transformer language model , by simply making them aware of the various forms an entity can manifest itself as , and its role in the surrounding text . More specifically , this knowledge-awareness is communicated via the input fed to PLMs and in the output expected from them during pretraining . For input-awareness , we use an entity-name ( surface form ) dictionary that tokenizes word spans to their most popularly referred-to entity , e.g. , as fuzzy frequency-based entity annotations ( 20 ) , and serve these entity tokens as a parallel input channel along with the word tokens . For output-awareness , in addition to the language modeling objective , we add an entity prediction task that guides the model to distinguish the correct entity from various negative distractions . The two objectives together explicitly guide the language model to predict not only the correct words , but also the correct entity behind those words during pretraining , without changing the network architecture . By adding knowledge awareness to GPT-2 style auto-regressive language models , our pretrained language model , “ Knowledge-Aware Language Model ” ( KALM ) , shows significantly improved handling of knowledge-sensitive tasks . In the LAMA knowledge probing tasks ( 7 ) , KALM outperforms its entity-unaware baseline , GPT-2 , by about 25 % across all tasks at both base and large transformer sizes . Our 24 layer KALM ( Large ) is even comparable with the 17 Billion parameter GPT-2 on some tasks . It more accurately captures commonsense knowledge , factual semantics , and also relation semantics in these LAMA tests . The knowledge signals also aid generic language understanding : we have observed better language modeling perplexity and word prediction accuracy with KALM too . The advantages in language modeling also transfer to downstream tasks . In zero-shot question answering , the exact match accuracy of the answers generated by KALM are 20 % -100 % better than those of an equivalent GPT-2 model . We did not use any task-specific supervision or additional gradient updates , relying solely on the unsupervised knowledge learned in KALM . We only feed in a few example question-answer pairs as templates to format how generated answers should look . Injecting rich knowledge signals leads to improvements approximately equal to those gained by doubling the transformer layers , indicating that PLMs can be trained more efficiently – growing the parameters exponentially is not the only way to improve language understanding . To better understand pretraining and the advantage of knowledge awareness , we leverage the edge probe technique ( 6 ; 21 ) and dissect what is learned in the representations at various gradient step numbers throughout pretraining . We observe that the auto-regressive transformers start to learn the basis of language in the beginning of the pretraining , and gradually learns more complex semantics in the process ; adding knowledge-awareness greatly accelerates learning of higher level semantics , e.g. , coreferences and entity types , and helps the model perform better in those more complicated tasks . 2 PRETRAINING KNOWLEDGE-AWARE LANGUAGE MODELS . In this section we first present preliminaries in language modeling and then how we add knowledgeawareness in their pretraining . 2.1 PRELIMINARY . In this paper , without loss of generality , we mainly focus on the auto-regressive language modeling . Considering the text X as a sequence of tokens ( words or sub-words ) : X = { w1 , ... , wi , ... , wn } , the classical unidirectional factorization of language probabilities ( 22 ; 23 ) describes : p ( X ) = ∏ i p ( wi|w < i ) , ( 1 ) where w < i refers to all the tokens appear before i . This conditional probability can be parameterized in various ways . An effective choice is to use the uni-directional transformer , as done in GPT-2 ( 3 ) : p ( wi|w < i ) = transformer ( wi|w < i ) . The language modeling task provides a large amount of data to pretrain very deep transformer networks ( 5 ; 24 ; 25 ) . Scaling up the transformer parameter sizes will lead to significant improvements in the language model capability : with wider and deeper transformer layers , it is observed that transformer language models start to output more complicated semantics beyond lexical and syntactic patterns ( 6 ; 8 ; 7 ) . On the other hand , a roughly log-linear relationship between transformer size and output quality has been established , e.g . doubling the quality requires ten times more parameters and training data ( 3 ; 17 ; 10 ) . Even in industry , the marginal gain of increasing parameters will eventually be outweighed by the cost to train and serve such models . 2.2 KNOWLEDGE-AWARE PRETRAINING . As shown in Eqn . 1 , the pretraining is solely at the token level . All the semantics in PLMs are captured by the transformer indirectly ; there is no explicit requirement in pretraining to better capture knowledge – yet we expect them capture knowledge beneath the raw word sequences implicitly , e.g. , to generate factually correct statements . In this work we mitigate this discrepancy by making transformer networks aware of knowledge in language model pretraining . Instead of stacking more layers or adding external knowledge storage , we present a knowledge-aware language modeling ( KALM ) framework that packs more information into the same amount of transformer parameters . The first step to introduce knowledge awareness is an entity tokenizer that forms an additional entity token sequence ( 26 ) to signal the existence of entities in the input and output of the pretraining process . Entity Tokenizer . An entity tokenizer segments the text sequence into entity ids using a surface form dictionary , which maps word-ngrams to entities : wi : i+k dict look up−−−−−−→ ei , where ei is the most popular entity referred by the word k-gram wi : i+k , and ei = null if wi is not part of any known entity surface names . This simple dictionary look-up can be conducted efficiently , similar to the ( sub ) word tokenizer . Simultaneously , the text is tokenized into two channels – a word-entity duet token sequence ( 26 ) : Xduet = { { w1 , ... , wi , ... , wT } Word Sequence ; { e1 , ... , ei , ... , eT } Entity Sequence . ( 2 ) The two sequences are aligned position by position . If multiple ( sub ) words together form an entity name , the corresponding entity id is duplicated in each position corresponding to these words . For example , the name “ United States ” at wi : i+2 is mapped to entity “ USA ” in ei and ei+1 . Instead of enlisting a more precise entity linker or supervisions from entity labels ( 16 ; 18 ) , a fuzzy frequency-based dictionary look up places higher expectations on the model to use clues in the text to jointly build token and entity representations that better reflect how language conveys knowledge . Using a highly tuned entity linker would propagate its own biases into the transformer . Knowledge-Aware Input . Just as there is an input embedding for every word token , we allow the model to learn an entity embedding for each entity : ~ei = Embeddinge ( ei ) ∈ Rde , ( 3 ) ~wi = Embeddingw ( wi ) ∈ Rdw . ( 4 ) The two embeddings are combined to form the knowledge aware input : ~ti = ~wi + Lineart ( ~ei ) , Lineart ∈ Rde×dw . ( 5 ) All the embeddings are randomly initialized and learned in pretraining . Knowledge-Aware Output . The knowledge-aware input is fed into standard transformer layers , the same as the word-only input . Then in pretraining , besides the next-word prediction task , we also employ a next-entity prediction task to further incorporate knowledge-awareness . Specifically , we use one output head for the word probability , one for the entity , and share all transformer layers between words and entities . If there are L transformer layers and hLi is the output of the final layer ’ s i-th token , the loss for position i is computed as le ( ei|t < i ) = max ( 0 , s ( ~hi L , ~ei ) − s ( ~hi L , ~e− ) + λ ) , ( 6 ) s ( ~hi L , ~ej ) = cos ( Linear ( ~hi L ) , ~ej ) , ( 7 ) ~hi L = transformerL ( t < i ) . ( 8 ) The transformers in Eqn . 8 are stacked multiple times similar to GPT-2 . The scoring function in Eqn . 7 projects the hidden state into the embedding space with a Linear layer and takes the cosine similarity with an arbitrary entity ej . Assuming that position i is linked by our entity linker to ei , we carefully choose a corresponding negative entity e− to contrast with ei using margin loss with margin λ in Eqn . 6 . Pretraining . The knowledge-aware input and output are incorporated in the standard multi-task set up for our KALM knowledge-aware language model pretraining : lKALM ( Xduet ) = ∑ i lw ( p ( wi|t < i ) ) + αle ( ei|t < i ) . ( 9 ) It combines the language modeling loss lw ( ) – cross-entropy as in standard PLMs – with the entity prediction loss le ( ) , where α is a hyper-parameter to balance the two . Inference . At inference time – whenever generating output text – KALM use the word prediction head p ( wi|t < i ) , which is consistent with GPT-2 . The entity prediction task is an auxiliary task that guides the model to attend to the entity semantics during pretraining ; in inference only the shared transformer representations is used upon the input word and entity tokens . Compared with the standard GPT-2 style PLMs , the architecture of KALM only differs with an enlarged tokenization vocabulary with additional entity tokens , and their entity embeddings before the input to the transformer network . The transformer architecture and its layer configurations are kept consistent .
This paper proposes KALM - a knowledge-aware language model that incorporates entity information. Specifically, the method involves using a dictionary lookup to match n-grams to entities from a database. Then, each token is embedded into two vectors — one using the surface form, and one using the entity ID it is matched to (if there is a match). These embeddings are then added and passed into a Transformer model to predict the next word given the context. Experiments compare the model to GPT-2 and T5 (two state-of-the art Transformer-based LMs) and demonstrate the benefit of adding entity information.
SP:1f15c0a7d7bdf113c303a89650afb22f9d56abad
Nonseparable Symplectic Neural Networks
1 INTRODUCTION . A Hamiltonian dynamic system refers to a formalism for modeling a physical system exhibiting some specific form of energy conservation during its temporal evolution . A typical example is a pendulum whose total energy ( referred to as the system ’ s Hamiltonian ) is conserved as a temporally invariant sum of its kinematic energy and potential energy . Mathematically , such energy conservation indicates a specific geometric structure underpinning its time integration , named as a symplectic structure , which further spawns a wide range of numerical time integrators to model Hamiltonian systems . These symplectic time integrators have proven their effectiveness in simulating a variety of energy-conserving dynamics when Hamiltonian expressions are known as a prior . Examples encompass applications in plasma physics ( Morrison , 2005 ) , electromagnetics ( Li et al. , 2019 ) , fluid mechanics ( Salmon , 1988 ) , and celestial mechanics ( Saari & Xia , 1996 ) , to name a few . On another front , the emergence of the various machine learning paradigms with their particular focus on uncovering the hidden invariant quantities and their evolutionary structures enable a faithful prediction of Hamiltonian dynamics without knowing its analytical energy expression beforehand . The key mechanics underpinning these learning models lie in a proper embedding of the strong mathematical inductive priors to ensure Hamiltonian conservation in a neural network data flow . Typically , such priors are realized in a variational way or a structured way . For example , in Greydanus et al . ( 2019 ) , the Hamiltonian conservation is encoded in the loss function . This category of methods does not assume any combinatorial pattern of the energy term and therefore relies on the inherent expressiveness of neural networks to distill the Hamiltonian structure from abundant training datasets ( Choudhary et al. , 2019 ) . Another category of Hamiltonian networks , which we refer to as structured approaches , implements the conservation law indirectly by embedding a symplectic time integrator ( DiPietro et al. , 2020 ; Tong et al. , 2020 ; Chen et al. , 2020 ) or composition of linear , activation , and gradient modules ( Jin et al. , 2020 ) into the network architecture . ∗shiying.xiong @ dartmouth.edu . One of the main limitations of the current structured methods lies in the separable assumption of the Hamiltonian expression . Examples of separable Hamiltonian systems include the pendulum , the Lotka–Volterra ( Zhu et al. , 2016 ) , the Kepler ( Antohe & Gladwell , 2004 ) , and the Hénon–Heiles systems ( Zotos , 2015 ) . However , beyond this scope , there exist various nonseparable systems whose Hamiltonian has no explicit expression to decouple the position and momentum energies . Examples include incompressible flows ( Suzuki et al. , 2007 ) , quantum systems ( Bonnabel et al. , 2009 ) , rigid body dynamics ( Chadaj et al. , 2017 ) , charged particle dynamics ( Zhang et al. , 2016 ) , and nonlinear Schrödinger equation ( Brugnano et al. , 2018 ) . This nonseparability typically causes chaos and instability , which further complicates the systems ’ dynamics . Although SympNet in Jin et al . ( 2020 ) can be used to learn and predict nonseparable Hamiltonian systems , multiple matrices of the same order with system dimension are needed in the training process of SympNet , resulting in difficulties in generalizing into high-dimensional large-scale N-body problems which are common in a series of nonseparable Hamiltonian systems , such as quantum multibody problems and vortexparticle dynamics problems . Such chaotic and large-scale nature jointly adds shear difficulties for a conventional machine learning model to deliver faithful predictions . In this paper , we propose an effective machine learning paradigm to predict nonseparable Hamiltonian systems . We build a novel neural network architecture , named nonseparable symplectic neural networks ( NSSNNs ) , to enable accurate and robust predictions of long-term Hamiltonian dynamics based on short-term observation data . Our proposed method belongs to the category of structured network architectures : it intrinsically embeds the symplectomorphism into the network design to strictly preserve the symplectic evolution and further conserves the unknown , nonseparable Hamiltonian energy . The enabling techniques we adopted in our learning framework consist of an augmented symplectic time integrator to asymptotically “ decouple ” the position and momentum quantities that were nonseparable in their original form . We also introduce the Lagrangian multiplier in the augmented phase space to improve the system ’ s numerical stability . Our network design is motivated by ideas originated from physics ( Tao , 2016 ) and optimization ( Boyd et al. , 2004 ) . The combination of these mathematical observations and numerical paradigms enables a novel neural network architecture that can drastically enhance both the scale and scope of the current predictions . We show a motivational example in Figure 1 by comparing our approach with a traditional HNN method ( Greydanus et al. , 2019 ) regarding their structural designs and predicting abilities . We refer the readers to Section 6 for a detailed discussion . As shown in Figure 1 , the vortices evolved using NSSNN are separated nicely as the ground truth , while the vortices merge together using HNN due to the failure of conserving the symplectic structure of a nonseparable system . The conservative capability of NSSNN springs from our design of the auxiliary variables ( red x and y ) which converts the original nonseparable system into a higher dimensional quasi-separable system where we can adopt a symplectic integrator . 2 RELATED WORKS . Data-driven physical prediction . Data-driven approaches have been widely applied in physical systems including fluid mechanics ( Brunton et al. , 2020 ) , wave physics ( Hughes et al. , 2019 ) , quantum physics ( Sellier et al. , 2019 ) , thermodynamics ( Hernandez et al. , 2020 ) , and material science ( Teicherta et al. , 2019 ) . Among these different physical systems , data-driven fluid receives increasing attention . We refer the readers to Brunton et al . ( 2020 ) for a thorough survey of the fundamental machine learning methodologies as well as their uses for understanding , modeling , optimizing , and controlling fluid flows in experiments and simulations based on training data . One of the motivations of our work is to design a versatile learning approach that can predict complex fluid motions . On another front , many pieces of research focus on incorporating physical priors into the learning framework , e.g. , by enforcing incompressibility ( Mohan et al. , 2020 ) , the Galilean invariance ( Ling et al. , 2016 ) , quasistatic equilibrium ( Geng et al. , 2020 ) , the Lagrangian invariance ( Cranmer et al. , 2020 ) , and Hamiltonian conservation ( Hernandez et al. , 2020 ; Greydanus et al. , 2019 ; Jin et al. , 2020 ; Zhong et al. , 2020 ) . Here , inspired by the idea of embedding physics priors into neural networks , we aim to accelerate the learning process and improve the accuracy of our model . Neural networks for Hamiltonian systems . Greydanus et al . ( 2019 ) introduced Hamiltonian neural networks ( HNNs ) to conserve the Hamiltonian energy of the system by reformulating the loss function . Inspired by HNN , a series of methods intrinsically embedding a symplectic integrator into the recurrent neural network was proposed , such as SRNN ( Chen et al. , 2020 ) , TaylorNet ( Tong et al. , 2020 ) and SSINN ( DiPietro et al. , 2020 ) , to solve separable Hamiltonian systems . Combined with graph networks ( Sanchez-Gonzalez et al. , 2019 ; Battaglia et al. , 2016 ) , these methods were further generalized to large-scale N-body problems induced by interaction force between the particle pairs . Jin et al . ( 2020 ) proposed SympNet by directly constructing the symplectic mapping of system variables within neighboring time steps to handle both separable and nonseparable Hamiltonian systems . However , the scale of parameters in SympNet for training N dimensional Hamiltonian system is O ( N2 ) , which makes it hard to be generalized to the high dimensional N-body problems . Our NSSNN overcomes these limitations by devising a new Hamiltonian network architecture that is specifically suited for nonseparable systems ( see details in Section 5 ) . In addition , the Hamiltonianbased neural networks can be extended to further applications . Toth et al . ( 2020 ) developed the Hamiltonian Generative Network ( HGN ) to learn Hamiltonian dynamics from high-dimensional observations ( such as images ) . Moreover , Zhong et al . ( 2020 ) introduced Symplectic ODE-Net ( SymODEN ) , which adds an external control term to the standard Hamiltonian dynamics . 3 FRAMEWORK . 3.1 AUGMENTED HAMILTONIAN EQUATION . We start by considering a Hamiltonian system with N pairs of canonical coordinates ( i.e . N generalized positions and N generalized momentum ) . The time evolution of canonical coordinates is governed by the symplectic gradient of the Hamiltonian ( Hand & Finch , 2008 ) . Specifically , the time evolution of the system is governed by Hamilton ’ s equations as dq dt = ∂H ∂p , dp dt = −∂H ∂q , ( 1 ) with the initial condition ( q , p ) |t=t0 = ( q0 , p0 ) . In a general setting , q = ( q1 , q2 , · · · , qN ) represents the positions and p = ( p1 , p2 , ... pN ) denotes their momentum . Function H = H ( q , p ) is the Hamiltonian , which corresponds to the total energy of the system . An important feature of Hamilton ’ s equations is its symplectomorphism ( see Appendix B for a detailed overview ) . The symplectic structure underpinning our proposed network architecture draws inspirations from the original research of Tao ( 2016 ) in computational physics . In Tao ( 2016 ) , a generic , high-order , explicit and symplectic time integrator was proposed to solve ( 1 ) of an arbitrary separable and nonseparable HamiltonianH . This is implemented by considering an augmented Hamiltonian H ( q , p , x , y ) : = HA +HB + ωHC ( 2 ) with HA = H ( q , y ) , HB = H ( x , p ) , HC = 1 2 ( ‖q − x‖22 + ‖p− y‖22 ) ( 3 ) in an extended phase space with symplectic two form dq ∧ dp+ dx ∧ dy , where ω is a constant that controls the binding of the original system and the artificial restraint . Notice that the Hamilton ’ s equations forH dq dt = ∂H ∂p = ∂H ( x , p ) ∂p + ω ( p− y ) , dp dt = −∂H ∂q = −∂H ( q , y ) ∂q − ω ( q − x ) , dx dt = ∂H ∂y = ∂H ( q , y ) ∂y − ω ( p− y ) , dy dt = −∂H ∂x = −∂H ( x , p ) ∂x + ω ( q − x ) , ( 4 ) with the initial condition ( q , p , x , y ) |t=t0 = ( q0 , p0 , q0 , p0 ) have the same exact solution as ( 1 ) in the sense that ( q , p , x , y ) = ( q , p , q , p ) . Hence , we can get the solution of ( 1 ) by solving ( 4 ) . Furthermore , it is possible to construct high-order symplectic integrators forH in ( 4 ) with explicit updates . Our model aims to learn the dynamical evolution of ( q , p ) in ( 1 ) by embedding ( 4 ) into the framework of NeuralODE ( Chen et al. , 2018 ) . The coefficient ω acts as a regularizer , which stabilizes the numerical results ( see Section 4 ) .
The paper extends the symplectic family of network architectures towards modeling nonseparable Hamiltonian dynamic systems. More specifically, the paper implements a symplectic integration schema (from Tao (2016)) for solving arbitrary nonseparable (and separable) Hamiltonian systems within a symplectic neural network architecture. The results from several modeling tasks show that the proposed Nonseparable Symplectic NNs (NSSNNs) are more robust and accurate than vanilla HNNs and NeuralODEs when applied to nonseparable Hamiltonian systems.
SP:b2243f53f080e0babbc6061de7e2c2059a8d0cf0
Nonseparable Symplectic Neural Networks
1 INTRODUCTION . A Hamiltonian dynamic system refers to a formalism for modeling a physical system exhibiting some specific form of energy conservation during its temporal evolution . A typical example is a pendulum whose total energy ( referred to as the system ’ s Hamiltonian ) is conserved as a temporally invariant sum of its kinematic energy and potential energy . Mathematically , such energy conservation indicates a specific geometric structure underpinning its time integration , named as a symplectic structure , which further spawns a wide range of numerical time integrators to model Hamiltonian systems . These symplectic time integrators have proven their effectiveness in simulating a variety of energy-conserving dynamics when Hamiltonian expressions are known as a prior . Examples encompass applications in plasma physics ( Morrison , 2005 ) , electromagnetics ( Li et al. , 2019 ) , fluid mechanics ( Salmon , 1988 ) , and celestial mechanics ( Saari & Xia , 1996 ) , to name a few . On another front , the emergence of the various machine learning paradigms with their particular focus on uncovering the hidden invariant quantities and their evolutionary structures enable a faithful prediction of Hamiltonian dynamics without knowing its analytical energy expression beforehand . The key mechanics underpinning these learning models lie in a proper embedding of the strong mathematical inductive priors to ensure Hamiltonian conservation in a neural network data flow . Typically , such priors are realized in a variational way or a structured way . For example , in Greydanus et al . ( 2019 ) , the Hamiltonian conservation is encoded in the loss function . This category of methods does not assume any combinatorial pattern of the energy term and therefore relies on the inherent expressiveness of neural networks to distill the Hamiltonian structure from abundant training datasets ( Choudhary et al. , 2019 ) . Another category of Hamiltonian networks , which we refer to as structured approaches , implements the conservation law indirectly by embedding a symplectic time integrator ( DiPietro et al. , 2020 ; Tong et al. , 2020 ; Chen et al. , 2020 ) or composition of linear , activation , and gradient modules ( Jin et al. , 2020 ) into the network architecture . ∗shiying.xiong @ dartmouth.edu . One of the main limitations of the current structured methods lies in the separable assumption of the Hamiltonian expression . Examples of separable Hamiltonian systems include the pendulum , the Lotka–Volterra ( Zhu et al. , 2016 ) , the Kepler ( Antohe & Gladwell , 2004 ) , and the Hénon–Heiles systems ( Zotos , 2015 ) . However , beyond this scope , there exist various nonseparable systems whose Hamiltonian has no explicit expression to decouple the position and momentum energies . Examples include incompressible flows ( Suzuki et al. , 2007 ) , quantum systems ( Bonnabel et al. , 2009 ) , rigid body dynamics ( Chadaj et al. , 2017 ) , charged particle dynamics ( Zhang et al. , 2016 ) , and nonlinear Schrödinger equation ( Brugnano et al. , 2018 ) . This nonseparability typically causes chaos and instability , which further complicates the systems ’ dynamics . Although SympNet in Jin et al . ( 2020 ) can be used to learn and predict nonseparable Hamiltonian systems , multiple matrices of the same order with system dimension are needed in the training process of SympNet , resulting in difficulties in generalizing into high-dimensional large-scale N-body problems which are common in a series of nonseparable Hamiltonian systems , such as quantum multibody problems and vortexparticle dynamics problems . Such chaotic and large-scale nature jointly adds shear difficulties for a conventional machine learning model to deliver faithful predictions . In this paper , we propose an effective machine learning paradigm to predict nonseparable Hamiltonian systems . We build a novel neural network architecture , named nonseparable symplectic neural networks ( NSSNNs ) , to enable accurate and robust predictions of long-term Hamiltonian dynamics based on short-term observation data . Our proposed method belongs to the category of structured network architectures : it intrinsically embeds the symplectomorphism into the network design to strictly preserve the symplectic evolution and further conserves the unknown , nonseparable Hamiltonian energy . The enabling techniques we adopted in our learning framework consist of an augmented symplectic time integrator to asymptotically “ decouple ” the position and momentum quantities that were nonseparable in their original form . We also introduce the Lagrangian multiplier in the augmented phase space to improve the system ’ s numerical stability . Our network design is motivated by ideas originated from physics ( Tao , 2016 ) and optimization ( Boyd et al. , 2004 ) . The combination of these mathematical observations and numerical paradigms enables a novel neural network architecture that can drastically enhance both the scale and scope of the current predictions . We show a motivational example in Figure 1 by comparing our approach with a traditional HNN method ( Greydanus et al. , 2019 ) regarding their structural designs and predicting abilities . We refer the readers to Section 6 for a detailed discussion . As shown in Figure 1 , the vortices evolved using NSSNN are separated nicely as the ground truth , while the vortices merge together using HNN due to the failure of conserving the symplectic structure of a nonseparable system . The conservative capability of NSSNN springs from our design of the auxiliary variables ( red x and y ) which converts the original nonseparable system into a higher dimensional quasi-separable system where we can adopt a symplectic integrator . 2 RELATED WORKS . Data-driven physical prediction . Data-driven approaches have been widely applied in physical systems including fluid mechanics ( Brunton et al. , 2020 ) , wave physics ( Hughes et al. , 2019 ) , quantum physics ( Sellier et al. , 2019 ) , thermodynamics ( Hernandez et al. , 2020 ) , and material science ( Teicherta et al. , 2019 ) . Among these different physical systems , data-driven fluid receives increasing attention . We refer the readers to Brunton et al . ( 2020 ) for a thorough survey of the fundamental machine learning methodologies as well as their uses for understanding , modeling , optimizing , and controlling fluid flows in experiments and simulations based on training data . One of the motivations of our work is to design a versatile learning approach that can predict complex fluid motions . On another front , many pieces of research focus on incorporating physical priors into the learning framework , e.g. , by enforcing incompressibility ( Mohan et al. , 2020 ) , the Galilean invariance ( Ling et al. , 2016 ) , quasistatic equilibrium ( Geng et al. , 2020 ) , the Lagrangian invariance ( Cranmer et al. , 2020 ) , and Hamiltonian conservation ( Hernandez et al. , 2020 ; Greydanus et al. , 2019 ; Jin et al. , 2020 ; Zhong et al. , 2020 ) . Here , inspired by the idea of embedding physics priors into neural networks , we aim to accelerate the learning process and improve the accuracy of our model . Neural networks for Hamiltonian systems . Greydanus et al . ( 2019 ) introduced Hamiltonian neural networks ( HNNs ) to conserve the Hamiltonian energy of the system by reformulating the loss function . Inspired by HNN , a series of methods intrinsically embedding a symplectic integrator into the recurrent neural network was proposed , such as SRNN ( Chen et al. , 2020 ) , TaylorNet ( Tong et al. , 2020 ) and SSINN ( DiPietro et al. , 2020 ) , to solve separable Hamiltonian systems . Combined with graph networks ( Sanchez-Gonzalez et al. , 2019 ; Battaglia et al. , 2016 ) , these methods were further generalized to large-scale N-body problems induced by interaction force between the particle pairs . Jin et al . ( 2020 ) proposed SympNet by directly constructing the symplectic mapping of system variables within neighboring time steps to handle both separable and nonseparable Hamiltonian systems . However , the scale of parameters in SympNet for training N dimensional Hamiltonian system is O ( N2 ) , which makes it hard to be generalized to the high dimensional N-body problems . Our NSSNN overcomes these limitations by devising a new Hamiltonian network architecture that is specifically suited for nonseparable systems ( see details in Section 5 ) . In addition , the Hamiltonianbased neural networks can be extended to further applications . Toth et al . ( 2020 ) developed the Hamiltonian Generative Network ( HGN ) to learn Hamiltonian dynamics from high-dimensional observations ( such as images ) . Moreover , Zhong et al . ( 2020 ) introduced Symplectic ODE-Net ( SymODEN ) , which adds an external control term to the standard Hamiltonian dynamics . 3 FRAMEWORK . 3.1 AUGMENTED HAMILTONIAN EQUATION . We start by considering a Hamiltonian system with N pairs of canonical coordinates ( i.e . N generalized positions and N generalized momentum ) . The time evolution of canonical coordinates is governed by the symplectic gradient of the Hamiltonian ( Hand & Finch , 2008 ) . Specifically , the time evolution of the system is governed by Hamilton ’ s equations as dq dt = ∂H ∂p , dp dt = −∂H ∂q , ( 1 ) with the initial condition ( q , p ) |t=t0 = ( q0 , p0 ) . In a general setting , q = ( q1 , q2 , · · · , qN ) represents the positions and p = ( p1 , p2 , ... pN ) denotes their momentum . Function H = H ( q , p ) is the Hamiltonian , which corresponds to the total energy of the system . An important feature of Hamilton ’ s equations is its symplectomorphism ( see Appendix B for a detailed overview ) . The symplectic structure underpinning our proposed network architecture draws inspirations from the original research of Tao ( 2016 ) in computational physics . In Tao ( 2016 ) , a generic , high-order , explicit and symplectic time integrator was proposed to solve ( 1 ) of an arbitrary separable and nonseparable HamiltonianH . This is implemented by considering an augmented Hamiltonian H ( q , p , x , y ) : = HA +HB + ωHC ( 2 ) with HA = H ( q , y ) , HB = H ( x , p ) , HC = 1 2 ( ‖q − x‖22 + ‖p− y‖22 ) ( 3 ) in an extended phase space with symplectic two form dq ∧ dp+ dx ∧ dy , where ω is a constant that controls the binding of the original system and the artificial restraint . Notice that the Hamilton ’ s equations forH dq dt = ∂H ∂p = ∂H ( x , p ) ∂p + ω ( p− y ) , dp dt = −∂H ∂q = −∂H ( q , y ) ∂q − ω ( q − x ) , dx dt = ∂H ∂y = ∂H ( q , y ) ∂y − ω ( p− y ) , dy dt = −∂H ∂x = −∂H ( x , p ) ∂x + ω ( q − x ) , ( 4 ) with the initial condition ( q , p , x , y ) |t=t0 = ( q0 , p0 , q0 , p0 ) have the same exact solution as ( 1 ) in the sense that ( q , p , x , y ) = ( q , p , q , p ) . Hence , we can get the solution of ( 1 ) by solving ( 4 ) . Furthermore , it is possible to construct high-order symplectic integrators forH in ( 4 ) with explicit updates . Our model aims to learn the dynamical evolution of ( q , p ) in ( 1 ) by embedding ( 4 ) into the framework of NeuralODE ( Chen et al. , 2018 ) . The coefficient ω acts as a regularizer , which stabilizes the numerical results ( see Section 4 ) .
This paper describes a deep learning approach for predicting Hamiltonian systems. The original paper enforces conservation in the loss function. Several of the follow-up papers embed a symplectic integrator instead, but these couldn't handle non-separable systems. This paper can both handle non-separable systems and use a symplectic integrator to enforce conservation. They demonstrate their system on quite a few examples and show lower error (both in prediction and the deviation in the Hamiltonian) than a NeuralODE or the original HNN paper. The final example, in Figure 5, shows a compelling visual improvement.
SP:b2243f53f080e0babbc6061de7e2c2059a8d0cf0
Cooperating RPN's Improve Few-Shot Object Detection
1 INTRODUCTION . Achieving accurate few-shot object detection is difficult , because one must rely on a classifier building a useful model of variation in appearance with very few examples . This paper identifies an important effect that causes existing detectors to have weaker than necessary performance in the few-shot regime . By remediating this difficulty , we obtain substantial improvements in performance with current architectures . The effect is most easily explained by looking at the “ script ” that modern object detectors mostly follow . As one would expect , there are variations in detector structure , but these do not mitigate the effect . A modern object detector will first find promising image locations ; these are usually , but not always , boxes . We describe the effect in terms of boxes reported by a region proposal network ( RPN ) ( Ren et al. , 2015 ) , but expect that it applies to other representations of location , too . The detector then passes the promising locations through a classifier to determine what , if any , object is present . Finally , it performs various cleanup operations ( non-maximum suppression , bounding box regression , etc . ) , aimed at avoiding multiple predictions in the same location and improving localization . The evaluation procedure for reported labeled boxes uses an intersection-over-union ( IOU ) test as part of determining whether a box is relevant . A detector that is trained for few-shot detection is trained on two types of categories . Base categories have many training examples , and are used to train an RPN and the classifier . Novel categories have one ( or three , or five , etc . ) examples per category . The existing RPN is used to find boxes , and the classifier is fine-tuned to handle novel categories . Now assume that the detector must learn to detect a category from a single example . The RPN is already trained on other examples . It produces a collection of relevant boxes , which are used to train the classifier . The only way that the classifier can build a model of the categories variation in appearance is by having multiple high IOU boxes reported by the RPN . In turn , this means that an RPN that behaves well on base categories may create serious problems for novel categories . Imagine that the RPN reports only a few of the available high IOU boxes in training data . For base categories , this is not a problem ; many high IOU boxes will pass to the classifier because there is a lot of training data , and so the classifier will be able to build a model of the categories variation in appearance . This variation will be caused by effects like aspect , in-class variation , and the particular RPN ’ s choice of boxes . But for novel categories , an RPN must report as many high IOU boxes as possible , because otherwise the classifier will have too weak a model of appearance variation – for example , it might think that the object must be centered in the box . This will significantly depress accuracy . As Figure 1 and our results illustrate , this effect ( which we call proposal neglect ) is present in the state-of-the-art few-shot detectors . One can not escape this effect by simply reporting lots of boxes , because doing so will require the classifier to be very good at rejecting false positives . Instead , one wants the box proposal process to not miss high IOU boxes , without wild speculation . We offer a relatively straightforward strategy . We train multiple RPN ’ s to be somewhat redundant ( so that if one RPN misses a high IOU box , another will get it ) , without overpredicting . In what follows , we demonstrate how to do so and show how to balance redundancy against overprediction . Our contributions are three-fold : ( 1 ) We identify an important effect in few-shot object detection that causes existing detectors to have weaker than necessary performance in the few-shot regime . ( 2 ) We propose to overcome the proposal neglect effect by utilizing RPN redundancy . ( 3 ) We design an RPN ensemble mechanism that trains multiple RPN ’ s simultaneously while enforcing diversity and cooperation among RPN ’ s . We achieve state-of-the-art performance on COCO and PASCAL VOC in very few-shot settings . 2 BACKGROUND . Object Detection with Abundant Data . The best-performing modern detectors are based on convolutional neural networks . There are two families of architecture , both relying on the remarkable fact that one can quite reliably tell whether an image region contains an object independent of category ( Endres & Hoiem , 2010 ; van de Sande et al. , 2011 ) . In serial detection , a proposal process ( RPN/s in what follows ) offers the classifier a selection of locations likely to contain objects , and the classifier labels them , with the advantage that the classifier “ knows ” the likely support of the object fairly accurately . This family includes R-CNN and its variants ( for R-CNN ( Girshick et al. , 2014 ) ; Fast R-CNN ( Girshick , 2015 ) ; Faster R-CNN ( Ren et al. , 2015 ) ; Mask R-CNN ( He et al. , 2017 ) ; SPP-Net ( He et al. , 2015 ) ; FPN ( Lin et al. , 2017 ) ; and DCN ( Dai et al. , 2017 ) ) . In parallel , the proposal process and classification process are independent ; these methods can be faster , but the classifier “ knows ” very little about the likely support of the object , which can affect accuracy . This family includes YOLO and its variants ( for YOLO versions ( Redmon et al. , 2016 ; Redmon & Farhadi , 2017 ; 2018 ; Bochkovskiy et al. , 2020 ) ; SSD ( Liu et al. , 2016 ) ; Cornernet ( Law & Deng , 2018 ) ; and ExtremeNet ( Zhou et al. , 2019 ) ) . This paper identifies an issue with the proposal process that can impede strong performance when there is very little training data ( the few-shot case ) . The effect is described in the context of serial detection , but likely occurs in parallel detection too . Few-Shot Object Detection . Few-shot object detection involves detecting objects for which there are very few training examples . There is a rich few-shot classification literature ( roots in ( Thrun , 1998 ; Fei-Fei et al. , 2006 ) ) . Dvornik et al . ( 2019 ) uses ensemble procedures for few-shot classifi- cation . As to detection , Chen et al . ( 2018 ) proposes a regularized fine-tuning approach to transfer knowledge from a pre-trained detector to a few-shot detector . Schwartz et al . ( 2019 ) exploits metriclearning for modeling multi-modal distributions for each class . State-of-the-art few-shot detectors are usually serial ( Wang et al. , 2019 ; Yan et al. , 2019 ; Wang et al. , 2020 ; Fan et al. , 2020 ; Wu et al. , 2020 ; Xiao & Marlet , 2020 ) . The existing literature can be seen as variations on a standard framework , where one splits data into two sets of categories : base classes Cb ( which have many training examples ) and novel classes Cn ( which have few ) . The RPN and classifier are then trained with instances from the base classes , producing a detector for |Cb| categories . The final layer of the resulting classifier is expanded to classify into |Cb|+ |Cn| classes by inserting random weights connecting the final feature layer to the |Cn| novel categories . Now the model is fine-tuned using either only the novel class instances or a balanced dataset containing training instances of both base and novel classes . Wang et al . ( 2020 ) shows that a simple two-stage fine-tuning approach outperforms other complex methods . Much work seeks improvements by applying few-shot classification techniques . Kang et al . ( 2019 ) designs a meta-model that learns to reweight pre-trained features given few-shot data . Wang et al . ( 2019 ) and Yan et al . ( 2019 ) further explore the meta-learning direction by attaching meta-learned classifiers to Faster R-CNN . Wu et al . ( 2020 ) improves few-shot detection by positive sample refinement . Relatively little work adjusts the proposal process , which is usually seen as robust to few-shot issues because there are many base examples . One possibility is to introduce attention mechanisms and feed category-aware features instead of plain image features into the proposal process ( Hsieh et al. , 2019 ; Fan et al. , 2020 ; Xiao & Marlet , 2020 ; Osokin et al. , 2020 ) , as well as re-ranking proposals based on similarity with query images ( Hsieh et al. , 2019 ; Fan et al. , 2020 ) . Making the RPN category-aware improves the quality of novel class proposals , but at inference time the model suffers from catastrophic forgetting of base categories – current category-aware features can not summarize the very large number of base class examples efficiently or accurately . An RPN that is generally well-behaved can still create serious trouble in the few-shot case by missing high IOU proposals for the novel classes during fine-tuning – the proposal neglect effect . We show that this problem is severe in the few-shot regime , and can be fixed by a carefully constructed ensemble of RPNs without substantial loss of performance for the base classes . Evaluating Few-Shot Detectors . The standard procedure is to compute average precision ( AP ) separately for novel and base categories for a detector that is engineered to detect |Cb| + |Cn| classes , typically using standard test/train splits and standard novel/base splits ( Wang et al. , 2020 ) . This evaluation procedure is the same as in incremental few-shot detection ( Yang et al. , 2020 ; PérezRúa et al. , 2020 ) . This procedure makes sense , because in most applications an incoming test image could contain instances from both base and novel classes . Furthermore , the standard procedure exposes any catastrophic forgetting that occurs . However , other evaluation methodologies occur , and some detectors are evaluated using variant procedures , making the comparison of AP ’ s difficult . In one variant , the detector detects only the |Cn| novel classes or only one novel class . In this paper , all reported results are for the standard procedure ; when relevant , we re-implement and re-evaluate using the standard procedure . 3 OUR APPROACH . We believe that the proposal neglect effect is generic , and it applies to any detector that uses a structure like the standard structure . For this reason , we focus on finding and fixing the effect within a standard state-of-the-art few-shot object detection framework , as described below . Few-Shot Object Detection Framework . We use the few-shot detection setting introduced in Kang et al . ( 2019 ) . We split the dataset into two sets of categories : base classes Cb and novel classes Cn . As shown in Figure 2 , the training process is two-phase : ( 1 ) base classes training , and ( 2 ) finetuning with novel classes . In phase 1 , the model is trained with base class instances which results in a |Cb|-way detector . After base classes training , weights for novel classes are randomly initialized , making the classifier a ( |Cb|+ |Cn| ) -way classifier . In phase 2 , the model is fine-tuned using either a set of few novel class instances or a balanced dataset containing both novel and base classes . After the fine-tuning phase , we evaluate our model by average precision ( AP ) on novel and base categories . Although the focus of few-shot detection is the novel classes , since most test images contain instances from both base and novel classes , it is essential to maintain good performance on base classes . We adopt the widely-used Faster R-CNN ( Ren et al. , 2015 ) as our base model . As shown in Figure 2 , Faster R-CNN is a serial detector , which consists of a backbone image feature extractor , a regional proposal network ( RPN ) , followed by the region of interest ( ROI ) pooling layer , and a bounding box classifier and a bounding box regressor on top of the model . The RPN determines if a box is a foreground or a background box . Following the RPN is non-maximum suppression ( NMS ) which ranks and selects top proposal boxes . After passing the ROI pooling layer , the predictor ’ s head classifies and localizes each box . In phase 1 , the whole model is trained on many-shot base class instances . Phase 2 fine-tunes the head classifier and the bounding box regressor with novel class instances ; everything before and including the proposal generator is frozen . Learning Cooperating RPN ’ s ( CoRPNs ) . We wish to avoid high IOU boxes for novel classes being dropped by RPN when novel classes are trained . Our strategy is to train multiple redundant RPN ’ s . The RPN ’ s should be distinct , but cooperate – if one misses a high IOU box , we want another to find it . However , they should not be so distinct that the classifier is flooded with false positives . As Figure 3 shows , Faster R-CNN ’ s RPN consists of a feature extractor , a binary classifier ( which decides whether a box is foreground or background ) , and a bounding box regressor ( which is not relevant to our current purpose ) . There is no reason for our RPN ’ s to use distinct sets of features , and we do not want to create problems with variance , so we construct redundant classifiers while keeping both the feature extractor and the bounding box regressor shared between all RPN ’ s . In what follows , a reference to an RPN is actually a reference to the RPN classifier , unless otherwise noted . An RPN with a single classifier is trained with a cross-entropy loss Lcls = LCE and produces a single prediction . In our case , we train N different binary classifiers simultaneously , and must determine ( 1 ) what prediction is made at test time and ( 2 ) what gradient goes to what classifier at training time . At test time , a given box gets the score from the most certain RPN . If the highest foreground probability is closer to one than the highest background probability , the box is foreground ; otherwise , it is background . Training time is more interesting . Merely taking the gradient of the best RPN score is not good enough , because we may find that one RPN scores all boxes , and the others do nothing interesting . For any foreground box , we want at least one RPN to have a very strong foreground score and all others to have good foreground scores too ( so that no foreground box is missed ) . We use the following strategy . For a specific anchor box i , each RPN j outputs a raw score rji , indicating if the box is a foreground box or not : ri = [ r1i , r 2 i , . . . , r N i ] . After applying a sigmoid , the jth RPN produces the foreground probability f ji = σ ( r j i ) for anchor box i . We choose the score from the j∗th RPN such that j∗ = argminj min { f j i , 1 − f j i } , namely the most certain RPN which produces probability closest to the edge of the [ 0 , 1 ] interval . At training time , only the chosen j∗th RPN gets the gradient from anchor box i . The RPN selection procedure is per-box , even adjacent boxes can pass through different RPN ’ s . Other than the standard cross-entropy loss , we use two additional loss terms : a diversity loss Ldiv encourages RPN ’ s to be distinct , and a cooperation loss Lcoop encourages cooperation and suppresses foreground false negatives . The final loss Lcls : = Lj ∗ CE + λdLdiv + λcLcoop , where λd and λc are trade-off hyperparameters . Enforcing Diversity . We do not want our RPN ’ s to be too similar . For each positive anchor box , RPN responses should be different because we want ensure that at novel class training time , if one RPN misses a high IOU anchor box , another will find it . To this end , we propose a methodology to enforce diversity among RPN ’ s . Given a set of NA anchor boxes , the N RPN ’ s produce an N by NA matrix of probabilities F = [ f1 , f2 , . . . , fN ] T . The covariance matrix Σ ( F ) is Σ ( F ) = E [ ( f j −E [ f j ] ) ( fk −E [ fk ] ) ] . We define the diversity loss Ldiv by the log determinant loss Ldiv : = − log ( det ( Σ ( F ) ) ) . By the diversity loss , we encourage the probability matrix to have rank N , so each RPN is reacting differently on the collection of NA boxes . This procedure ensures each RPN to be the most certain RPN for some boxes , so that every RPN is being selected and trained . Omitting this loss can cause an RPN to receive no or little training . Learning to Cooperate . We also want the RPN ’ s to cooperate so that they all agree to a certain extent for foreground boxes . We propose a cooperation loss to prevent any RPN from firmly rejecting any foreground box . For foreground box i , with the jth RPN , we define the cooperation loss Li , jcoop : = max { 0 , φ− f j i } , where φ is a constant parameter ( usually less than 0.5 ) , acting as a lower bound for each RPN ’ s probability assigning to a foreground box . If a RPN ’ s response is below φ , that RPN is going to be penalized . The final cooperation loss is an average of cooperation losses over all foreground boxes and all RPN ’ s .
In this paper, the authors present a interesting, novel idea of promoting the diversity and cooperation among multiple RPNs for the problem of few-shot detection. They first identify a critical problem in few-shot detection, which is that existing RPNs can miss objects of novel classes and that their proposed boxes make very similar errors. In order to resolve this issue, the authors propose to utilize multiple RPNs in the same detection pipeline and include a diversity loss when training the RPNs, such that they provide diverse scores to the anchor boxes. In this way, the chance of all the RPNs missing an object becomes small. The authors further include a cooperation score to enforce the RPNs to provide more meaningful scores (rather than sparse scores just to promote diversity). The proposed approach is evaluated on COCO and Pascal, and the results demonstrate that the proposed approach does improve the detection performance, as compared to the state of the art, especially in very low-shot cases.
SP:c171fccf8cd846266842b5fc4896477903b9bdb5
Cooperating RPN's Improve Few-Shot Object Detection
1 INTRODUCTION . Achieving accurate few-shot object detection is difficult , because one must rely on a classifier building a useful model of variation in appearance with very few examples . This paper identifies an important effect that causes existing detectors to have weaker than necessary performance in the few-shot regime . By remediating this difficulty , we obtain substantial improvements in performance with current architectures . The effect is most easily explained by looking at the “ script ” that modern object detectors mostly follow . As one would expect , there are variations in detector structure , but these do not mitigate the effect . A modern object detector will first find promising image locations ; these are usually , but not always , boxes . We describe the effect in terms of boxes reported by a region proposal network ( RPN ) ( Ren et al. , 2015 ) , but expect that it applies to other representations of location , too . The detector then passes the promising locations through a classifier to determine what , if any , object is present . Finally , it performs various cleanup operations ( non-maximum suppression , bounding box regression , etc . ) , aimed at avoiding multiple predictions in the same location and improving localization . The evaluation procedure for reported labeled boxes uses an intersection-over-union ( IOU ) test as part of determining whether a box is relevant . A detector that is trained for few-shot detection is trained on two types of categories . Base categories have many training examples , and are used to train an RPN and the classifier . Novel categories have one ( or three , or five , etc . ) examples per category . The existing RPN is used to find boxes , and the classifier is fine-tuned to handle novel categories . Now assume that the detector must learn to detect a category from a single example . The RPN is already trained on other examples . It produces a collection of relevant boxes , which are used to train the classifier . The only way that the classifier can build a model of the categories variation in appearance is by having multiple high IOU boxes reported by the RPN . In turn , this means that an RPN that behaves well on base categories may create serious problems for novel categories . Imagine that the RPN reports only a few of the available high IOU boxes in training data . For base categories , this is not a problem ; many high IOU boxes will pass to the classifier because there is a lot of training data , and so the classifier will be able to build a model of the categories variation in appearance . This variation will be caused by effects like aspect , in-class variation , and the particular RPN ’ s choice of boxes . But for novel categories , an RPN must report as many high IOU boxes as possible , because otherwise the classifier will have too weak a model of appearance variation – for example , it might think that the object must be centered in the box . This will significantly depress accuracy . As Figure 1 and our results illustrate , this effect ( which we call proposal neglect ) is present in the state-of-the-art few-shot detectors . One can not escape this effect by simply reporting lots of boxes , because doing so will require the classifier to be very good at rejecting false positives . Instead , one wants the box proposal process to not miss high IOU boxes , without wild speculation . We offer a relatively straightforward strategy . We train multiple RPN ’ s to be somewhat redundant ( so that if one RPN misses a high IOU box , another will get it ) , without overpredicting . In what follows , we demonstrate how to do so and show how to balance redundancy against overprediction . Our contributions are three-fold : ( 1 ) We identify an important effect in few-shot object detection that causes existing detectors to have weaker than necessary performance in the few-shot regime . ( 2 ) We propose to overcome the proposal neglect effect by utilizing RPN redundancy . ( 3 ) We design an RPN ensemble mechanism that trains multiple RPN ’ s simultaneously while enforcing diversity and cooperation among RPN ’ s . We achieve state-of-the-art performance on COCO and PASCAL VOC in very few-shot settings . 2 BACKGROUND . Object Detection with Abundant Data . The best-performing modern detectors are based on convolutional neural networks . There are two families of architecture , both relying on the remarkable fact that one can quite reliably tell whether an image region contains an object independent of category ( Endres & Hoiem , 2010 ; van de Sande et al. , 2011 ) . In serial detection , a proposal process ( RPN/s in what follows ) offers the classifier a selection of locations likely to contain objects , and the classifier labels them , with the advantage that the classifier “ knows ” the likely support of the object fairly accurately . This family includes R-CNN and its variants ( for R-CNN ( Girshick et al. , 2014 ) ; Fast R-CNN ( Girshick , 2015 ) ; Faster R-CNN ( Ren et al. , 2015 ) ; Mask R-CNN ( He et al. , 2017 ) ; SPP-Net ( He et al. , 2015 ) ; FPN ( Lin et al. , 2017 ) ; and DCN ( Dai et al. , 2017 ) ) . In parallel , the proposal process and classification process are independent ; these methods can be faster , but the classifier “ knows ” very little about the likely support of the object , which can affect accuracy . This family includes YOLO and its variants ( for YOLO versions ( Redmon et al. , 2016 ; Redmon & Farhadi , 2017 ; 2018 ; Bochkovskiy et al. , 2020 ) ; SSD ( Liu et al. , 2016 ) ; Cornernet ( Law & Deng , 2018 ) ; and ExtremeNet ( Zhou et al. , 2019 ) ) . This paper identifies an issue with the proposal process that can impede strong performance when there is very little training data ( the few-shot case ) . The effect is described in the context of serial detection , but likely occurs in parallel detection too . Few-Shot Object Detection . Few-shot object detection involves detecting objects for which there are very few training examples . There is a rich few-shot classification literature ( roots in ( Thrun , 1998 ; Fei-Fei et al. , 2006 ) ) . Dvornik et al . ( 2019 ) uses ensemble procedures for few-shot classifi- cation . As to detection , Chen et al . ( 2018 ) proposes a regularized fine-tuning approach to transfer knowledge from a pre-trained detector to a few-shot detector . Schwartz et al . ( 2019 ) exploits metriclearning for modeling multi-modal distributions for each class . State-of-the-art few-shot detectors are usually serial ( Wang et al. , 2019 ; Yan et al. , 2019 ; Wang et al. , 2020 ; Fan et al. , 2020 ; Wu et al. , 2020 ; Xiao & Marlet , 2020 ) . The existing literature can be seen as variations on a standard framework , where one splits data into two sets of categories : base classes Cb ( which have many training examples ) and novel classes Cn ( which have few ) . The RPN and classifier are then trained with instances from the base classes , producing a detector for |Cb| categories . The final layer of the resulting classifier is expanded to classify into |Cb|+ |Cn| classes by inserting random weights connecting the final feature layer to the |Cn| novel categories . Now the model is fine-tuned using either only the novel class instances or a balanced dataset containing training instances of both base and novel classes . Wang et al . ( 2020 ) shows that a simple two-stage fine-tuning approach outperforms other complex methods . Much work seeks improvements by applying few-shot classification techniques . Kang et al . ( 2019 ) designs a meta-model that learns to reweight pre-trained features given few-shot data . Wang et al . ( 2019 ) and Yan et al . ( 2019 ) further explore the meta-learning direction by attaching meta-learned classifiers to Faster R-CNN . Wu et al . ( 2020 ) improves few-shot detection by positive sample refinement . Relatively little work adjusts the proposal process , which is usually seen as robust to few-shot issues because there are many base examples . One possibility is to introduce attention mechanisms and feed category-aware features instead of plain image features into the proposal process ( Hsieh et al. , 2019 ; Fan et al. , 2020 ; Xiao & Marlet , 2020 ; Osokin et al. , 2020 ) , as well as re-ranking proposals based on similarity with query images ( Hsieh et al. , 2019 ; Fan et al. , 2020 ) . Making the RPN category-aware improves the quality of novel class proposals , but at inference time the model suffers from catastrophic forgetting of base categories – current category-aware features can not summarize the very large number of base class examples efficiently or accurately . An RPN that is generally well-behaved can still create serious trouble in the few-shot case by missing high IOU proposals for the novel classes during fine-tuning – the proposal neglect effect . We show that this problem is severe in the few-shot regime , and can be fixed by a carefully constructed ensemble of RPNs without substantial loss of performance for the base classes . Evaluating Few-Shot Detectors . The standard procedure is to compute average precision ( AP ) separately for novel and base categories for a detector that is engineered to detect |Cb| + |Cn| classes , typically using standard test/train splits and standard novel/base splits ( Wang et al. , 2020 ) . This evaluation procedure is the same as in incremental few-shot detection ( Yang et al. , 2020 ; PérezRúa et al. , 2020 ) . This procedure makes sense , because in most applications an incoming test image could contain instances from both base and novel classes . Furthermore , the standard procedure exposes any catastrophic forgetting that occurs . However , other evaluation methodologies occur , and some detectors are evaluated using variant procedures , making the comparison of AP ’ s difficult . In one variant , the detector detects only the |Cn| novel classes or only one novel class . In this paper , all reported results are for the standard procedure ; when relevant , we re-implement and re-evaluate using the standard procedure . 3 OUR APPROACH . We believe that the proposal neglect effect is generic , and it applies to any detector that uses a structure like the standard structure . For this reason , we focus on finding and fixing the effect within a standard state-of-the-art few-shot object detection framework , as described below . Few-Shot Object Detection Framework . We use the few-shot detection setting introduced in Kang et al . ( 2019 ) . We split the dataset into two sets of categories : base classes Cb and novel classes Cn . As shown in Figure 2 , the training process is two-phase : ( 1 ) base classes training , and ( 2 ) finetuning with novel classes . In phase 1 , the model is trained with base class instances which results in a |Cb|-way detector . After base classes training , weights for novel classes are randomly initialized , making the classifier a ( |Cb|+ |Cn| ) -way classifier . In phase 2 , the model is fine-tuned using either a set of few novel class instances or a balanced dataset containing both novel and base classes . After the fine-tuning phase , we evaluate our model by average precision ( AP ) on novel and base categories . Although the focus of few-shot detection is the novel classes , since most test images contain instances from both base and novel classes , it is essential to maintain good performance on base classes . We adopt the widely-used Faster R-CNN ( Ren et al. , 2015 ) as our base model . As shown in Figure 2 , Faster R-CNN is a serial detector , which consists of a backbone image feature extractor , a regional proposal network ( RPN ) , followed by the region of interest ( ROI ) pooling layer , and a bounding box classifier and a bounding box regressor on top of the model . The RPN determines if a box is a foreground or a background box . Following the RPN is non-maximum suppression ( NMS ) which ranks and selects top proposal boxes . After passing the ROI pooling layer , the predictor ’ s head classifies and localizes each box . In phase 1 , the whole model is trained on many-shot base class instances . Phase 2 fine-tunes the head classifier and the bounding box regressor with novel class instances ; everything before and including the proposal generator is frozen . Learning Cooperating RPN ’ s ( CoRPNs ) . We wish to avoid high IOU boxes for novel classes being dropped by RPN when novel classes are trained . Our strategy is to train multiple redundant RPN ’ s . The RPN ’ s should be distinct , but cooperate – if one misses a high IOU box , we want another to find it . However , they should not be so distinct that the classifier is flooded with false positives . As Figure 3 shows , Faster R-CNN ’ s RPN consists of a feature extractor , a binary classifier ( which decides whether a box is foreground or background ) , and a bounding box regressor ( which is not relevant to our current purpose ) . There is no reason for our RPN ’ s to use distinct sets of features , and we do not want to create problems with variance , so we construct redundant classifiers while keeping both the feature extractor and the bounding box regressor shared between all RPN ’ s . In what follows , a reference to an RPN is actually a reference to the RPN classifier , unless otherwise noted . An RPN with a single classifier is trained with a cross-entropy loss Lcls = LCE and produces a single prediction . In our case , we train N different binary classifiers simultaneously , and must determine ( 1 ) what prediction is made at test time and ( 2 ) what gradient goes to what classifier at training time . At test time , a given box gets the score from the most certain RPN . If the highest foreground probability is closer to one than the highest background probability , the box is foreground ; otherwise , it is background . Training time is more interesting . Merely taking the gradient of the best RPN score is not good enough , because we may find that one RPN scores all boxes , and the others do nothing interesting . For any foreground box , we want at least one RPN to have a very strong foreground score and all others to have good foreground scores too ( so that no foreground box is missed ) . We use the following strategy . For a specific anchor box i , each RPN j outputs a raw score rji , indicating if the box is a foreground box or not : ri = [ r1i , r 2 i , . . . , r N i ] . After applying a sigmoid , the jth RPN produces the foreground probability f ji = σ ( r j i ) for anchor box i . We choose the score from the j∗th RPN such that j∗ = argminj min { f j i , 1 − f j i } , namely the most certain RPN which produces probability closest to the edge of the [ 0 , 1 ] interval . At training time , only the chosen j∗th RPN gets the gradient from anchor box i . The RPN selection procedure is per-box , even adjacent boxes can pass through different RPN ’ s . Other than the standard cross-entropy loss , we use two additional loss terms : a diversity loss Ldiv encourages RPN ’ s to be distinct , and a cooperation loss Lcoop encourages cooperation and suppresses foreground false negatives . The final loss Lcls : = Lj ∗ CE + λdLdiv + λcLcoop , where λd and λc are trade-off hyperparameters . Enforcing Diversity . We do not want our RPN ’ s to be too similar . For each positive anchor box , RPN responses should be different because we want ensure that at novel class training time , if one RPN misses a high IOU anchor box , another will find it . To this end , we propose a methodology to enforce diversity among RPN ’ s . Given a set of NA anchor boxes , the N RPN ’ s produce an N by NA matrix of probabilities F = [ f1 , f2 , . . . , fN ] T . The covariance matrix Σ ( F ) is Σ ( F ) = E [ ( f j −E [ f j ] ) ( fk −E [ fk ] ) ] . We define the diversity loss Ldiv by the log determinant loss Ldiv : = − log ( det ( Σ ( F ) ) ) . By the diversity loss , we encourage the probability matrix to have rank N , so each RPN is reacting differently on the collection of NA boxes . This procedure ensures each RPN to be the most certain RPN for some boxes , so that every RPN is being selected and trained . Omitting this loss can cause an RPN to receive no or little training . Learning to Cooperate . We also want the RPN ’ s to cooperate so that they all agree to a certain extent for foreground boxes . We propose a cooperation loss to prevent any RPN from firmly rejecting any foreground box . For foreground box i , with the jth RPN , we define the cooperation loss Li , jcoop : = max { 0 , φ− f j i } , where φ is a constant parameter ( usually less than 0.5 ) , acting as a lower bound for each RPN ’ s probability assigning to a foreground box . If a RPN ’ s response is below φ , that RPN is going to be penalized . The final cooperation loss is an average of cooperation losses over all foreground boxes and all RPN ’ s .
The authors propose a few-show object detection architecture, which improves the 1st stage of two-stage detectors (R-CNN in particular). In a few shot setting, the existing approaches the region proposal generator may ignore some novel out-of-distribution classes as they have not been included at training time. The proposed method attempts to correct this by using many RPN's, and training them such that the gradient is only passed to one of them at a time; thus forcing them to learn mutually different kinds of regions.
SP:c171fccf8cd846266842b5fc4896477903b9bdb5
The Impact of the Mini-batch Size on the Dynamics of SGD: Variance and Beyond
1 INTRODUCTION . Deep learning models have achieved great success in a variety of tasks including natural language processing , computer vision , and reinforcement learning ( Goodfellow et al. , 2016 ) . Despite their practical success , there are only limited studies of the theoretical properties of deep learning ; see survey papers ( Sun , 2019 ; Fan et al. , 2019 ) and references therein . The general problem underlying deep learning models is to optimize ( minimize ) a loss function , defined by the deviation of model predictions on data samples from the corresponding true labels . The prevailing method to train deep learning models is the mini-batch stochastic gradient descent algorithm and its variants ( Bottou , 1998 ; Bottou et al. , 2018 ) . SGD updates model parameters by calculating a stochastic approximation of the full gradient of the loss function , based on a random selected subset of the training samples called a mini-batch . It is well-accepted that selecting a large mini-batch size reduces the training time of deep learning models , as computation on large mini-batches can be better parallelized on processing units . For example , Goyal et al . ( 2017 ) scale ResNet-50 ( He et al. , 2016 ) from a mini-batch size of 256 images and training time of 29 hours , to a larger mini-batch size of 8,192 images . Their training achieves the same level of accuracy while reducing the training time to one hour . However , noted by many researchers , larger mini-batch sizes suffer from a worse generalization ability ( LeCun et al. , 2012 ; Keskar et al. , 2017 ) . Therefore , many efforts have been made to develop specialized training procedures that achieve good generalization using large mini-batch sizes ( Hoffer et al. , 2017 ; Goyal et al. , 2017 ) . Smaller batch sizes have the advantage of allegedly offering better generalization ( at the expense of a higher training time ) . The focus of this study is on the behavior of SGD subject to the conditions on the initial point . This is different from previous results which analyze SGD via stringing one-step recursions together . The dynamics of SGD are not comparable if we merely consider the one-step behavior , as the model parameters change iteration by iteration . Therefore , fixing the initial weights and the learning rate can give us a fair view of the impact of different mini-batch sizes on the dynamics of SGD . We hypothesize that , given the same initial point , smaller sizes lead to lower training loss and , unfortunately , decrease stability of the algorithm on average . The latter follows from the fact that the smaller is the batch size , more stochasticity and volatility is introduced . After all , if the batch size equals to the number of samples , there is no stochasticity in the algorithm . To this end , we conjecture that the variance of the gradient in each iteration is a decreasing function of the mini-batch size . The conjecture is the focus of the work herein . Variance correlates to many other important properties of SGD dynamics . For example , there is substantial work on variance reduction methods ( Johnson & Zhang , 2013 ; Allen-Zhu & Hazan , 2016 ; Wang et al. , 2013 ) which show great success on improving the convergence rate by controlling the variance of the stochastic gradients . Mini-batch size is also a key factor deciding the performance of SGD . Some research focuses on how to choose an optimal mini-batch size based on different criteria ( Smith & Le , 2017 ; Gower et al. , 2019 ) . However , these works make strong assumptions on the loss function properties ( strong or point or quasi convexity , or constant variance near stationary points ) or about the formulation of the SGD algorithm ( continuous time interpretation by means of differential equations ) . The statements are approximate in nature and thus not mathematical claims . The theoretical results regarding the relationship between the mini-batch size and the variance ( and other performances , like loss and generalization ability ) of the SGD algorithm applied to general machine learning models are still missing . The work herein partially addresses this gap by showing the impact of the mini-batch size on the variance of gradients in SGD . We further discuss possible extensions of the approaches we build in studying the generalization ability . We are able to prove the hypothesis about variance in the convex linear regression case and to show significant progress in a deep linear neural network setting with samples based on a normal distribution . In this case we show that the variance is a polynomial in the reciprocal of the mini-batch size and that it is decreasing if the mini-batch size is larger than a threshold ( further experiments reveal that this threshold can be as small as 2 ) . The increased variance as the mini-batch size decreases should also intuitively imply convergence to lower training loss values and in turn better prediction and generalization ability ( these relationships are yet to be confirmed analytically ; but we provide empirical evidence to their validity ) . The major contributions of this paper are as follows . • For linear regression , we show that in each iteration the norm of any linear combination of sample-wise gradients is a decreasing function of the mini-batch size b ( Theorem 1 ) . As a special case , the variance of the stochastic gradient estimator and the full gradient at the iterate in step t are also decreasing functions of b at any iteration step t ( Theorem 2 ) . In addition , the proof provides a recursive relationship between the norm of gradients and the model parameters at each iteration ( Lemma 2 ) . This recursive relationship can be used to calculate any quantity related to the full/stochastic gradient or loss at any iteration with respect to the initial weights . • For the deep linear neural network with L2-loss and samples drawn from a normal distribution , we take two-layer linear network as an example and show that in each iteration step t the trace of any product of the stochastic gradient estimators and weight matrices is a polynomial in 1 { b with coefficients a sum of products of the initial weights ( Theorem 3 ) . As a special case , the variance of the stochastic gradient estimator is a polynomial in 1 { bwithout the constant term ( Theorem 4 ) and therefore it is a decreasing function of b when b is large enough ( Theorem 5 ) . The results and proof techniques can be easily extended to general deep linear networks . As a comparison , other papers that study theoretical properties of two-layer networks either fix one layer of the network , or assume the over-parameterized property of the model and they study convergence , while our paper makes no such assumptions on the model capacity . The proof also reveals the structure of the coefficients of the polynomial , and thus serving as a tool for future work on proving other properties of the stochastic gradient estimators . • The proofs are involved and require several key ideas . The main one is to show a more general result than it is necessary in order to carry out the induction . The induction is on time step t. The key idea is to show a much more general result that lets us carry out induction . New concepts and definitions are introduced in order to handle the more general case . Along the way we show a result of general interest establishing expectation of several rank one matrices sampled from a normal distribution intertwined with constant matrices . • We verify the theoretical results on various datasets and provide further understanding . We further empirically show that the results extend to other widely used network structures and hold for all choices of the mini-batch sizes . We also empirically verify that , on average , in each iteration the loss function value and the generalization ability ( measured by the gap between accuracy on the training and test sets ) are all decreasing functions of the minibatch size . In conclusion , we study the dynamics of SGD under linear regression and a two-layer linear network setting by focusing on the decreasing property of the variance of stochastic gradient estimators with respect to the mini-batch size . The proof techniques can also be used to derive other properties of the SGD dynamics in regard to the mini-batch size and initial weights . To the best of authors ’ knowledge , the work is the first one to theoretically study the impact of the mini-batch size on the variance of the gradient subject to the conditions on the initial weights , under mild assumptions on the network and the loss function . We support our theoretical results by experiments . We further experiment on other state-of-the-art deep learning models and datasets to empirically show the validity of the conjectures about the impact of mini-batch size on average loss , average accuracy and the generalization ability of the model . The rest of the manuscript is structured as follows . In Section 2 we review the literature while in Section 3 we present the theoretical results on how mini-batch sizes impact the variance of stochastic gradient estimators , under different models including linear regression and deep linear networks . Section 4 introduces ( part of ) the experiments that verify our theorems and provide further insights into the impact of the mini-batch sizes on SGD performance . We defer the complete experimental details to Appendix A and the proofs of the theorems and other technical details to to Appendix B . 2 LITERATURE REVIEW . Stochastic gradient descent type methods are broadly used in machine learning ( Bottou , 1991 ; LeCun et al. , 1998 ; Bottou et al. , 2018 ) . The performance of SGD highly relies on the choice of the mini-batch size . It has been widely observed that choosing a large mini-batch size to train deep neural networks appears to deteriorate generalization ( LeCun et al. , 2012 ) . This phenomenon exists even if the models are trained without any budget or limits , until the loss function value ceases to improve ( Keskar et al. , 2017 ) . One explanation for this phenomenon is that large mini-batch SGD produces “ sharp ” minima that generalize worse ( Hochreiter & Schmidhuber , 1997 ; Keskar et al. , 2017 ) . Specialized training procedures to achieve good performance with large mini-batch sizes have also been proposed ( Hoffer et al. , 2017 ; Goyal et al. , 2017 ) . It is well-known that SGD has a slow asymptotic rate of convergence due to its inherent variance ( Johnson & Zhang , 2013 ) . Variants of SGD that can reduce the variance of the stochastic gradient estimator , which yield faster convergence , have also been suggested . The use of the information of full gradients to provide variance control for stochastic gradients is addressed in Johnson & Zhang ( 2013 ) ; Roux et al . ( 2012 ) ; Shalev-Shwartz & Zhang ( 2013 ) . The works in Lei et al . ( 2017 ) ; Li et al . ( 2014 ) ; Schmidt et al . ( 2017 ) further improve the efficiency and complexity of the algorithm by carefully controling the variance . There is prior work focusing on studying the dynamics of SGD . Neelakantan et al . ( 2015 ) propose to add isotropic white noise to the full gradient to study the “ structured ” variance . The works in Li et al . ( 2017 ) ; Mandt et al . ( 2017 ) ; Jastrzebski et al . ( 2017 ) connect SGD with stochastic differential equations to explain the property of converged minima and generalization ability of the model . Smith & Le ( 2017 ) propose an “ optimal ” mini-batch size which maximizes the test set accuracy by a Bayesian approach . The Stochastic Gradient Langevin Dynamics ( SGLD , a variant of SGD ) algorithm for non-convex optimization is studied in Zhang et al . ( 2017 ) ; Mou et al . ( 2018 ) . In most of the prior work about the convergence of SGD , it is assumed that the variance of stochastic gradient estimators is upper-bounded by a linear function of the norm of the full gradient , e.g . Assumption 4.3 in Bottou et al . ( 2018 ) . Gower et al . ( 2019 ) give more precise bounds of the variance under different sampling methods and Khaled & Richtárik ( 2020 ) extend them to smooth non-convex regime . These bounds are still dependent on the model parameters at the corresponding iteration . To the best of the authors ’ knowledge , there is no existing result which represents the variance of stochastic gradient estimators only using the initial weights and the mini-batch size . This paper partially solves this problem .
This paper studies the variance of stochastic gradient in SGD conditioned on the initialization point. It shows that the variance of stochastic gradient is a decreasing function of minibatch size for linear regression and deep linear network. Compared with previous works that show similar the results for one step in SGD, the results in this work only rely on initialization point.
SP:82228b43db88274a90aa34ff6b67f53bed74b539
The Impact of the Mini-batch Size on the Dynamics of SGD: Variance and Beyond
1 INTRODUCTION . Deep learning models have achieved great success in a variety of tasks including natural language processing , computer vision , and reinforcement learning ( Goodfellow et al. , 2016 ) . Despite their practical success , there are only limited studies of the theoretical properties of deep learning ; see survey papers ( Sun , 2019 ; Fan et al. , 2019 ) and references therein . The general problem underlying deep learning models is to optimize ( minimize ) a loss function , defined by the deviation of model predictions on data samples from the corresponding true labels . The prevailing method to train deep learning models is the mini-batch stochastic gradient descent algorithm and its variants ( Bottou , 1998 ; Bottou et al. , 2018 ) . SGD updates model parameters by calculating a stochastic approximation of the full gradient of the loss function , based on a random selected subset of the training samples called a mini-batch . It is well-accepted that selecting a large mini-batch size reduces the training time of deep learning models , as computation on large mini-batches can be better parallelized on processing units . For example , Goyal et al . ( 2017 ) scale ResNet-50 ( He et al. , 2016 ) from a mini-batch size of 256 images and training time of 29 hours , to a larger mini-batch size of 8,192 images . Their training achieves the same level of accuracy while reducing the training time to one hour . However , noted by many researchers , larger mini-batch sizes suffer from a worse generalization ability ( LeCun et al. , 2012 ; Keskar et al. , 2017 ) . Therefore , many efforts have been made to develop specialized training procedures that achieve good generalization using large mini-batch sizes ( Hoffer et al. , 2017 ; Goyal et al. , 2017 ) . Smaller batch sizes have the advantage of allegedly offering better generalization ( at the expense of a higher training time ) . The focus of this study is on the behavior of SGD subject to the conditions on the initial point . This is different from previous results which analyze SGD via stringing one-step recursions together . The dynamics of SGD are not comparable if we merely consider the one-step behavior , as the model parameters change iteration by iteration . Therefore , fixing the initial weights and the learning rate can give us a fair view of the impact of different mini-batch sizes on the dynamics of SGD . We hypothesize that , given the same initial point , smaller sizes lead to lower training loss and , unfortunately , decrease stability of the algorithm on average . The latter follows from the fact that the smaller is the batch size , more stochasticity and volatility is introduced . After all , if the batch size equals to the number of samples , there is no stochasticity in the algorithm . To this end , we conjecture that the variance of the gradient in each iteration is a decreasing function of the mini-batch size . The conjecture is the focus of the work herein . Variance correlates to many other important properties of SGD dynamics . For example , there is substantial work on variance reduction methods ( Johnson & Zhang , 2013 ; Allen-Zhu & Hazan , 2016 ; Wang et al. , 2013 ) which show great success on improving the convergence rate by controlling the variance of the stochastic gradients . Mini-batch size is also a key factor deciding the performance of SGD . Some research focuses on how to choose an optimal mini-batch size based on different criteria ( Smith & Le , 2017 ; Gower et al. , 2019 ) . However , these works make strong assumptions on the loss function properties ( strong or point or quasi convexity , or constant variance near stationary points ) or about the formulation of the SGD algorithm ( continuous time interpretation by means of differential equations ) . The statements are approximate in nature and thus not mathematical claims . The theoretical results regarding the relationship between the mini-batch size and the variance ( and other performances , like loss and generalization ability ) of the SGD algorithm applied to general machine learning models are still missing . The work herein partially addresses this gap by showing the impact of the mini-batch size on the variance of gradients in SGD . We further discuss possible extensions of the approaches we build in studying the generalization ability . We are able to prove the hypothesis about variance in the convex linear regression case and to show significant progress in a deep linear neural network setting with samples based on a normal distribution . In this case we show that the variance is a polynomial in the reciprocal of the mini-batch size and that it is decreasing if the mini-batch size is larger than a threshold ( further experiments reveal that this threshold can be as small as 2 ) . The increased variance as the mini-batch size decreases should also intuitively imply convergence to lower training loss values and in turn better prediction and generalization ability ( these relationships are yet to be confirmed analytically ; but we provide empirical evidence to their validity ) . The major contributions of this paper are as follows . • For linear regression , we show that in each iteration the norm of any linear combination of sample-wise gradients is a decreasing function of the mini-batch size b ( Theorem 1 ) . As a special case , the variance of the stochastic gradient estimator and the full gradient at the iterate in step t are also decreasing functions of b at any iteration step t ( Theorem 2 ) . In addition , the proof provides a recursive relationship between the norm of gradients and the model parameters at each iteration ( Lemma 2 ) . This recursive relationship can be used to calculate any quantity related to the full/stochastic gradient or loss at any iteration with respect to the initial weights . • For the deep linear neural network with L2-loss and samples drawn from a normal distribution , we take two-layer linear network as an example and show that in each iteration step t the trace of any product of the stochastic gradient estimators and weight matrices is a polynomial in 1 { b with coefficients a sum of products of the initial weights ( Theorem 3 ) . As a special case , the variance of the stochastic gradient estimator is a polynomial in 1 { bwithout the constant term ( Theorem 4 ) and therefore it is a decreasing function of b when b is large enough ( Theorem 5 ) . The results and proof techniques can be easily extended to general deep linear networks . As a comparison , other papers that study theoretical properties of two-layer networks either fix one layer of the network , or assume the over-parameterized property of the model and they study convergence , while our paper makes no such assumptions on the model capacity . The proof also reveals the structure of the coefficients of the polynomial , and thus serving as a tool for future work on proving other properties of the stochastic gradient estimators . • The proofs are involved and require several key ideas . The main one is to show a more general result than it is necessary in order to carry out the induction . The induction is on time step t. The key idea is to show a much more general result that lets us carry out induction . New concepts and definitions are introduced in order to handle the more general case . Along the way we show a result of general interest establishing expectation of several rank one matrices sampled from a normal distribution intertwined with constant matrices . • We verify the theoretical results on various datasets and provide further understanding . We further empirically show that the results extend to other widely used network structures and hold for all choices of the mini-batch sizes . We also empirically verify that , on average , in each iteration the loss function value and the generalization ability ( measured by the gap between accuracy on the training and test sets ) are all decreasing functions of the minibatch size . In conclusion , we study the dynamics of SGD under linear regression and a two-layer linear network setting by focusing on the decreasing property of the variance of stochastic gradient estimators with respect to the mini-batch size . The proof techniques can also be used to derive other properties of the SGD dynamics in regard to the mini-batch size and initial weights . To the best of authors ’ knowledge , the work is the first one to theoretically study the impact of the mini-batch size on the variance of the gradient subject to the conditions on the initial weights , under mild assumptions on the network and the loss function . We support our theoretical results by experiments . We further experiment on other state-of-the-art deep learning models and datasets to empirically show the validity of the conjectures about the impact of mini-batch size on average loss , average accuracy and the generalization ability of the model . The rest of the manuscript is structured as follows . In Section 2 we review the literature while in Section 3 we present the theoretical results on how mini-batch sizes impact the variance of stochastic gradient estimators , under different models including linear regression and deep linear networks . Section 4 introduces ( part of ) the experiments that verify our theorems and provide further insights into the impact of the mini-batch sizes on SGD performance . We defer the complete experimental details to Appendix A and the proofs of the theorems and other technical details to to Appendix B . 2 LITERATURE REVIEW . Stochastic gradient descent type methods are broadly used in machine learning ( Bottou , 1991 ; LeCun et al. , 1998 ; Bottou et al. , 2018 ) . The performance of SGD highly relies on the choice of the mini-batch size . It has been widely observed that choosing a large mini-batch size to train deep neural networks appears to deteriorate generalization ( LeCun et al. , 2012 ) . This phenomenon exists even if the models are trained without any budget or limits , until the loss function value ceases to improve ( Keskar et al. , 2017 ) . One explanation for this phenomenon is that large mini-batch SGD produces “ sharp ” minima that generalize worse ( Hochreiter & Schmidhuber , 1997 ; Keskar et al. , 2017 ) . Specialized training procedures to achieve good performance with large mini-batch sizes have also been proposed ( Hoffer et al. , 2017 ; Goyal et al. , 2017 ) . It is well-known that SGD has a slow asymptotic rate of convergence due to its inherent variance ( Johnson & Zhang , 2013 ) . Variants of SGD that can reduce the variance of the stochastic gradient estimator , which yield faster convergence , have also been suggested . The use of the information of full gradients to provide variance control for stochastic gradients is addressed in Johnson & Zhang ( 2013 ) ; Roux et al . ( 2012 ) ; Shalev-Shwartz & Zhang ( 2013 ) . The works in Lei et al . ( 2017 ) ; Li et al . ( 2014 ) ; Schmidt et al . ( 2017 ) further improve the efficiency and complexity of the algorithm by carefully controling the variance . There is prior work focusing on studying the dynamics of SGD . Neelakantan et al . ( 2015 ) propose to add isotropic white noise to the full gradient to study the “ structured ” variance . The works in Li et al . ( 2017 ) ; Mandt et al . ( 2017 ) ; Jastrzebski et al . ( 2017 ) connect SGD with stochastic differential equations to explain the property of converged minima and generalization ability of the model . Smith & Le ( 2017 ) propose an “ optimal ” mini-batch size which maximizes the test set accuracy by a Bayesian approach . The Stochastic Gradient Langevin Dynamics ( SGLD , a variant of SGD ) algorithm for non-convex optimization is studied in Zhang et al . ( 2017 ) ; Mou et al . ( 2018 ) . In most of the prior work about the convergence of SGD , it is assumed that the variance of stochastic gradient estimators is upper-bounded by a linear function of the norm of the full gradient , e.g . Assumption 4.3 in Bottou et al . ( 2018 ) . Gower et al . ( 2019 ) give more precise bounds of the variance under different sampling methods and Khaled & Richtárik ( 2020 ) extend them to smooth non-convex regime . These bounds are still dependent on the model parameters at the corresponding iteration . To the best of the authors ’ knowledge , there is no existing result which represents the variance of stochastic gradient estimators only using the initial weights and the mini-batch size . This paper partially solves this problem .
The paper shows that the variance of the gradient has an inverse dependence on the batch size in linear networks, subject to the knowledge of the initial weights. The main novelty of the paper is the computation of an exact dependence between batch size and variance of the gradient in the linear regression setting. In addition to that, the authors conduct a lot of experiments involving non-linear networks and real-world datasets, that show the inverse dependence of the variance of gradient and batch size throughout the training.
SP:82228b43db88274a90aa34ff6b67f53bed74b539
Active Deep Probabilistic Subsampling
1 INTRODUCTION . Present-day technologies produce and consume vast amounts of data , which is typically acquired using an analog-to-digital converter ( ADC ) . The amount of data digitized by an ADC is determined not only by the temporal sampling rate , but also by the manner in which spatial acquisitions are taken , e.g . by using a specific design of sensor arrays . Reducing the number of sample acquisitions needed , can lead to meaningful reductions in scanning time , e.g . in Magnetic Resonance Imaging ( MRI ) , radiation exposure , e.g . in Computed Tomography ( CT ) , battery drain , and bandwidth requirements . While the Nyquist theorem is traditionally used to provide theoretical bounds on the sampling rate , in recent years signal reconstruction from sub-Nyquist sampled data has been achieved through a framework called Compressive Sensing ( CS ) . First proposed by Donoho ( 2006 ) , and later applied for MRI by Lustig et al . ( 2007 ) , CS leverages structural signal priors , specifically sparsity under some known transform . By taking compressive measurements followed by iterative optimization of a linear system under said sparsity prior , reconstruction of the original signal is possible while sampling at sub-Nyquist rates . Researchers have employed CS with great success in a wide variety of applications , such as radar ( Baraniuk & Steeghs , 2007 ; Ender , 2010 ) , seismic surveying ( Herrmann et al. , 2012 ) , spectroscopy ( Sanders et al. , 2012 ) , and medical imaging ( Han et al. , 2016 ; Lai et al. , 2016 ) . However , both the need to know the sparsifying basis of the data , and the iterative nature of the reconstruction algorithms , still hamper practical applicability of CS in many situations . These limitations can be overcome by the use of deep learning reconstruction models that make the sparsity assumption implicit , and facilitate non-iterative inference once trained . Moreover , the ( typically random ) nature of the measurement matrix in CS does , despite adhering to the given assumptions , not necessarily result in an optimal measurement given the underlying data statistics and the downstream system task . This has recently been tackled by algorithms that learn the sampling scheme from a data distribution . In general , these data-driven sampling algorithms can be divided into two categories : algorithms that learn sampling schemes which are fixed once learned ( Huijben et al. , 2020a ; b ; c ; Ravishankar & Bresler , 2011 ; Sanchez et al. , 2020 ; Bahadir et al. , 2019 ; Bahadir et al. , 2020 ; Weiss et al. , 2019 ) , and algorithms that learn to actively sample ( Ji et al. , 2008 ; Zhang et al. , 2019 ; Jin et al. , 2019 ; Pineda et al. , 2020 ; Bakker et al. , 2020 ) ; selecting new samples based on sequential acquisition of the information . The former type of algorithms learn a sampling scheme that - on average - selects informative samples of all instances originating from the training distribution . However , when this distribution is multi-modal , using one globally optimized sampling scheme , can easily be sub-optimal on instance-level . Active acquisition algorithms deal with such shifts in underlying data statistics by conditioning sampling behavior on previously acquired information from the instance ( e.g . the image to be sampled ) . This results in a sampling sequence that varies across test instances , i.e . sampling is adapted to the new data . This adaptation as a result of conditioning , promises lower achievable sampling rates , or better downstream task performance for the same rate , compared to sampling schemes that operate equivalently on all data . In this work , we extend the Deep Probabilistic Subsampling ( DPS ) framework ( Huijben et al. , 2020a ) to an active acquisition framework by making the sampling procedure iterative and conditional on the samples already acquired , see Fig . 1 . We refer to our method as Active Deep Probabilistic Subsampling ( A-DPS ) . We show how A-DPS clearly exploits the ten different modalities ( i.e . the digits ) present in the MNIST dataset to adopts instance-adaptive sampling sequences . Moreover , we demonstrate both on MNIST ( LeCun et al. , 1998 ) and the real-world fast MRI knee dataset ( Zbontar et al. , 2018 ) , that A-DPS outperforms other state-of-the-art models for learned sub-Nyquist sampling . We make all code publicly available upon publication , in order to facilitate benchmarking to all provided baselines and A-DPS in future research . 2 RELATED WORK . Recently , several techniques for learning a fixed sampling pattern have been proposed , especially in the field of MR imaging , in which Ravishankar & Bresler ( 2011 ) were one of the firsts . In this work , the authors make use of non-overlapping cells in k-space , and move samples between these cells.During training Ravishankar & Bresler ( 2011 ) alternate between reconstruction and relocation of sampling positions . After a reconstruction step they sort the cells in terms of reconstructing error and an infinite-p norm . Selected samples from lower scoring cells are relocated to higher scoring cells in a greedy fashion . Sanchez et al . ( 2020 ) also propose a greedy approach , in which samples are not relocated between cells , but greedily chosen to optimize a reconstruction loss on a batch of examples . Both of the types of greedy optimization do however not allow for joint learning of sampling together with a downstream reconstruction/task model , as the reconstruction has to either be parameter-free or pretrained to work well with a variety of sampling schemes . Bahadir et al . ( 2019 ) on the other hand propose to learn the sampling pattern by thresholding pixelbased i.i.d . samples drawn from a uniform distribution , dubbed Learning-based Optimization of the Under-sampling PattErn ( LOUPE ) . The sample rate of LOUPE is indirectly controlled by promoting sparsity through the use of an ` 1 penalty on the thresholds . One of the first active sampling schemes was proposed by Ji et al . ( 2008 ) , who leverage CS reconstruction techniques that also give a measure of uncertainty of the reconstruction using Bayesian modeling . Ji et al . ( 2008 ) leveraged this uncertainty in the reconstruction to adaptivly select the next measurement that will reduce this uncertainty by the largest amount . However , this method - and other similar works from ( Carson et al. , 2012 ; Li et al. , 2013 ) - rely on linearly combined measurements , rather than discrete sampling , with which we concern ourselves here . In the field of MRI , Zhang et al . ( 2019 ) propose an active acquisition scheme by leveraging a reconstruction and adversarial neural network . Whereas the reconstruction network is trained to reconstruct MR images from the subsampled Fourier space ( k-space ) , the adversarial network is trained to distinguish between already sampled , and omitted lines in this space . The k-space line that is most believed to be ‘ fake ’ ( i.e . filled in by the reconstruction network ) by the adversarial network , is sampled next . However , This framework only works for undersampled Fourier to image reconstruction tasks , as the discriminator requires mappings of the image in k-space . Jin et al . ( 2019 ) put forth an active acquisition scheme for MRI by leveraging reinforcement learning ( RL ) . Two neural networks , one for sampling and one for reconstruction are trained jointly using a Monte-Carlo tree search , resulting in a sampling policy that is dependent on the current reconstruction of the image . Concurrently with our work , both Pineda et al . ( 2020 ) and Bakker et al . ( 2020 ) proposed RL-based active acquisition techniques . Pineda et al . ( 2020 ) leverages a Double Deep Q-Network . The model is trained using a modified -greedy policy , in which the best action is taken with probability 1− , and an exploratory action is taken with probability . Bakker et al . ( 2020 ) compare greedy with nongreedy training , finding that the greedy method leads to a higher degree of adaptability , especially for tasks with a long horizon ( i.e . more samples to be taken ) . Both of the frameworks proposed by ( Pineda et al. , 2020 ) and Bakker et al . ( 2020 ) make use of a pretrained reconstruction network , which differs from the proposed A-DPS method that enables joint training of both the reconstruction ( task ) network and sampling network . Even though subsampling is an extreme form of data compression , we differentiate from typical data compression architectures like deep encoder-decoder structures ( Theis et al. , 2017 ; Ballé et al. , 2017 ) , as these methods do not reduce data rates at the measurement stage . The feedback recurrent autoencoder proposed by Yang et al . ( 2020 ) is however related to A-DPS through its use of a recurrent context . But whereas Yang et al . ( 2020 ) learn a recurrent context to inform the encoder stage of the network , A-DPS uses this to inform the sampling pattern . 3 METHOD . 3.1 GENERAL FRAMEWORK . Given a prediction task s we are interested in learning to predict an optimal subsampling scheme A ∈ { 0 , 1 } M×N ( with M N ) on an input signal x ∈ RN , resulting in a measurement ỹ ∈ RM : ỹ = Ax . ( 1 ) Each row in A is constrained to have ` 0-norm of 1 , while each column in A is constrained to have an ` 0-norm of either 0 or 1 , i.e . each of the N candidate samples is selected at most once . In the rest of this paper we will index these candidate samples with n ∈ { 1 , . . . , N } , and the selected samples with m ∈ { 1 , . . . , M } . The percentage of selected samples from the candidate samples is called the sampling ratio r =M/N · 100 % . We also introduce a non-compressed form of the measurement ỹ , called y ∈ RN , that contains N −M zeros , and M non-zeros at the sampled indices specified by A , i.e . the masked input . This way , the location of samples from x is preserved , which is especially useful whenA changes during training . To acquire y from x , one seeks a subsampling mask d that can be applied on x via : y = d x = ATAx , ( 2 ) where denotes an element-wise multiplication . From the resulting measurement y we then aim at predicting the downstream task s through : ŝ = fθ ( y ) , ( 3 ) where fθ ( . ) is a function that is differentiable with respect to its input and parameters θ , e.g . a neural network . Normally , optimization of the task model fθ ( . ) is achieved through backpropagation of some loss function L ( s , ŝ ) . However , calculating gradients on the sampling matrix is blocked by its combinatorial nature , inhibiting joint training of the task with the sampling operation . The DPS framework provides a solution to this problem , on which we will elaborate in the next section . 3.2 DPS : DEEP PROBABILISTIC SUBSAMPLING . To enable joint training of the sampling operation with the downstream task model , Huijben et al . ( 2020a ) introduce DPS . Rather than optimizing A directly , they propose to optimize a generative sampling model P ( A|φ ) , whereφ are learned unnormalized logits of ( possibly multiple ) categorical distribution ( s ) . Each distribution expresses the probabilities for sampling any of the elements xn fromx through sampling matrixA . More specifically , φm , n is the log-probability for setting am , n = 1 , and thus sampling xn as mth sample . To generate a sampling pattern from these unnormalized logits , i.e . implementation of this conditional model , the Gumbel-max trick is leveraged ( Gumbel , 1954 ) . In the Gumbel-max trick the unnormalized logits are perturbed with i.i.d . Gumbel noise samples em , n ∼ Gumbel ( 0 , 1 ) . By selecting the maximum of this perturbation a realization of the sampling mask can be found using : Am , : = one-hotN { argmax n { wm−1 , n + φm , n + em , n } } , ( 4 ) where Am , : denotes the m-th row of A and one-hotN creates a one-hot vector of length N , with the one at the index specified by the argmax operator . Moreover , the cumulative mask wm−1 , n ∈ { −∞ , 0 } masks previously selected samples by adding minus infinity to those logits , thereby ensuring sampling without replacement . During backpropagation , gradients are computed by relaxing this sampling procedure using the Gumbel-softmax trick ( Jang et al. , 2016 ; Maddison et al. , 2017 ) , resulting in : ∇φmAm , : : = ∇φmEem [ softmaxτ { wm−1 , n + φm , n + em , n } ] , ( 5 ) where τ denotes the temperature parameter of the softmax operator . Setting τ > 0 results in a smoothed sampling matrix A ( i.e . elements can have values between 0 and 1 as well ) , allowing gradients to distribute over multiple logits during training . In the limit of τ → 0 the softmax operator approaches the one-hot argmax function of equation ( 4 ) . Although this approach – also known as straight-through Gumbel-softmax – leads to biased gradients , it has been shown to work well in practice , and Huijben et al . ( 2020a ) keep τ at a fixed value during training . Huijben et al . ( 2020a ) propose two regimes of DPS . First , Top-1 sampling , an expressive form of DPS where each of the M selected samples are separately conditioned on all N candidate samples , resulting in M ×N trainable logits φm , n . Second , Top-M sampling ( called Top-K in their paper ) , a constrained form where all M samples together are conditioned on all N candidate samples , i.e . the logits φn are shared between the M rows of A , resulting in only N trainable logits . While Top-1 sampling is more expressive , Huijben et al . ( 2020a ) noticed slightly better results for the Top-M regime , possibly thanks to the smaller number of trainable logits , therefore facilitating optimization . For scaleability reasons , we thus choose to continue with Top-M sampling in this work and refer to this regime as DPS in the rest of this paper . We refer the reader to Huijben et al . ( 2020a ) for more details regarding DPS .
In this paper, the authors consider the problem of compressed sensing where the underlying signal of interest is captured and restored based only on sparse measurements: Specifically, this paper focuses on the scenario of Deep Probabilistic Subsampling (DPS) which finds sparse measurements in the way that the models designed to solve specific learning problems based on these measurements are jointly optimized. The authors extend DPS to a sequential framework that iteratively and actively selects the next measurement points: The proposed approach encodes the information accumulated until a time step into a context vector which is updated, and used in selecting the next point, in an LSTM-like framework (see minor comments below). In the experiments with two toy problems (including MNIST) and an MRI reconstruction problem, the authors demonstrated that the proposed Active DPS (ADPS) outperforms DPS (in toy problems) and three other compressed sensing algorithms (for MRI reconstruction).
SP:8ef105e3182737dfc50be0d20883ab2fe2fc3610
Active Deep Probabilistic Subsampling
1 INTRODUCTION . Present-day technologies produce and consume vast amounts of data , which is typically acquired using an analog-to-digital converter ( ADC ) . The amount of data digitized by an ADC is determined not only by the temporal sampling rate , but also by the manner in which spatial acquisitions are taken , e.g . by using a specific design of sensor arrays . Reducing the number of sample acquisitions needed , can lead to meaningful reductions in scanning time , e.g . in Magnetic Resonance Imaging ( MRI ) , radiation exposure , e.g . in Computed Tomography ( CT ) , battery drain , and bandwidth requirements . While the Nyquist theorem is traditionally used to provide theoretical bounds on the sampling rate , in recent years signal reconstruction from sub-Nyquist sampled data has been achieved through a framework called Compressive Sensing ( CS ) . First proposed by Donoho ( 2006 ) , and later applied for MRI by Lustig et al . ( 2007 ) , CS leverages structural signal priors , specifically sparsity under some known transform . By taking compressive measurements followed by iterative optimization of a linear system under said sparsity prior , reconstruction of the original signal is possible while sampling at sub-Nyquist rates . Researchers have employed CS with great success in a wide variety of applications , such as radar ( Baraniuk & Steeghs , 2007 ; Ender , 2010 ) , seismic surveying ( Herrmann et al. , 2012 ) , spectroscopy ( Sanders et al. , 2012 ) , and medical imaging ( Han et al. , 2016 ; Lai et al. , 2016 ) . However , both the need to know the sparsifying basis of the data , and the iterative nature of the reconstruction algorithms , still hamper practical applicability of CS in many situations . These limitations can be overcome by the use of deep learning reconstruction models that make the sparsity assumption implicit , and facilitate non-iterative inference once trained . Moreover , the ( typically random ) nature of the measurement matrix in CS does , despite adhering to the given assumptions , not necessarily result in an optimal measurement given the underlying data statistics and the downstream system task . This has recently been tackled by algorithms that learn the sampling scheme from a data distribution . In general , these data-driven sampling algorithms can be divided into two categories : algorithms that learn sampling schemes which are fixed once learned ( Huijben et al. , 2020a ; b ; c ; Ravishankar & Bresler , 2011 ; Sanchez et al. , 2020 ; Bahadir et al. , 2019 ; Bahadir et al. , 2020 ; Weiss et al. , 2019 ) , and algorithms that learn to actively sample ( Ji et al. , 2008 ; Zhang et al. , 2019 ; Jin et al. , 2019 ; Pineda et al. , 2020 ; Bakker et al. , 2020 ) ; selecting new samples based on sequential acquisition of the information . The former type of algorithms learn a sampling scheme that - on average - selects informative samples of all instances originating from the training distribution . However , when this distribution is multi-modal , using one globally optimized sampling scheme , can easily be sub-optimal on instance-level . Active acquisition algorithms deal with such shifts in underlying data statistics by conditioning sampling behavior on previously acquired information from the instance ( e.g . the image to be sampled ) . This results in a sampling sequence that varies across test instances , i.e . sampling is adapted to the new data . This adaptation as a result of conditioning , promises lower achievable sampling rates , or better downstream task performance for the same rate , compared to sampling schemes that operate equivalently on all data . In this work , we extend the Deep Probabilistic Subsampling ( DPS ) framework ( Huijben et al. , 2020a ) to an active acquisition framework by making the sampling procedure iterative and conditional on the samples already acquired , see Fig . 1 . We refer to our method as Active Deep Probabilistic Subsampling ( A-DPS ) . We show how A-DPS clearly exploits the ten different modalities ( i.e . the digits ) present in the MNIST dataset to adopts instance-adaptive sampling sequences . Moreover , we demonstrate both on MNIST ( LeCun et al. , 1998 ) and the real-world fast MRI knee dataset ( Zbontar et al. , 2018 ) , that A-DPS outperforms other state-of-the-art models for learned sub-Nyquist sampling . We make all code publicly available upon publication , in order to facilitate benchmarking to all provided baselines and A-DPS in future research . 2 RELATED WORK . Recently , several techniques for learning a fixed sampling pattern have been proposed , especially in the field of MR imaging , in which Ravishankar & Bresler ( 2011 ) were one of the firsts . In this work , the authors make use of non-overlapping cells in k-space , and move samples between these cells.During training Ravishankar & Bresler ( 2011 ) alternate between reconstruction and relocation of sampling positions . After a reconstruction step they sort the cells in terms of reconstructing error and an infinite-p norm . Selected samples from lower scoring cells are relocated to higher scoring cells in a greedy fashion . Sanchez et al . ( 2020 ) also propose a greedy approach , in which samples are not relocated between cells , but greedily chosen to optimize a reconstruction loss on a batch of examples . Both of the types of greedy optimization do however not allow for joint learning of sampling together with a downstream reconstruction/task model , as the reconstruction has to either be parameter-free or pretrained to work well with a variety of sampling schemes . Bahadir et al . ( 2019 ) on the other hand propose to learn the sampling pattern by thresholding pixelbased i.i.d . samples drawn from a uniform distribution , dubbed Learning-based Optimization of the Under-sampling PattErn ( LOUPE ) . The sample rate of LOUPE is indirectly controlled by promoting sparsity through the use of an ` 1 penalty on the thresholds . One of the first active sampling schemes was proposed by Ji et al . ( 2008 ) , who leverage CS reconstruction techniques that also give a measure of uncertainty of the reconstruction using Bayesian modeling . Ji et al . ( 2008 ) leveraged this uncertainty in the reconstruction to adaptivly select the next measurement that will reduce this uncertainty by the largest amount . However , this method - and other similar works from ( Carson et al. , 2012 ; Li et al. , 2013 ) - rely on linearly combined measurements , rather than discrete sampling , with which we concern ourselves here . In the field of MRI , Zhang et al . ( 2019 ) propose an active acquisition scheme by leveraging a reconstruction and adversarial neural network . Whereas the reconstruction network is trained to reconstruct MR images from the subsampled Fourier space ( k-space ) , the adversarial network is trained to distinguish between already sampled , and omitted lines in this space . The k-space line that is most believed to be ‘ fake ’ ( i.e . filled in by the reconstruction network ) by the adversarial network , is sampled next . However , This framework only works for undersampled Fourier to image reconstruction tasks , as the discriminator requires mappings of the image in k-space . Jin et al . ( 2019 ) put forth an active acquisition scheme for MRI by leveraging reinforcement learning ( RL ) . Two neural networks , one for sampling and one for reconstruction are trained jointly using a Monte-Carlo tree search , resulting in a sampling policy that is dependent on the current reconstruction of the image . Concurrently with our work , both Pineda et al . ( 2020 ) and Bakker et al . ( 2020 ) proposed RL-based active acquisition techniques . Pineda et al . ( 2020 ) leverages a Double Deep Q-Network . The model is trained using a modified -greedy policy , in which the best action is taken with probability 1− , and an exploratory action is taken with probability . Bakker et al . ( 2020 ) compare greedy with nongreedy training , finding that the greedy method leads to a higher degree of adaptability , especially for tasks with a long horizon ( i.e . more samples to be taken ) . Both of the frameworks proposed by ( Pineda et al. , 2020 ) and Bakker et al . ( 2020 ) make use of a pretrained reconstruction network , which differs from the proposed A-DPS method that enables joint training of both the reconstruction ( task ) network and sampling network . Even though subsampling is an extreme form of data compression , we differentiate from typical data compression architectures like deep encoder-decoder structures ( Theis et al. , 2017 ; Ballé et al. , 2017 ) , as these methods do not reduce data rates at the measurement stage . The feedback recurrent autoencoder proposed by Yang et al . ( 2020 ) is however related to A-DPS through its use of a recurrent context . But whereas Yang et al . ( 2020 ) learn a recurrent context to inform the encoder stage of the network , A-DPS uses this to inform the sampling pattern . 3 METHOD . 3.1 GENERAL FRAMEWORK . Given a prediction task s we are interested in learning to predict an optimal subsampling scheme A ∈ { 0 , 1 } M×N ( with M N ) on an input signal x ∈ RN , resulting in a measurement ỹ ∈ RM : ỹ = Ax . ( 1 ) Each row in A is constrained to have ` 0-norm of 1 , while each column in A is constrained to have an ` 0-norm of either 0 or 1 , i.e . each of the N candidate samples is selected at most once . In the rest of this paper we will index these candidate samples with n ∈ { 1 , . . . , N } , and the selected samples with m ∈ { 1 , . . . , M } . The percentage of selected samples from the candidate samples is called the sampling ratio r =M/N · 100 % . We also introduce a non-compressed form of the measurement ỹ , called y ∈ RN , that contains N −M zeros , and M non-zeros at the sampled indices specified by A , i.e . the masked input . This way , the location of samples from x is preserved , which is especially useful whenA changes during training . To acquire y from x , one seeks a subsampling mask d that can be applied on x via : y = d x = ATAx , ( 2 ) where denotes an element-wise multiplication . From the resulting measurement y we then aim at predicting the downstream task s through : ŝ = fθ ( y ) , ( 3 ) where fθ ( . ) is a function that is differentiable with respect to its input and parameters θ , e.g . a neural network . Normally , optimization of the task model fθ ( . ) is achieved through backpropagation of some loss function L ( s , ŝ ) . However , calculating gradients on the sampling matrix is blocked by its combinatorial nature , inhibiting joint training of the task with the sampling operation . The DPS framework provides a solution to this problem , on which we will elaborate in the next section . 3.2 DPS : DEEP PROBABILISTIC SUBSAMPLING . To enable joint training of the sampling operation with the downstream task model , Huijben et al . ( 2020a ) introduce DPS . Rather than optimizing A directly , they propose to optimize a generative sampling model P ( A|φ ) , whereφ are learned unnormalized logits of ( possibly multiple ) categorical distribution ( s ) . Each distribution expresses the probabilities for sampling any of the elements xn fromx through sampling matrixA . More specifically , φm , n is the log-probability for setting am , n = 1 , and thus sampling xn as mth sample . To generate a sampling pattern from these unnormalized logits , i.e . implementation of this conditional model , the Gumbel-max trick is leveraged ( Gumbel , 1954 ) . In the Gumbel-max trick the unnormalized logits are perturbed with i.i.d . Gumbel noise samples em , n ∼ Gumbel ( 0 , 1 ) . By selecting the maximum of this perturbation a realization of the sampling mask can be found using : Am , : = one-hotN { argmax n { wm−1 , n + φm , n + em , n } } , ( 4 ) where Am , : denotes the m-th row of A and one-hotN creates a one-hot vector of length N , with the one at the index specified by the argmax operator . Moreover , the cumulative mask wm−1 , n ∈ { −∞ , 0 } masks previously selected samples by adding minus infinity to those logits , thereby ensuring sampling without replacement . During backpropagation , gradients are computed by relaxing this sampling procedure using the Gumbel-softmax trick ( Jang et al. , 2016 ; Maddison et al. , 2017 ) , resulting in : ∇φmAm , : : = ∇φmEem [ softmaxτ { wm−1 , n + φm , n + em , n } ] , ( 5 ) where τ denotes the temperature parameter of the softmax operator . Setting τ > 0 results in a smoothed sampling matrix A ( i.e . elements can have values between 0 and 1 as well ) , allowing gradients to distribute over multiple logits during training . In the limit of τ → 0 the softmax operator approaches the one-hot argmax function of equation ( 4 ) . Although this approach – also known as straight-through Gumbel-softmax – leads to biased gradients , it has been shown to work well in practice , and Huijben et al . ( 2020a ) keep τ at a fixed value during training . Huijben et al . ( 2020a ) propose two regimes of DPS . First , Top-1 sampling , an expressive form of DPS where each of the M selected samples are separately conditioned on all N candidate samples , resulting in M ×N trainable logits φm , n . Second , Top-M sampling ( called Top-K in their paper ) , a constrained form where all M samples together are conditioned on all N candidate samples , i.e . the logits φn are shared between the M rows of A , resulting in only N trainable logits . While Top-1 sampling is more expressive , Huijben et al . ( 2020a ) noticed slightly better results for the Top-M regime , possibly thanks to the smaller number of trainable logits , therefore facilitating optimization . For scaleability reasons , we thus choose to continue with Top-M sampling in this work and refer to this regime as DPS in the rest of this paper . We refer the reader to Huijben et al . ( 2020a ) for more details regarding DPS .
This paper develops methods to perform active subsampling. That is, given some downstream task like classification or image reconstruction, it sequentially selects which elements of an image or signal to sample so as to perform said task. It does so by extending the Deep Probabilistic Subsampling (DPS) method developed by Huijben et al. The proposed method is applied to two problems as well as a simplified, low-resolution MRI reconstruction problem.
SP:8ef105e3182737dfc50be0d20883ab2fe2fc3610
Efficient Reinforcement Learning in Factored MDPs with Application to Constrained RL
√ nH|Si| , where |Si| is the cardinality of the factored state sub- space , H is the planning horizon and n is the number of factored transitions . We also provide a lower bound , which shows near-optimality of our algorithm w.r.t . timestep T , horizon H and factored state-action subspace cardinality . Finally , as an application , we study a new formulation of constrained RL , RL with knapsack constraints ( RLwK ) , and provide the first sample-efficient algorithm based on FMDP-BF . 1 INTRODUCTION . Reinforcement learning ( RL ) is concerned with sequential decision making problems where an agent interacts with a stochastic environment and aims to maximize its cumulative rewards . The environment is usually modeled as a Markov Decision Process ( MDP ) whose transition kernel and reward function are unknown to the agent . A main challenge of the agent is efficient exploration in the MDP , so as to minimize its regret , or the related sample complexity of exploration . Extensive study has been done on the tabular case , in which almost no prior knowledge is assumed on the MDP dynamics . The regret or sample complexity bounds typically depend polynomially on the cardinality of state and action spaces ( e.g. , Strehl et al. , 2009 ; Jaksch et al. , 2010 ; Azar et al. , 2017 ; Dann et al. , 2017 ; Jin et al. , 2018 ; Dong et al. , 2019 ; Zanette & Brunskill , 2019 ) . Moreover , matching lower bounds ( e.g. , Jaksch et al. , 2010 ) imply that these results can not be improved without additional assumptions . On the other hand , many RL tasks involve large state and action spaces , for which these regret bounds are still excessively large . In many practical scenarios , one can often take advantage of specific structures of the MDP to develop more efficient algorithms . For example , in robotics , the state may be high-dimensional , but the subspaces of the state may evolve independently of others , and only depend on a lowdimensional subspace of the previous state . Formally , these problems can be described as factored MDPs ( Boutilier et al. , 2000 ; Kearns & Koller , 1999 ; Guestrin et al. , 2003 ) . Most relevant to the present work is Osband & Van Roy ( 2014b ) , who proposed a posterior sampling algorithm and a UCRL-like algorithm that both enjoy √ T regret , where T is the maximum timestep . Their regret bounds have a linear dependence on the time horizon and each factored state subspace . It is unclear whether this bound is tight or not . In this work , we tackle this problem by proposing algorithms with improved regret bounds , and developing corresponding lower bounds for episodic FMDPs . We propose a sample- and computationefficient algorithm called FMDP-BF based on the principle of optimism in the face of uncertainty , and prove its regret bounds . We also provide a lower bound , which implies that our algorithm is near-optimal with respect to the timestep T , the planning horizon H and factored state-action subspace cardinality |X [ Zi ] | . As an application , we study a novel formulation of constrained RL , known as RL with knapsack constraints ( RLwK ) , which we believe is natural to capture many scenarios in real-life applications . We apply FMDP-BF to this setting , to obtain a statistically efficient algorithm with a regret bound that is near-optimal in terms of T , S , A , and H . Our contributions are summarized as follows : 1 . We propose an algorithm for FMDP , and prove its regret bound that improves on the previous result of Osband & Van Roy ( 2014b ) by a factor of √ nH|Si| . 2 . We prove a regret lower bound for FMDP , which implies that our regret bound is nearoptimal in terms of timestep T , horizon H and factored state-action subspace cardinality . 3 . We apply FMDP-BF in RLwK , a novel constrained RL setting with knapsack constraints , and prove a regret bound that is near-optimal in terms of T , S , A and H . 2 PRELIMINARIES . We consider the setting of a tabular episodic Markov decision process ( MDP ) , ( S , A , H , P , R ) , where S is the set of states , A is the action set , H is the number of steps in each episode . P is the transition probability matrix so that P ( ·|s , a ) gives the distribution over states if action a is taken on state s , and R ( s , a ) is the reward distribution of taking action a on state s with support [ 0 , 1 ] . We use R̄ ( s , a ) to denote the expectation E [ R ( s , a ) ] . In each episode , the agent starts from an initial state s1 that may be arbitrarily selected . At each step h ∈ [ H ] , the agent observes the current state sh ∈ S , takes action ah ∈ A , receives a reward rh sampled from R ( sh , ah ) , and transits to state sh+1 with probability P ( sh+1|sh , ah ) . The episode ends when sH+1 is reached . A policy π is a collection of H policy functions { πh : S → A } h∈ [ H ] . We use V πh : S → R to denote the value function at step h under policy π , which gives the expected sum of remaining rewards received under policy π starting from sh = s , i.e . V πh ( s ) = E [ ∑H h′=hR ( sh′ , πh′ ( sh′ ) ) | sh = s ] . Accordingly , we define Qπh ( s , a ) as the expected Q-value function at step h : Q π h ( s , a ) = E [ R ( sh , ah ) + ∑H h′=h+1R ( sh′ , πh′ ( sh′ ) ) | sh = s , ah = a ] . We use V ∗h and Q ∗ h to denote the optimal value and Q-functions under optimal policy π∗ at step h. The agent interacts with the environment for K episodes with policy πk = { πk , h : S → A } h∈ [ H ] determined before the k-th episode begins . The agent ’ s goal is to maximize its cumulative rewards∑K k=1 ∑H h=1 rk , h over T = KH steps , or equivalently , to minimize the following expected regret : Reg ( K ) def = K∑ k=1 [ V ∗1 ( sk,1 ) − V πk 1 ( sk,1 ) ] , where sk,1 is the initial state of episode k . 2.1 FACTORED MDPS . A factored MDP is an MDP whose rewards and transitions exhibit certain conditional independence structures . We start with the formal definition of factored MDP ( Boutilier et al. , 2000 ; Osband & Van Roy , 2014b ; Xu & Tewari , 2020 ; Lu & Van Roy , 2019 ) . LetP ( X , Y ) denote the set of functions that map x ∈ X to the probability distribution on Y . Definition 1 . ( Factored set ) Let X = X1 × · · · × Xd be a factored set . For any subset of indices Z ⊆ { 1 , 2 , . . . , d } , we define the scope set X [ Z ] : = ⊗i∈ZXi . Further , for any x ∈ X , define the scope variable x [ Z ] ∈ X [ Z ] to be the value of the variables xi ∈ Xi with indices i ∈ Z . If Z is a singleton , we will write x [ i ] for x [ { i } ] . Definition 2 . ( Factored reward ) The reward function classR ⊂ P ( X , R ) is factored over S ×A = X = X1 × · · · × Xd with scopes Z1 , · · · , Zm if for all R ∈ R , x ∈ X , there exist functions { Ri ∈ P ( X [ Zi ] , [ 0 , 1 ] ) } mi=1 such that r ∼ R ( x ) is equal to 1 m ∑m i=1 ri with each ri ∼ Ri ( x [ Zi ] ) individually observed . We use R̄i to denote the expectation E [ Ri ] . Definition 3 . ( Factored transition ) The transition function class P ⊂ P ( X , S ) is factored over S × A = X = X1 × · · · × Xd and S = S1 × · · · × Sn with scopes Z1 , · · · , Zn if and only if , for all P ∈ P , x ∈ X , s ∈ S , there exist functions { Pj ∈ P ( X [ Zj ] , Sj ) } nj=1 such that P ( s | x ) =∏n j=1 Pj ( s [ j ] | x [ Zj ] ) . A factored MDP is an MDP with factored rewards and transitions . A factored MDP is fully characterized by M = ( { Xi } di=1 ; { ZRi } m i=1 ; { Ri } mi=1 ; { Sj } n j=1 ; { ZPj } n j=1 ; { Pj } nj=1 ; H ) , where X = S × A , { ZRi } mi=1 and { ZPj } nj=1 are the scopes for the reward and transition functions , which we assume to be known to the agent . An excellent example of factored MDP is given by Osband & Van Roy ( 2014 ) , about a large production line with d machines in sequence with Si possible states for machine i . Over a single time-step each machine can only be influenced by its direct neighbors . For this problem , the scopes ZRi and ZPi of machine i ∈ { 2 , ... , d − 1 } can be defined as { i − 1 , i , i + 1 } , and the scopes of machine 1 and machine d are { 1 , 2 } and { d− 1 , d } respectively . Another possible example to explain factored MDP is about robotics . For a robot , the transition dynamics of its different parts ( e.g . its legs and arms ) may be relatively independent . In that case , the factored transition can be defined for each part separately . For notation simplicity , we use X [ i : j ] and S [ i : j ] to denote X [ ∪k=i , ... , jZk ] and ⊗jk=iSk respectively . Similarly , We use P [ i : j ] ( s′ [ i : j ] | s , a ) to denote ∏j k=i P ( s′ [ k ] | ( s , a ) [ ZPk ] ) . For every V : S → R and the right-linear operators P , we define PV ( s , a ) def= ∑ s′∈S P ( s′ | s , a ) V ( s′ ) . A state-action pair can be represented as ( s , a ) or x . We also use ( s , a ) [ Z ] to denote the corresponding x [ Z ] for notation convenience . We mainly focus on the case where the total time step T = KH is the dominant factor , and assume that T ≥ |Xi| ≥ H during the analysis .
The authors study the factor MDP problem in an online and episodic setting. They provide two main contributions on this question. First, they propose an OFU type algorithm which enjoys a better regret bound than Osband & Van Roy (2014) by a factor of $\sqrt{nH \Gamma}$. The improvement is brought about by a refined consideration on the confidence radius' dependence on the variances of the rewards, which carries a similar idea to the design of UCBVI-CH by Azar et al. 2017 for the tabular case. The second contribution is on the generalization to an episodic FMDP with knapsacks problem, where the authors generalize the approach in the first contribution to provide a regret bound.
SP:9f8f21efc3a1b9f47e34a3ecb2f5092897217362
Efficient Reinforcement Learning in Factored MDPs with Application to Constrained RL
√ nH|Si| , where |Si| is the cardinality of the factored state sub- space , H is the planning horizon and n is the number of factored transitions . We also provide a lower bound , which shows near-optimality of our algorithm w.r.t . timestep T , horizon H and factored state-action subspace cardinality . Finally , as an application , we study a new formulation of constrained RL , RL with knapsack constraints ( RLwK ) , and provide the first sample-efficient algorithm based on FMDP-BF . 1 INTRODUCTION . Reinforcement learning ( RL ) is concerned with sequential decision making problems where an agent interacts with a stochastic environment and aims to maximize its cumulative rewards . The environment is usually modeled as a Markov Decision Process ( MDP ) whose transition kernel and reward function are unknown to the agent . A main challenge of the agent is efficient exploration in the MDP , so as to minimize its regret , or the related sample complexity of exploration . Extensive study has been done on the tabular case , in which almost no prior knowledge is assumed on the MDP dynamics . The regret or sample complexity bounds typically depend polynomially on the cardinality of state and action spaces ( e.g. , Strehl et al. , 2009 ; Jaksch et al. , 2010 ; Azar et al. , 2017 ; Dann et al. , 2017 ; Jin et al. , 2018 ; Dong et al. , 2019 ; Zanette & Brunskill , 2019 ) . Moreover , matching lower bounds ( e.g. , Jaksch et al. , 2010 ) imply that these results can not be improved without additional assumptions . On the other hand , many RL tasks involve large state and action spaces , for which these regret bounds are still excessively large . In many practical scenarios , one can often take advantage of specific structures of the MDP to develop more efficient algorithms . For example , in robotics , the state may be high-dimensional , but the subspaces of the state may evolve independently of others , and only depend on a lowdimensional subspace of the previous state . Formally , these problems can be described as factored MDPs ( Boutilier et al. , 2000 ; Kearns & Koller , 1999 ; Guestrin et al. , 2003 ) . Most relevant to the present work is Osband & Van Roy ( 2014b ) , who proposed a posterior sampling algorithm and a UCRL-like algorithm that both enjoy √ T regret , where T is the maximum timestep . Their regret bounds have a linear dependence on the time horizon and each factored state subspace . It is unclear whether this bound is tight or not . In this work , we tackle this problem by proposing algorithms with improved regret bounds , and developing corresponding lower bounds for episodic FMDPs . We propose a sample- and computationefficient algorithm called FMDP-BF based on the principle of optimism in the face of uncertainty , and prove its regret bounds . We also provide a lower bound , which implies that our algorithm is near-optimal with respect to the timestep T , the planning horizon H and factored state-action subspace cardinality |X [ Zi ] | . As an application , we study a novel formulation of constrained RL , known as RL with knapsack constraints ( RLwK ) , which we believe is natural to capture many scenarios in real-life applications . We apply FMDP-BF to this setting , to obtain a statistically efficient algorithm with a regret bound that is near-optimal in terms of T , S , A , and H . Our contributions are summarized as follows : 1 . We propose an algorithm for FMDP , and prove its regret bound that improves on the previous result of Osband & Van Roy ( 2014b ) by a factor of √ nH|Si| . 2 . We prove a regret lower bound for FMDP , which implies that our regret bound is nearoptimal in terms of timestep T , horizon H and factored state-action subspace cardinality . 3 . We apply FMDP-BF in RLwK , a novel constrained RL setting with knapsack constraints , and prove a regret bound that is near-optimal in terms of T , S , A and H . 2 PRELIMINARIES . We consider the setting of a tabular episodic Markov decision process ( MDP ) , ( S , A , H , P , R ) , where S is the set of states , A is the action set , H is the number of steps in each episode . P is the transition probability matrix so that P ( ·|s , a ) gives the distribution over states if action a is taken on state s , and R ( s , a ) is the reward distribution of taking action a on state s with support [ 0 , 1 ] . We use R̄ ( s , a ) to denote the expectation E [ R ( s , a ) ] . In each episode , the agent starts from an initial state s1 that may be arbitrarily selected . At each step h ∈ [ H ] , the agent observes the current state sh ∈ S , takes action ah ∈ A , receives a reward rh sampled from R ( sh , ah ) , and transits to state sh+1 with probability P ( sh+1|sh , ah ) . The episode ends when sH+1 is reached . A policy π is a collection of H policy functions { πh : S → A } h∈ [ H ] . We use V πh : S → R to denote the value function at step h under policy π , which gives the expected sum of remaining rewards received under policy π starting from sh = s , i.e . V πh ( s ) = E [ ∑H h′=hR ( sh′ , πh′ ( sh′ ) ) | sh = s ] . Accordingly , we define Qπh ( s , a ) as the expected Q-value function at step h : Q π h ( s , a ) = E [ R ( sh , ah ) + ∑H h′=h+1R ( sh′ , πh′ ( sh′ ) ) | sh = s , ah = a ] . We use V ∗h and Q ∗ h to denote the optimal value and Q-functions under optimal policy π∗ at step h. The agent interacts with the environment for K episodes with policy πk = { πk , h : S → A } h∈ [ H ] determined before the k-th episode begins . The agent ’ s goal is to maximize its cumulative rewards∑K k=1 ∑H h=1 rk , h over T = KH steps , or equivalently , to minimize the following expected regret : Reg ( K ) def = K∑ k=1 [ V ∗1 ( sk,1 ) − V πk 1 ( sk,1 ) ] , where sk,1 is the initial state of episode k . 2.1 FACTORED MDPS . A factored MDP is an MDP whose rewards and transitions exhibit certain conditional independence structures . We start with the formal definition of factored MDP ( Boutilier et al. , 2000 ; Osband & Van Roy , 2014b ; Xu & Tewari , 2020 ; Lu & Van Roy , 2019 ) . LetP ( X , Y ) denote the set of functions that map x ∈ X to the probability distribution on Y . Definition 1 . ( Factored set ) Let X = X1 × · · · × Xd be a factored set . For any subset of indices Z ⊆ { 1 , 2 , . . . , d } , we define the scope set X [ Z ] : = ⊗i∈ZXi . Further , for any x ∈ X , define the scope variable x [ Z ] ∈ X [ Z ] to be the value of the variables xi ∈ Xi with indices i ∈ Z . If Z is a singleton , we will write x [ i ] for x [ { i } ] . Definition 2 . ( Factored reward ) The reward function classR ⊂ P ( X , R ) is factored over S ×A = X = X1 × · · · × Xd with scopes Z1 , · · · , Zm if for all R ∈ R , x ∈ X , there exist functions { Ri ∈ P ( X [ Zi ] , [ 0 , 1 ] ) } mi=1 such that r ∼ R ( x ) is equal to 1 m ∑m i=1 ri with each ri ∼ Ri ( x [ Zi ] ) individually observed . We use R̄i to denote the expectation E [ Ri ] . Definition 3 . ( Factored transition ) The transition function class P ⊂ P ( X , S ) is factored over S × A = X = X1 × · · · × Xd and S = S1 × · · · × Sn with scopes Z1 , · · · , Zn if and only if , for all P ∈ P , x ∈ X , s ∈ S , there exist functions { Pj ∈ P ( X [ Zj ] , Sj ) } nj=1 such that P ( s | x ) =∏n j=1 Pj ( s [ j ] | x [ Zj ] ) . A factored MDP is an MDP with factored rewards and transitions . A factored MDP is fully characterized by M = ( { Xi } di=1 ; { ZRi } m i=1 ; { Ri } mi=1 ; { Sj } n j=1 ; { ZPj } n j=1 ; { Pj } nj=1 ; H ) , where X = S × A , { ZRi } mi=1 and { ZPj } nj=1 are the scopes for the reward and transition functions , which we assume to be known to the agent . An excellent example of factored MDP is given by Osband & Van Roy ( 2014 ) , about a large production line with d machines in sequence with Si possible states for machine i . Over a single time-step each machine can only be influenced by its direct neighbors . For this problem , the scopes ZRi and ZPi of machine i ∈ { 2 , ... , d − 1 } can be defined as { i − 1 , i , i + 1 } , and the scopes of machine 1 and machine d are { 1 , 2 } and { d− 1 , d } respectively . Another possible example to explain factored MDP is about robotics . For a robot , the transition dynamics of its different parts ( e.g . its legs and arms ) may be relatively independent . In that case , the factored transition can be defined for each part separately . For notation simplicity , we use X [ i : j ] and S [ i : j ] to denote X [ ∪k=i , ... , jZk ] and ⊗jk=iSk respectively . Similarly , We use P [ i : j ] ( s′ [ i : j ] | s , a ) to denote ∏j k=i P ( s′ [ k ] | ( s , a ) [ ZPk ] ) . For every V : S → R and the right-linear operators P , we define PV ( s , a ) def= ∑ s′∈S P ( s′ | s , a ) V ( s′ ) . A state-action pair can be represented as ( s , a ) or x . We also use ( s , a ) [ Z ] to denote the corresponding x [ Z ] for notation convenience . We mainly focus on the case where the total time step T = KH is the dominant factor , and assume that T ≥ |Xi| ≥ H during the analysis .
This paper proposes a reinforcement learning algorithm FMDP-BF for episodic Factored MDPs. Similar to previous works, FMDP-BF follows the principle of "optimism in the face of uncertainty" to efficiently explore to achieve low regret. Compared to algorithms for general MDPs, FMDP-BF leverages the factorization structure of FMDP and results in exponential regret reduction in the size of the sate space. Compared to previous results for FMDP, the proposed algorithm utilizes Bernstein-type confidence bounds and new bounds on the factored transitions to reduce the regret order. The paper also connects a class of constrained RL to FMDP and provide a sample efficient for the constrained RL problem.
SP:9f8f21efc3a1b9f47e34a3ecb2f5092897217362
Joint Perception and Control as Inference with an Object-based Implementation
1 INTRODUCTION . Human-like computing , which aims at endowing machines with human-like perceptual , reasoning and learning abilities , has recently drawn considerable attention ( Lake , 2014 ; Lake et al. , 2015 ; Baker et al. , 2017 ) . In order to operate within a dynamic environment while preserving homeostasis ( Kauffman , 1993 ) , humans maintain an internal model to learn new concepts efficiently from a few examples ( Friston , 2005 ) . The idea has since inspired many model-based reinforcement learning ( MBRL ) approaches to learn a concise perception model of the world ( Kaelbling et al. , 1998 ) . MBRL agents then use the perceptual model to choose effective actions . However , most existing MBRL methods separate perception modeling and decision making , leaving the potential connection between the objectives of these processes unexplored . A notable work by Hafner et al . ( 2020 ) provides a unified framework for perception and control . Built upon a general principle this framework covers a wide range of objectives in the fields of representation learning and reinforcement learning . However , they omit the discussion on combining perception and control for partially observable Markov decision processes ( POMDPs ) , which formalizes many real-world decision-making problems . In this paper , therefore , we focus on the joint perception and control as inference for POMDPs and provide a specialized joint objective as well as a practical implementation . Many prior MBRL methods fail to facilitate common-sense physical reasoning ( Battaglia et al. , 2013 ) , which is typically achieved by utilizing object-level inductive biases , e.g. , the prior over observed objects ’ properties , such as the type , amount , and locations . In contrast , humans can obtain these inductive biases through interacting with the environment and receiving feedback throughout their lifetimes ( Spelke et al. , 1992 ) , leading to a unified hierarchical and behavioral-correlated perception model to perceive events and objects from the environment ( Lee and Mumford , 2003 ) . Before taking actions , a human agent can use this model to decompose a complex visual scene into distinct parts , understand relations between them , reason about their dynamics and predict the consequences of its actions ( Battaglia et al. , 2013 ) . Therefore , equipping MBRL with object-level inductive biases is essential to create agents capable of emulating human perceptual learning and reasoning and thus complex decision making ( Lake et al. , 2015 ) . We propose to train an agent in a similar way to gain inductive biases by learning the structured properties of the environment . This can enable the agent to plan like a human using its ability to think ahead , see what would happen for a range of possible choices , and make rapid decisions while learning a policy with the help of the inductive bias ( Lake et al. , 2017 ) . Moreover , in order to mimic a human ’ s spontaneous acquisition of inductive biases o1 s1 a1 o2 a2 ……θ1 s2 θ 2 x1 x2 q ( s ) p ( s |x , o ) p ( x , o |s ) p ( s ) throughout its life , we propose to build a model able to acquire new knowledge online , rather than a one which merely generates static information from offline training ( Dehaene et al. , 2017 ) . In this paper , we introduce joint Perception and Control as Inference ( PCI ) as shown in Fig . ( 1 ) , a unified framework for decision making and perception modeling to facilitate understanding of the environment while providing a joint objective for both the perception and the action choice . As we argue that inductive bias gained in object-based perception is beneficial for control tasks , we then propose Object-based Perception Control ( OPC ) , an instantiation of PCI which facilitates control with the help of automatically discovered representations of objects from raw pixels . We consider a setting inspired by real-world scenarios ; we consider a partially observable environment in which agents ’ observations consist of a visual scene with compositional structure . The perception optimization of OPC is typically achieved by inference in a spatial mixture model through generalized expectation maximization ( Dempster et al. , 1977 ) , while the policy optimization is derived from conventional temporal-difference ( TD ) learning ( Sutton , 1988 ) . Proof of convergence for the perception model update is provided in Appendix A . We test OPC on the Pixel Waterworld environment . Our results show that OPC achieves good quality and consistent perceptual grouping and outperforms several strong baselines in terms of accumulated rewards . 2 RELATED WORK . Connecting Perception and Control Formulating RL as Bayesian inference over inputs and actions has been explored by recent works ( Todorov , 2008 ; Kappen et al. , 2009 ; Rawlik et al. , 2010 ; Ortega and Braun , 2011 ; Levine , 2018 ; Tschiatschek et al. , 2018 ; Lee et al. , 2019b ; a ; Ortega et al. , 2019 ; Xin et al. , 2020 ; O ’ Donoghue et al. , 2020 ) . The generalized free energy principle ( Parr and Friston , 2019 ) studies a unified objective by heuristically defining entropy terms . A unified framework for perception and control from a general principle is proposed by Hafner et al . ( 2020 ) . Their framework provides a common foundation from which a wide range of objectives can be derived such as representation learning , information gain , empowerment , and skill discovery . However , one trade-off for the generality of their framework is the loss in precision . Environments in many real-world decision-making problems are only partially observable , which signifies the importance of MBRL methods to solving POMDPs . However , relevant and integrated discussion is omitted in Hafner et al . ( 2020 ) . In contrast , we focus on the joint perception and control as inference for POMDPs and provide a specialized joint-objective as well as a practical implementation . Model-based Deep Reinforcement Learning MBRL algorithms have been shown to be effective in various tasks ( Gu et al. , 2016 ) , including operating in environments with high-dimensional raw pixel observations ( Igl et al. , 2018 ; Shani et al. , 2005 ; Watter et al. , 2015 ; Levine et al. , 2016 ; Finn and Levine , 2017 ) . Existing methods have considered incorporating reward structure into modellearning ( Farahmand et al. , 2017 ; Oh et al. , 2017 ) , while our proposed PCI takes one step forward by incorporating the perception model into the control-as-inference derivation to yield a single unified objective for multiple components in a pipeline . One of the methods closely related to OPC is the World Model ( Ha and Schmidhuber , 2018 ) , which consists of offline and separately trained models for vision , memory , and control . These methods typically produce entangled latent representations for pixel observations whereas , for real world tasks such as reasoning and physical interaction , it is often necessary to identify and manipulate multiple entities and their relationships for optimal performance . Although Zambaldi et al . ( 2018 ) has used the relational mechanism to discover and reason about entities , their model needs additional supervision of location information . Object-based Reinforcement Learning The object-based approach , which recognizes decomposed objects from the environment observations , has attracted considerable attention in RL as well ( Schmidhuber , 1992 ) . However , most models often use pre-trained object-based representations rather than learning them from high-dimensional observations ( Diuk et al. , 2008 ; Kansky et al. , 2017 ) . When objects are extracted through learning methods , these models usually require supervised modeling of the object property , by either comparing the activation spectrum generated from neural network filters with existing types ( Garnelo et al. , 2016 ) or leveraging the bounding boxes generated by standard object detection algorithms ( Keramati et al. , 2018 ) . MOREL ( Goel et al. , 2018 ) applies optical flow in video sequences to learn the position and velocity information as input for model-free RL frameworks . A distinguishing feature of our work in relation to previous works in MBRL and the object-based RL is that we provide the decision-making process with object-based abstractions of high-dimensional observations in an unsupervised manner , which contribute to faster learning . Unsupervised Object Segmentation Unsupervised object segmentation and representation learning have seen several recent breakthroughs , such as IODINE ( Greff et al. , 2019 ) , MONet ( Burgess et al. , 2019 ) , and GENESIS ( Engelcke et al. , 2020 ) . Several recent works have investigated the unsupervised object extraction for reinforcement learning as well ( Zhu et al. , 2018 ; Asai and Fukunaga , 2017 ; Kulkarni et al. , 2019 ; Watters et al. , 2019 ; Veerapaneni et al. , 2020 ) . Although OPC is built upon a previous unsupervised object segmentation back-end ( Greff et al. , 2017 ; van Steenkiste et al. , 2018 ) , we explore one step forward by proposing a joint framework for perceptual grouping and decision-making . This could help an agent to discover structured objects from raw pixels so that it could better tackle its decision problems . Our framework also adheres to the Bayesian brain hypothesis by maintaining and updating a compact perception model towards the cause of particular observations ( Friston , 2010 ) . 3 METHODS . We start by introducing the environment as a partially observable Markov Decision Process ( POMDP ) with an object-based observation distribution in Sect . 3.11 . We then introduce PCI , a general framework for joint perception and control as inference in Sect . 3.2 and arrive at a joint objective for perception and control models . In the remainder of this section we propose OPC , a practical method to optimize the joint objective in the context of an object-based environment , which requires the model to exploit the compositional structure of a visual scene . 3.1 ENVIRONMENT SETTING . We define the environment as a POMDP represented by the tuple = hS , P , A , X , U , Ri , where S , A , X are the state space , the action space , and the observation space , respectively . At time step t , we consider an agent ’ s observation xt 2 X ⌘ RD as a visual image ( a matrix of pixels ) composited of K objects , where each pixel xi is determined by exactly one object . The agent receives xt following the conditional observation distribution U ( xt|st ) : S ! X , where the hidden state st is defined by the tuple ( zt , ✓t1 , . . . , ✓tK ) . Concretely , we denote as z t 2 Z ⌘ [ 0 , 1 ] D⇥K the latent variable which encodes the unknown true pixel assignments , such that zti , k = 1 iff pixel z t i was generated by component k. Each pixel xti is then rendered by its corresponding object representations ✓tk 2 RM through a pixel-wise distribution U ti , k ( x t i|zti , k = 1 ) 2 , where ti , k = f ( ✓tk ) i is generated by feeding ✓tk into a differentiable non-linear function f . When the environment receives an action a t 2 A , it moves to a new state st+1 following the transition function P ( st+1|st , at ) : S⇥A ! S . We assume the transition function could be parameterized and we integrate its parameter into . To embed the control problem into the graphical model , we also introduce an additional binary random variable ot to represent the optimality at time step t , i.e. , ot = 1 denotes that time step t is optimal , and ot = 0 denotes that it is not optimal . We choose the distribution over ot to be p ( ot = 1|st , at ) / exp ( rt ) , 1Note that the PCI framework is designed for general POMDPs . We extend Sect . 3.1 to object-based POMDPs for the purpose of introducing the environment setting for OPC . 2We consider U as Gaussian , i.e. , U ti , k ( x t i|zti , k = 1 ) ⇠ N ( xti ; µ = ti , k , 2 ) for some fixed 2. where rt 2 R is the observed reward provided by the environment according to the reward function R ( rt|st , at ) : S ⇥A ! R. We denote the distribution over initial state as p ( s1 ) : S ! [ 0 , 1 ] .
This paper proposes an extension of the RL as Inference framework, and demonstrates how to use it to express an object-centric RL model and train it on simple environments. It appears to be a combination of NEM [1] with a simple TD-learning objective on top. Results are a bit hard to interpret but seem promising.
SP:73cca0ea28b63d6d962c9a831627423947503ae7
Joint Perception and Control as Inference with an Object-based Implementation
1 INTRODUCTION . Human-like computing , which aims at endowing machines with human-like perceptual , reasoning and learning abilities , has recently drawn considerable attention ( Lake , 2014 ; Lake et al. , 2015 ; Baker et al. , 2017 ) . In order to operate within a dynamic environment while preserving homeostasis ( Kauffman , 1993 ) , humans maintain an internal model to learn new concepts efficiently from a few examples ( Friston , 2005 ) . The idea has since inspired many model-based reinforcement learning ( MBRL ) approaches to learn a concise perception model of the world ( Kaelbling et al. , 1998 ) . MBRL agents then use the perceptual model to choose effective actions . However , most existing MBRL methods separate perception modeling and decision making , leaving the potential connection between the objectives of these processes unexplored . A notable work by Hafner et al . ( 2020 ) provides a unified framework for perception and control . Built upon a general principle this framework covers a wide range of objectives in the fields of representation learning and reinforcement learning . However , they omit the discussion on combining perception and control for partially observable Markov decision processes ( POMDPs ) , which formalizes many real-world decision-making problems . In this paper , therefore , we focus on the joint perception and control as inference for POMDPs and provide a specialized joint objective as well as a practical implementation . Many prior MBRL methods fail to facilitate common-sense physical reasoning ( Battaglia et al. , 2013 ) , which is typically achieved by utilizing object-level inductive biases , e.g. , the prior over observed objects ’ properties , such as the type , amount , and locations . In contrast , humans can obtain these inductive biases through interacting with the environment and receiving feedback throughout their lifetimes ( Spelke et al. , 1992 ) , leading to a unified hierarchical and behavioral-correlated perception model to perceive events and objects from the environment ( Lee and Mumford , 2003 ) . Before taking actions , a human agent can use this model to decompose a complex visual scene into distinct parts , understand relations between them , reason about their dynamics and predict the consequences of its actions ( Battaglia et al. , 2013 ) . Therefore , equipping MBRL with object-level inductive biases is essential to create agents capable of emulating human perceptual learning and reasoning and thus complex decision making ( Lake et al. , 2015 ) . We propose to train an agent in a similar way to gain inductive biases by learning the structured properties of the environment . This can enable the agent to plan like a human using its ability to think ahead , see what would happen for a range of possible choices , and make rapid decisions while learning a policy with the help of the inductive bias ( Lake et al. , 2017 ) . Moreover , in order to mimic a human ’ s spontaneous acquisition of inductive biases o1 s1 a1 o2 a2 ……θ1 s2 θ 2 x1 x2 q ( s ) p ( s |x , o ) p ( x , o |s ) p ( s ) throughout its life , we propose to build a model able to acquire new knowledge online , rather than a one which merely generates static information from offline training ( Dehaene et al. , 2017 ) . In this paper , we introduce joint Perception and Control as Inference ( PCI ) as shown in Fig . ( 1 ) , a unified framework for decision making and perception modeling to facilitate understanding of the environment while providing a joint objective for both the perception and the action choice . As we argue that inductive bias gained in object-based perception is beneficial for control tasks , we then propose Object-based Perception Control ( OPC ) , an instantiation of PCI which facilitates control with the help of automatically discovered representations of objects from raw pixels . We consider a setting inspired by real-world scenarios ; we consider a partially observable environment in which agents ’ observations consist of a visual scene with compositional structure . The perception optimization of OPC is typically achieved by inference in a spatial mixture model through generalized expectation maximization ( Dempster et al. , 1977 ) , while the policy optimization is derived from conventional temporal-difference ( TD ) learning ( Sutton , 1988 ) . Proof of convergence for the perception model update is provided in Appendix A . We test OPC on the Pixel Waterworld environment . Our results show that OPC achieves good quality and consistent perceptual grouping and outperforms several strong baselines in terms of accumulated rewards . 2 RELATED WORK . Connecting Perception and Control Formulating RL as Bayesian inference over inputs and actions has been explored by recent works ( Todorov , 2008 ; Kappen et al. , 2009 ; Rawlik et al. , 2010 ; Ortega and Braun , 2011 ; Levine , 2018 ; Tschiatschek et al. , 2018 ; Lee et al. , 2019b ; a ; Ortega et al. , 2019 ; Xin et al. , 2020 ; O ’ Donoghue et al. , 2020 ) . The generalized free energy principle ( Parr and Friston , 2019 ) studies a unified objective by heuristically defining entropy terms . A unified framework for perception and control from a general principle is proposed by Hafner et al . ( 2020 ) . Their framework provides a common foundation from which a wide range of objectives can be derived such as representation learning , information gain , empowerment , and skill discovery . However , one trade-off for the generality of their framework is the loss in precision . Environments in many real-world decision-making problems are only partially observable , which signifies the importance of MBRL methods to solving POMDPs . However , relevant and integrated discussion is omitted in Hafner et al . ( 2020 ) . In contrast , we focus on the joint perception and control as inference for POMDPs and provide a specialized joint-objective as well as a practical implementation . Model-based Deep Reinforcement Learning MBRL algorithms have been shown to be effective in various tasks ( Gu et al. , 2016 ) , including operating in environments with high-dimensional raw pixel observations ( Igl et al. , 2018 ; Shani et al. , 2005 ; Watter et al. , 2015 ; Levine et al. , 2016 ; Finn and Levine , 2017 ) . Existing methods have considered incorporating reward structure into modellearning ( Farahmand et al. , 2017 ; Oh et al. , 2017 ) , while our proposed PCI takes one step forward by incorporating the perception model into the control-as-inference derivation to yield a single unified objective for multiple components in a pipeline . One of the methods closely related to OPC is the World Model ( Ha and Schmidhuber , 2018 ) , which consists of offline and separately trained models for vision , memory , and control . These methods typically produce entangled latent representations for pixel observations whereas , for real world tasks such as reasoning and physical interaction , it is often necessary to identify and manipulate multiple entities and their relationships for optimal performance . Although Zambaldi et al . ( 2018 ) has used the relational mechanism to discover and reason about entities , their model needs additional supervision of location information . Object-based Reinforcement Learning The object-based approach , which recognizes decomposed objects from the environment observations , has attracted considerable attention in RL as well ( Schmidhuber , 1992 ) . However , most models often use pre-trained object-based representations rather than learning them from high-dimensional observations ( Diuk et al. , 2008 ; Kansky et al. , 2017 ) . When objects are extracted through learning methods , these models usually require supervised modeling of the object property , by either comparing the activation spectrum generated from neural network filters with existing types ( Garnelo et al. , 2016 ) or leveraging the bounding boxes generated by standard object detection algorithms ( Keramati et al. , 2018 ) . MOREL ( Goel et al. , 2018 ) applies optical flow in video sequences to learn the position and velocity information as input for model-free RL frameworks . A distinguishing feature of our work in relation to previous works in MBRL and the object-based RL is that we provide the decision-making process with object-based abstractions of high-dimensional observations in an unsupervised manner , which contribute to faster learning . Unsupervised Object Segmentation Unsupervised object segmentation and representation learning have seen several recent breakthroughs , such as IODINE ( Greff et al. , 2019 ) , MONet ( Burgess et al. , 2019 ) , and GENESIS ( Engelcke et al. , 2020 ) . Several recent works have investigated the unsupervised object extraction for reinforcement learning as well ( Zhu et al. , 2018 ; Asai and Fukunaga , 2017 ; Kulkarni et al. , 2019 ; Watters et al. , 2019 ; Veerapaneni et al. , 2020 ) . Although OPC is built upon a previous unsupervised object segmentation back-end ( Greff et al. , 2017 ; van Steenkiste et al. , 2018 ) , we explore one step forward by proposing a joint framework for perceptual grouping and decision-making . This could help an agent to discover structured objects from raw pixels so that it could better tackle its decision problems . Our framework also adheres to the Bayesian brain hypothesis by maintaining and updating a compact perception model towards the cause of particular observations ( Friston , 2010 ) . 3 METHODS . We start by introducing the environment as a partially observable Markov Decision Process ( POMDP ) with an object-based observation distribution in Sect . 3.11 . We then introduce PCI , a general framework for joint perception and control as inference in Sect . 3.2 and arrive at a joint objective for perception and control models . In the remainder of this section we propose OPC , a practical method to optimize the joint objective in the context of an object-based environment , which requires the model to exploit the compositional structure of a visual scene . 3.1 ENVIRONMENT SETTING . We define the environment as a POMDP represented by the tuple = hS , P , A , X , U , Ri , where S , A , X are the state space , the action space , and the observation space , respectively . At time step t , we consider an agent ’ s observation xt 2 X ⌘ RD as a visual image ( a matrix of pixels ) composited of K objects , where each pixel xi is determined by exactly one object . The agent receives xt following the conditional observation distribution U ( xt|st ) : S ! X , where the hidden state st is defined by the tuple ( zt , ✓t1 , . . . , ✓tK ) . Concretely , we denote as z t 2 Z ⌘ [ 0 , 1 ] D⇥K the latent variable which encodes the unknown true pixel assignments , such that zti , k = 1 iff pixel z t i was generated by component k. Each pixel xti is then rendered by its corresponding object representations ✓tk 2 RM through a pixel-wise distribution U ti , k ( x t i|zti , k = 1 ) 2 , where ti , k = f ( ✓tk ) i is generated by feeding ✓tk into a differentiable non-linear function f . When the environment receives an action a t 2 A , it moves to a new state st+1 following the transition function P ( st+1|st , at ) : S⇥A ! S . We assume the transition function could be parameterized and we integrate its parameter into . To embed the control problem into the graphical model , we also introduce an additional binary random variable ot to represent the optimality at time step t , i.e. , ot = 1 denotes that time step t is optimal , and ot = 0 denotes that it is not optimal . We choose the distribution over ot to be p ( ot = 1|st , at ) / exp ( rt ) , 1Note that the PCI framework is designed for general POMDPs . We extend Sect . 3.1 to object-based POMDPs for the purpose of introducing the environment setting for OPC . 2We consider U as Gaussian , i.e. , U ti , k ( x t i|zti , k = 1 ) ⇠ N ( xti ; µ = ti , k , 2 ) for some fixed 2. where rt 2 R is the observed reward provided by the environment according to the reward function R ( rt|st , at ) : S ⇥A ! R. We denote the distribution over initial state as p ( s1 ) : S ! [ 0 , 1 ] .
The authors propose a framework for joint perception and control as inference (PCI) to combine perception and control for the case of POMDPs. The authors particularly focus on the case of hidden perceptual states linked to small image observations, which are composed of pixels belonging to up to exactly one object each. Their main proposal is denoted as OPC, which stands for object based perception and control, which serves the purpose of automatically discovering objects from pixels while controlling the system.
SP:73cca0ea28b63d6d962c9a831627423947503ae7
Differentiable Graph Optimization for Neural Architecture Search
1 INTRODUCTION . Neural Architecture Search ( NAS ) methods achieve great success and outperform hand-crafted models in many deep learning applications , such as image recognition , object detection and natural language processing ( Zoph et al. , 2017 ; Liu et al. , 2019 ; Ghiasi et al. , 2019 ; Chen et al. , 2020 ) . Due to the expensive cost of training-evaluating a neural architecture , the key challenge of NAS is to explore possible good candidates effectively . To cope with this challenge , various methods have been proposed , such as reinforcement learning ( RL ) , evolution algorithm ( EA ) , Bayesian optimization ( BO ) and weight-sharing strategy ( WS ) , to perform efficient search ( Zoph & Le , 2016 ; Real et al. , 2019 ; Hutter et al. , 2011 ; Liu et al. , 2019 ; Guo et al. , 2019 ) . While the weight-sharing strategy improves overall efficiency by reusing trained weights to reduce the total training cost , zeroth-order algorithms like RL , EA and BO employ black-box optimization , with the goal of finding optimal solutions with fewer samples . However , the search space of NAS is exponentially growing with the increasing number of choices . As a result , such huge combinatorial search spaces lead to insufficient exploitation of black-box learning framework ( Luo et al. , 2018 ) . Another line of research has been focused on formulating the NAS search space as graph structures , typically directed acyclic graphs ( DAGs ) , and then the search target is cast as choosing an optimal combination of the nodes and edges in the graph structure ( Pham et al. , 2018 ; Liu et al. , 2019 ; Xie et al. , 2019 ) . However , existing methods tend to perform the optimization in the indirect manner using black-box optimization . In contrast , we aim to explicitly model the search space as graphs and optimize graph structures directly . We thus propose Graph Optimized Neural Architecture Learning ( GOAL ) , a novel NAS approach combined with graph learning for efficient exploitation , as briefly shown in Fig.1 . Unlike other black-box approaches , we use a differentiable surrogate model to directly optimize the graph structures . The surrogate model takes a graph structure corresponds to a neural architecture as input , and predicts a relative ranking score as the searching signal . We then apply gradient descent on the input graph structure to optimize the corresponding architecture , which attempts to obtain a better predicted ranking score . As we optimize the surrogate model and the architectures iteratively , the optimal architectures could be typically obtained after a few iterations . In particular , to cope with the difficulty of using gradient-based optimization on the discrete graph structure , we adapt the proximal algorithm for allowing us to optimize discrete variables in a differentiable manner ( Parikh et al. , 2014 ; Bai et al. , 2019 ; Yao et al. , 2019 ) . We build the surrogate model with Edge Conditional Convolution ( ECC ) ( Simonovsky & Komodakis , 2017 ) , a variant of Graph Convolutional Network ( GCN ) ( Kipf & Welling , 2017 ) , to handle the graph representation of various search spaces . Our empirical results on existing NAS benchmarks with different search spaces demonstrate that , GOAL outperforms exist state-of-the-art black-box optimization baselines and neural surrogate model based methods by a large margin in terms of the search efficiency . The main contributions of this paper are summarized as follows : • We propose a differentiable surrogate model for ranking neural architectures based on GNN , which takes advantage of the graph structure of neural architectures and guides the architecture search efficiently . • We present GOAL , a novel gradient-based NAS sample-efficient approach with the assistance of the proposed surrogate model . Comparing to exist algorithms with GNN surrogates , GOAL makes full use of the learned representation by jointly optimizing the GNN model and candidate architectures and performing efficient exploitation within graphstructured search spaces . • Our empirical results demonstrate that the GOAL significantly outperforms existing stateof-the-art methods in various search spaces settings . 2 RELATED WORKS . 2.1 NEURAL ARCHITECTURE SEARCH . From the earliest explorations on automatic neural network designing to recent NAS trends , the NAS problem developed from hyper-parameter optimization , becoming a more challenging task due to the inherent complexity of its search space ( Bergstra et al. , 2013 ; Elsken et al. , 2018 ) . Existing popular approaches include various kinds of algorithms : reinforcement learning ( Zoph & Le , 2016 ; Zoph et al. , 2017 ; Pham et al. , 2018 ) , evolution algorithm ( Real et al. , 2019 ) , Bayesian optimization ( Falkner et al. , 2018 ; White et al. , 2019 ) , monte carlo tree search ( Wang et al. , 2019b ; a ) , gradient based methods ( Liu et al. , 2019 ; Luo et al. , 2018 ) , etc . There are also some works employ surrogate models to predict the performance of architectures before training to reduce the cost of architecture evaluation ( Liu et al. , 2018 ; Wen et al. , 2019 ; Wang et al. , 2019b ) . Some most recently parallel works even tries to improve black-box optimization methods like Bayesian optimization by efficient surrogate predictors ( White et al. , 2019 ; Shi et al. , 2019 ) . Existing gradient-based methods usually employ weight-sharing based relaxation or use encoder-decoder to optimize a continuous hidden space ( Liu et al. , 2019 ; Luo et al. , 2018 ) . These approximations cause biased model criterion and generation , which can harm the final performance ( Yu et al. , 2019 ; Yang et al. , 2020 ) . In contrast , our method directly optimizes the discrete architectures , avoids the biased model criterion . Due to the complex search settings and expensive evaluation cost , NAS works are hard to evaluate and reproduce fairly ( Li & Talwalkar , 2019 ; Yang et al. , 2020 ) . NAS-Bench-101 and NAS-Bench-201 are proposed to provide fair and easy benchmarks for NAS algorithms ( Dong & Yang , 2020 ; Ying et al. , 2019 ) . Taking advantage of the development of graph neural networks ( GNNs ) , several recent works show that the power of GNNs can also benefit the NAS task ( Shi et al. , 2019 ; Wen et al. , 2019 ) . However , these works only employ GNNs as a powerful black-box predictor . In contrast , we make full use of the learned representation of GNN by back-propagating through the GNN model and performing gradient-based optimization on the input graphs . 2.2 GRAPH STRUCTURE LEARNING . Graph neural network ( GNN ) is a kind of neural model for extracting features from graph-structured data ( Zhou et al. , 2018 ) . The most popular family of GNNs is the Graph Convolutional Network ( GCN ) , which propagates the features of nodes in the spectral or spatial domain ( Kipf & Welling , 2017 ; Morris et al. , 2019 ) . Since the vanilla GCN can only handle monomorphic graphs with single type of edge , many variants have been proposed to handle more complex graphs ( Schlichtkrull et al. , 2018 ; Simonovsky & Komodakis , 2017 ) . As the normal GNN pipeline requires an available fine-grained graph structure , recent works present approaches to optimize the graph structure and GNN model jointly ( Chen et al. , 2019 ; Franceschi et al. , 2019 ) . The graph structures could be either constructed from scratch or fine-tuned from a sub-optimal graph with the GNN model . We follow this manner , iteratively optimize the graph of neural architectures , guided by the GNN model . 3 PRELIMINARY : NEURAL ARCHITECTURE SEARCH SPACES . While our method can be potentially applied more generally , in this paper we focus on the most commonly used cell-based search spaces of convolutional neural networks ( CNNs ) ( Zoph et al. , 2017 ; Pham et al. , 2018 ; Liu et al. , 2019 ; Ying et al. , 2019 ; Dong & Yang , 2020 ) . A cell is a basic building block of architectures represented as a DAG , which consists of several basic neural operations and their connectivity relationship as shown in Fig.2 . Popular basic operations include different kinds of convolutions and poolings , such as 1 × 1 convolution , 3 × 3 convolution , 3 × 3 max pooling , etc . A complete CNN architecture is thus formed by stacking several repeats of the same cell . There are different kinds of representations to form an architecture by a DAG . Fig.2 shows two typical representations . It is non-trivial to convert from one to each other , since the corresponding architectures formed by different representations do not coincide . The cell-based search spaces are usually heuristically constrained by limiting the max number of nodes and edges , or the degree of each node , which corresponds to the number of operations and connections in a cell ( Liu et al. , 2019 ; Ying et al. , 2019 ) . This brings different feasible sets in our optimization in Sec.5.1 . 4 LEARNING TO RANK ARCHITECTURES BY GRAPH . We first design the GNN model which guides our optimization on neural architectures . Denoting a neural architecture setting as α , we train a differentiable model f ( α ) which predicts a score ỹ to indicate the real performance y , e.g . accuracy on the image classification task , of α . We build the model as GNN by Edge Conditional Convolution ( ECC ) layers ( Simonovsky & Komodakis , 2017 ) . While the GNN model itself is fully differentiable , it is possible to obtain gradient w.r.tα from f ( α ) to optimize the architecture . 4.1 GRAPH REPRESENTATION OF NEURAL ARCHITECTURES . As described in Sec.3 , mainstream NAS works search architectures in search spaces which could be represented as directed acyclic graphs ( DAGs ) . We form these search spaces as a unified perspective . Denoting G = ( V , E , T , A ) as the graph corresponding to an architecture α , where V is the set of nodes , E is the set of edges , T and A denote the types of nodes and edges respectively . For a predefined search space , we can form each architecture in the space by fixing V and E as a fullyconnected DAG , where each node i is connected to each node j for any i < j ≤ |V | , and assign proper T and A . As the connectivity between nodes can also be denoted as an edge type ( i.e . denoting as a disconnected type , as shown in the left of Fig.2 ) , we can determine both operation types and connectivity of the graph by T and A . The neural architecture setting α is therefore formed by α = ( T , A ) , consisting of the types of nodes and types of edges for graph structure . In particular , we form each component of T and A as a one-hot vector , which encodes a categorical selection . To build the surrogate model dealing with various nodes and edges types in the graph representation of neural architectures , we employ the ECC , a variant of GCN , to extract the features hi of each node i in the graph ( Simonovsky & Komodakis , 2017 ) . For each node i in the directed graph G , the l-th layer of a L-layers ECC propagates features h ` −1j of the previous layer from node j ∈ N ( i ) to node i , where N ( i ) denotes the predecessors set of node i . The ECC learns a kernel generator ke : A 7→ Rd ` ×d ` −1 , which maps the edge attribute space A to a real-valued d ` × d ` −1 filter for the graph convolution , where d ` indicates the number of channels in the ` -th convolution layer . Thus the graph convolution is formed by : h ` i = Θ ` h ` −1i + ∑ j∈N ( i ) k ` e ( aji ) h ` −1 j ( 1 ) where aji is the attribute , i.e . categorical selection as one-hot vector , of the edge from node j to node i , Θ is a learnable parameter . For high-level prediction upon the whole graph , we compute the feature vector hG of the whole graph G by taking the weighted sum of each node features of the last layer ( Li et al. , 2016 ) : hG = ∑ i exp ( whi ) ∑ j exp ( whj ) hi ( 2 ) where w is a learnable parameter to compute the weight for features of each node . Followed by fully-connected layers that take hG as input , we can get the final prediction ỹ as an indicator score of the input architecture .
The authors address the Neural Architecture Search problem. At the core of their contribution is an architectural improvement; performance prediction of a considered architecture is much better when using a particular graph neural network on (softened) architecture topology. The rest of the NAS pipeline is naturally built around this observation and the final performance looks quite strong.
SP:1dd38a42ac3a5b8a7b555b8fde614f036853bec3
Differentiable Graph Optimization for Neural Architecture Search
1 INTRODUCTION . Neural Architecture Search ( NAS ) methods achieve great success and outperform hand-crafted models in many deep learning applications , such as image recognition , object detection and natural language processing ( Zoph et al. , 2017 ; Liu et al. , 2019 ; Ghiasi et al. , 2019 ; Chen et al. , 2020 ) . Due to the expensive cost of training-evaluating a neural architecture , the key challenge of NAS is to explore possible good candidates effectively . To cope with this challenge , various methods have been proposed , such as reinforcement learning ( RL ) , evolution algorithm ( EA ) , Bayesian optimization ( BO ) and weight-sharing strategy ( WS ) , to perform efficient search ( Zoph & Le , 2016 ; Real et al. , 2019 ; Hutter et al. , 2011 ; Liu et al. , 2019 ; Guo et al. , 2019 ) . While the weight-sharing strategy improves overall efficiency by reusing trained weights to reduce the total training cost , zeroth-order algorithms like RL , EA and BO employ black-box optimization , with the goal of finding optimal solutions with fewer samples . However , the search space of NAS is exponentially growing with the increasing number of choices . As a result , such huge combinatorial search spaces lead to insufficient exploitation of black-box learning framework ( Luo et al. , 2018 ) . Another line of research has been focused on formulating the NAS search space as graph structures , typically directed acyclic graphs ( DAGs ) , and then the search target is cast as choosing an optimal combination of the nodes and edges in the graph structure ( Pham et al. , 2018 ; Liu et al. , 2019 ; Xie et al. , 2019 ) . However , existing methods tend to perform the optimization in the indirect manner using black-box optimization . In contrast , we aim to explicitly model the search space as graphs and optimize graph structures directly . We thus propose Graph Optimized Neural Architecture Learning ( GOAL ) , a novel NAS approach combined with graph learning for efficient exploitation , as briefly shown in Fig.1 . Unlike other black-box approaches , we use a differentiable surrogate model to directly optimize the graph structures . The surrogate model takes a graph structure corresponds to a neural architecture as input , and predicts a relative ranking score as the searching signal . We then apply gradient descent on the input graph structure to optimize the corresponding architecture , which attempts to obtain a better predicted ranking score . As we optimize the surrogate model and the architectures iteratively , the optimal architectures could be typically obtained after a few iterations . In particular , to cope with the difficulty of using gradient-based optimization on the discrete graph structure , we adapt the proximal algorithm for allowing us to optimize discrete variables in a differentiable manner ( Parikh et al. , 2014 ; Bai et al. , 2019 ; Yao et al. , 2019 ) . We build the surrogate model with Edge Conditional Convolution ( ECC ) ( Simonovsky & Komodakis , 2017 ) , a variant of Graph Convolutional Network ( GCN ) ( Kipf & Welling , 2017 ) , to handle the graph representation of various search spaces . Our empirical results on existing NAS benchmarks with different search spaces demonstrate that , GOAL outperforms exist state-of-the-art black-box optimization baselines and neural surrogate model based methods by a large margin in terms of the search efficiency . The main contributions of this paper are summarized as follows : • We propose a differentiable surrogate model for ranking neural architectures based on GNN , which takes advantage of the graph structure of neural architectures and guides the architecture search efficiently . • We present GOAL , a novel gradient-based NAS sample-efficient approach with the assistance of the proposed surrogate model . Comparing to exist algorithms with GNN surrogates , GOAL makes full use of the learned representation by jointly optimizing the GNN model and candidate architectures and performing efficient exploitation within graphstructured search spaces . • Our empirical results demonstrate that the GOAL significantly outperforms existing stateof-the-art methods in various search spaces settings . 2 RELATED WORKS . 2.1 NEURAL ARCHITECTURE SEARCH . From the earliest explorations on automatic neural network designing to recent NAS trends , the NAS problem developed from hyper-parameter optimization , becoming a more challenging task due to the inherent complexity of its search space ( Bergstra et al. , 2013 ; Elsken et al. , 2018 ) . Existing popular approaches include various kinds of algorithms : reinforcement learning ( Zoph & Le , 2016 ; Zoph et al. , 2017 ; Pham et al. , 2018 ) , evolution algorithm ( Real et al. , 2019 ) , Bayesian optimization ( Falkner et al. , 2018 ; White et al. , 2019 ) , monte carlo tree search ( Wang et al. , 2019b ; a ) , gradient based methods ( Liu et al. , 2019 ; Luo et al. , 2018 ) , etc . There are also some works employ surrogate models to predict the performance of architectures before training to reduce the cost of architecture evaluation ( Liu et al. , 2018 ; Wen et al. , 2019 ; Wang et al. , 2019b ) . Some most recently parallel works even tries to improve black-box optimization methods like Bayesian optimization by efficient surrogate predictors ( White et al. , 2019 ; Shi et al. , 2019 ) . Existing gradient-based methods usually employ weight-sharing based relaxation or use encoder-decoder to optimize a continuous hidden space ( Liu et al. , 2019 ; Luo et al. , 2018 ) . These approximations cause biased model criterion and generation , which can harm the final performance ( Yu et al. , 2019 ; Yang et al. , 2020 ) . In contrast , our method directly optimizes the discrete architectures , avoids the biased model criterion . Due to the complex search settings and expensive evaluation cost , NAS works are hard to evaluate and reproduce fairly ( Li & Talwalkar , 2019 ; Yang et al. , 2020 ) . NAS-Bench-101 and NAS-Bench-201 are proposed to provide fair and easy benchmarks for NAS algorithms ( Dong & Yang , 2020 ; Ying et al. , 2019 ) . Taking advantage of the development of graph neural networks ( GNNs ) , several recent works show that the power of GNNs can also benefit the NAS task ( Shi et al. , 2019 ; Wen et al. , 2019 ) . However , these works only employ GNNs as a powerful black-box predictor . In contrast , we make full use of the learned representation of GNN by back-propagating through the GNN model and performing gradient-based optimization on the input graphs . 2.2 GRAPH STRUCTURE LEARNING . Graph neural network ( GNN ) is a kind of neural model for extracting features from graph-structured data ( Zhou et al. , 2018 ) . The most popular family of GNNs is the Graph Convolutional Network ( GCN ) , which propagates the features of nodes in the spectral or spatial domain ( Kipf & Welling , 2017 ; Morris et al. , 2019 ) . Since the vanilla GCN can only handle monomorphic graphs with single type of edge , many variants have been proposed to handle more complex graphs ( Schlichtkrull et al. , 2018 ; Simonovsky & Komodakis , 2017 ) . As the normal GNN pipeline requires an available fine-grained graph structure , recent works present approaches to optimize the graph structure and GNN model jointly ( Chen et al. , 2019 ; Franceschi et al. , 2019 ) . The graph structures could be either constructed from scratch or fine-tuned from a sub-optimal graph with the GNN model . We follow this manner , iteratively optimize the graph of neural architectures , guided by the GNN model . 3 PRELIMINARY : NEURAL ARCHITECTURE SEARCH SPACES . While our method can be potentially applied more generally , in this paper we focus on the most commonly used cell-based search spaces of convolutional neural networks ( CNNs ) ( Zoph et al. , 2017 ; Pham et al. , 2018 ; Liu et al. , 2019 ; Ying et al. , 2019 ; Dong & Yang , 2020 ) . A cell is a basic building block of architectures represented as a DAG , which consists of several basic neural operations and their connectivity relationship as shown in Fig.2 . Popular basic operations include different kinds of convolutions and poolings , such as 1 × 1 convolution , 3 × 3 convolution , 3 × 3 max pooling , etc . A complete CNN architecture is thus formed by stacking several repeats of the same cell . There are different kinds of representations to form an architecture by a DAG . Fig.2 shows two typical representations . It is non-trivial to convert from one to each other , since the corresponding architectures formed by different representations do not coincide . The cell-based search spaces are usually heuristically constrained by limiting the max number of nodes and edges , or the degree of each node , which corresponds to the number of operations and connections in a cell ( Liu et al. , 2019 ; Ying et al. , 2019 ) . This brings different feasible sets in our optimization in Sec.5.1 . 4 LEARNING TO RANK ARCHITECTURES BY GRAPH . We first design the GNN model which guides our optimization on neural architectures . Denoting a neural architecture setting as α , we train a differentiable model f ( α ) which predicts a score ỹ to indicate the real performance y , e.g . accuracy on the image classification task , of α . We build the model as GNN by Edge Conditional Convolution ( ECC ) layers ( Simonovsky & Komodakis , 2017 ) . While the GNN model itself is fully differentiable , it is possible to obtain gradient w.r.tα from f ( α ) to optimize the architecture . 4.1 GRAPH REPRESENTATION OF NEURAL ARCHITECTURES . As described in Sec.3 , mainstream NAS works search architectures in search spaces which could be represented as directed acyclic graphs ( DAGs ) . We form these search spaces as a unified perspective . Denoting G = ( V , E , T , A ) as the graph corresponding to an architecture α , where V is the set of nodes , E is the set of edges , T and A denote the types of nodes and edges respectively . For a predefined search space , we can form each architecture in the space by fixing V and E as a fullyconnected DAG , where each node i is connected to each node j for any i < j ≤ |V | , and assign proper T and A . As the connectivity between nodes can also be denoted as an edge type ( i.e . denoting as a disconnected type , as shown in the left of Fig.2 ) , we can determine both operation types and connectivity of the graph by T and A . The neural architecture setting α is therefore formed by α = ( T , A ) , consisting of the types of nodes and types of edges for graph structure . In particular , we form each component of T and A as a one-hot vector , which encodes a categorical selection . To build the surrogate model dealing with various nodes and edges types in the graph representation of neural architectures , we employ the ECC , a variant of GCN , to extract the features hi of each node i in the graph ( Simonovsky & Komodakis , 2017 ) . For each node i in the directed graph G , the l-th layer of a L-layers ECC propagates features h ` −1j of the previous layer from node j ∈ N ( i ) to node i , where N ( i ) denotes the predecessors set of node i . The ECC learns a kernel generator ke : A 7→ Rd ` ×d ` −1 , which maps the edge attribute space A to a real-valued d ` × d ` −1 filter for the graph convolution , where d ` indicates the number of channels in the ` -th convolution layer . Thus the graph convolution is formed by : h ` i = Θ ` h ` −1i + ∑ j∈N ( i ) k ` e ( aji ) h ` −1 j ( 1 ) where aji is the attribute , i.e . categorical selection as one-hot vector , of the edge from node j to node i , Θ is a learnable parameter . For high-level prediction upon the whole graph , we compute the feature vector hG of the whole graph G by taking the weighted sum of each node features of the last layer ( Li et al. , 2016 ) : hG = ∑ i exp ( whi ) ∑ j exp ( whj ) hi ( 2 ) where w is a learnable parameter to compute the weight for features of each node . Followed by fully-connected layers that take hG as input , we can get the final prediction ỹ as an indicator score of the input architecture .
This work propose Graph Optimized Neural Architecture Learning, that uses a differentiable surrogate model to directly optimize the graph structures. More specifically, the surrogate model takes a graph structure as the neural architecture embedding and predicts a relative ranking, then applies gradient descent on the input graph structure to optimize the neural architecture. GOAL demonstrates superior performance compared to SoTAs.
SP:1dd38a42ac3a5b8a7b555b8fde614f036853bec3
On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines
1 INTRODUCTION . Pre-trained transformer-based masked language models such as BERT ( Devlin et al. , 2019 ) , RoBERTa ( Liu et al. , 2019 ) , and ALBERT ( Lan et al. , 2020 ) have had a dramatic impact on the NLP landscape in the recent year . The standard recipe for using such models typically involves training a pretrained model for a few epochs on a supervised downstream dataset , which is known as fine-tuning . While fine-tuning has led to impressive empirical results , dominating a large variety of English NLP benchmarks such as GLUE ( Wang et al. , 2019b ) and SuperGLUE ( Wang et al. , 2019a ) , it is still poorly understood . Not only have fine-tuned models been shown to pick up spurious patterns and biases present in the training data ( Niven and Kao , 2019 ; McCoy et al. , 2019 ) , but also to exhibit a large training instability : fine-tuning a model multiple times on the same dataset , varying only the random seed , leads to a large standard deviation of the fine-tuning accuracy ( Devlin et al. , 2019 ; Dodge et al. , 2020 ) . Few methods have been proposed to solve the observed instability ( Phang et al. , 2018 ; Lee et al. , 2020 ) , however without providing a sufficient understanding of why fine-tuning is prone to such failure . The goal of this work is to address this shortcoming . More specifically , we investigate the following question : Why is fine-tuning prone to failures and how can we improve its stability ? We start by investigating two common hypotheses for fine-tuning instability : catastrophic forgetting and small size of the fine-tuning datasets and demonstrate that both hypotheses fail to explain fine-tuning instability . We then investigate fine-tuning failures on datasets from the popular GLUE benchmark and show that the observed fine-tuning instability can be decomposed into two separate aspects : ( 1 ) optimization difficulties early in training , characterized by vanishing gradients , and ( 2 ) differences in generalization late in training , characterized by a large variance of development set accuracy for runs with almost equivalent training loss . Based on our analysis , we present a simple but strong baseline for fine-tuning pre-trained language models that significantly improves the fine-tuning stability compared to previous works ( Fig . 1 ) . Moreover , we show that our findings apply not only to the widely used BERT model but also to more recent pre-trained models such as RoBERTa and ALBERT . 2 RELATED WORK . The fine-tuning instability of BERT has been pointed out in various studies . Devlin et al . ( 2019 ) report instabilities when fine-tuning BERTLARGE on small datasets and resort to performing multiple restarts of fine-tuning and selecting the model that performs best on the development set . Recently , Dodge et al . ( 2020 ) performed a large-scale empirical investigation of the fine-tuning instability of BERT . They found dramatic variations in fine-tuning accuracy across multiple restarts and argue how it might be related to the choice of random seed and the dataset size . Few approaches have been proposed to directly address the observed fine-tuning instability . Phang et al . ( 2018 ) study intermediate task training ( STILTS ) before fine-tuning with the goal of improving performance on the GLUE benchmark . They also find that their proposed method leads to improved fine-tuning stability . However , due to the intermediate task training , their work is not directly comparable to ours . Lee et al . ( 2020 ) propose a new regularization technique termed Mixout . The authors show that Mixout improves stability during fine-tuning which they attribute to the prevention of catastrophic forgetting . Another line of work investigates optimization difficulties of pre-training transformer-based language models ( Xiong et al. , 2020 ; Liu et al. , 2020 ) . Similar to our work , they highlight the importance of the learning rate warmup for optimization . Both works focus on pre-training and we hence view them as orthogonal to our work . 3 BACKGROUND . 3.1 DATASETS . We study four datasets from the GLUE benchmark ( Wang et al. , 2019b ) following previous work studying instability during fine-tuning : CoLA , MRPC , RTE , and QNLI . Detailed statistics for each of the datasets can be found in Section 7.2 in the Appendix . CoLA . The Corpus of Linguistic Acceptability ( Warstadt et al. , 2018 ) is a sentence-level classification task containing sentences labeled as either grammatical or ungrammatical . Fine-tuning on CoLA was observed to be particularly stable in previous work ( Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) . Performance on CoLA is reported in Matthew ’ s correlation coefficient ( MCC ) . MRPC . The Microsoft Research Paraphrase Corpus ( Dolan and Brockett , 2005 ) is a sentence-pair classification task . Given two sentences , a model has to judge whether the sentences paraphrases of each other . Performance on MRPC is measured using the F1 score . RTE . The Recognizing Textual Entailment dataset is a collection of sentence-pairs collected from a series of textual entailment challenges ( Dagan et al. , 2005 ; Bar-Haim et al. , 2006 ; Giampiccolo et al. , 2007 ; Bentivogli et al. , 2009 ) . RTE is the second smallest dataset in the GLUE benchmark and fine-tuning on RTE was observed to be particularly unstable ( Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) . Accuracy is used to measure performance on RTE . QNLI . The Question-answering Natural Language Inference dataset contains sentence pairs obtained from SQuAD ( Rajpurkar et al. , 2016 ) . Wang et al . ( 2019b ) converted SQuAD into a sentence pair classification task by forming a pair between each question and each sentence in the corresponding paragraph . The task is to determine whether the context sentence contains the answer to the question , i.e . entails the answer . Accuracy is used to measure performance on QNLI . 3.2 FINE-TUNING . Unless mentioned otherwise , we follow the default fine-tuning strategy recommended by Devlin et al . ( 2019 ) : we fine-tune uncased BERTLARGE ( henceforth BERT ) using a batch size of 16 and a learning rate of 2e−5 . The learning rate is linearly increased from 0 to 2e−5 for the first 10 % of iterations—which is known as a warmup—and linearly decreased to 0 afterward . We apply dropout with probability p = 0.1 and weight decay with λ = 0.01 . We train for 3 epochs on all datasets and use global gradient clipping . Following Devlin et al . ( 2019 ) , we use the AdamW optimizer ( Loshchilov and Hutter , 2019 ) without bias correction . We decided to not show results for BERTBASE since previous works observed no instability when fine-tuning BERTBASE which we also confirmed in our experiments . Instead , we show additional results on RoBERTaLARGE ( Liu et al. , 2019 ) and ALBERTLARGE-V2 ( Lan et al. , 2020 ) using the same fine-tuning strategy . We note that compared to BERT , both RoBERTa and ALBERT have slightly different hyperparameters . In particular , RoBERTa uses weight decay with λ = 0.1 and no gradient clipping , and ALBERT does not use dropout . A detailed list of all default hyperparameters for all models can be found in Section 7.3 of the Appendix . Our implementation is based on HuggingFace ’ s transformers library ( Wolf et al. , 2019 ) and is available online : https : //github . com/uds-lsv/bert-stable-fine-tuning . Fine-tuning stability . By fine-tuning stability we mean the standard deviation of the fine-tuning performance ( measured , e.g. , in terms of accuracy , MCC or F1 score ) over the randomness of an algorithm . We follow previous works ( Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) and measure fine-tuning stability using the development sets from the GLUE benchmark . We discuss alternative notions of stability in Section 7.1 in the Appendix . Failed runs . Following Dodge et al . ( 2020 ) , we refer to a fine-tuning run as a failed run if its accuracy at the end of training is less or equal to that of a majority classifier on the respective dataset . The majority baselines for all tasks are found in Section 7.2 in the Appendix . 4 INVESTIGATING PREVIOUS HYPOTHESES FOR FINE-TUNING INSTABILITY . Previous works on fine-tuning predominantly state two hypotheses for what can be related to finetuning instability : catastrophic forgetting and small training data size of the downstream tasks . Despite the ubiquity of these hypotheses ( Devlin et al. , 2019 ; Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) , we argue that none of them has a causal relationship with fine-tuning instability . 4.1 DOES CATASTROPHIC FORGETTING CAUSE FINE-TUNING INSTABILITY ? . Catastrophic forgetting ( McCloskey and Cohen , 1989 ; Kirkpatrick et al. , 2017 ) refers to the phenomenon when a neural network is sequentially trained to perform two different tasks , and it loses its ability to perform the first task after being trained on the second . More specifically , in our setup , it means that after fine-tuning a pre-trained model , it can no longer perform the original masked language modeling task used for pre-training . This can be measured in terms of the perplexity on the original training data . Although the language modeling performance of a pre-trained model correlates with its fine-tuning accuracy ( Liu et al. , 2019 ; Lan et al. , 2020 ) , there is no clear motivation for why preserving the original masked language modeling performance after fine-tuning is important.1 In the context of fine-tuning BERT , Lee et al . ( 2020 ) suggest that their regularization method has an effect of alleviating catastrophic forgetting . Thus , it is important to understand how exactly catastrophic forgetting occurs during fine-tuning and how it relates to the observed fine-tuning instability . To better understand this , we perform the following experiment : we fine-tune BERT on RTE , following the default strategy by Devlin et al . ( 2019 ) . We select three successful and three failed fine-tuning runs and evaluate their masked language modeling perplexity on the test set of the WikiText-2 language modeling benchmark ( Merity et al. , 2016 ) .2 We sequentially substitute the top-k layers of the network varying k from 0 ( i.e . all layers are from the fine-tuned model ) to 24 ( i.e . all layers are from the pre-trained model ) . We show the results in Fig . 2 ( a ) and ( b ) . We can observe that although catastrophic forgetting occurs for the failed models ( Fig . 2a ) — perplexity on WikiText-2 is indeed degraded for k = 0 — the phenomenon is much more nuanced . Namely , catastrophic forgetting affects only the top layers of the network — in our experiments often around 1An exception could by the case where supervised fine-tuning is performed as an intermediate training step , e.g . with the goal of domain adaptation . We leave an investigation of this setting for future work . 2BERT was trained on English Wikipedia , hence WikiText-2 can be seen as a subset of its training data . 10 out of 24 layers , and the same is however also true for the successfully fine-tuned models , except for a much smaller increase in perplexity . Another important aspect of our experiment is that catastrophic forgetting typically requires that the model at least successfully learns how to perform the new task . However , this is not the case for the failed fine-tuning runs . Not only is the development accuracy equal to that of the majority classifier , but also the training loss on the fine-tuning task ( here RTE ) is trivial , i.e . close to − ln ( 1/2 ) ( see Fig . 2 ( c ) ) . This suggests that the observed fine-tuning failure is rather an optimization problem causing catastrophic forgetting in the top layers of the pre-trained model . We will show later that the optimization aspect is actually sufficient to explain most of the fine-tuning variance .
This paper considers the stability of fine-tuning BERT-LARGE models, with considerations for RoBERTa and ALBERT. In particular, it aims to demonstrate that previously identified reasons, catastrophic forgetting and small fine-tuning datasets, fail to explain the observed instability. Instead, it posits that the instability is caused by optimization difficulties that lead to vanishing gradients.
SP:06f1aeb9546000b8a91dd6fbdf94d3113466f9fe
On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines
1 INTRODUCTION . Pre-trained transformer-based masked language models such as BERT ( Devlin et al. , 2019 ) , RoBERTa ( Liu et al. , 2019 ) , and ALBERT ( Lan et al. , 2020 ) have had a dramatic impact on the NLP landscape in the recent year . The standard recipe for using such models typically involves training a pretrained model for a few epochs on a supervised downstream dataset , which is known as fine-tuning . While fine-tuning has led to impressive empirical results , dominating a large variety of English NLP benchmarks such as GLUE ( Wang et al. , 2019b ) and SuperGLUE ( Wang et al. , 2019a ) , it is still poorly understood . Not only have fine-tuned models been shown to pick up spurious patterns and biases present in the training data ( Niven and Kao , 2019 ; McCoy et al. , 2019 ) , but also to exhibit a large training instability : fine-tuning a model multiple times on the same dataset , varying only the random seed , leads to a large standard deviation of the fine-tuning accuracy ( Devlin et al. , 2019 ; Dodge et al. , 2020 ) . Few methods have been proposed to solve the observed instability ( Phang et al. , 2018 ; Lee et al. , 2020 ) , however without providing a sufficient understanding of why fine-tuning is prone to such failure . The goal of this work is to address this shortcoming . More specifically , we investigate the following question : Why is fine-tuning prone to failures and how can we improve its stability ? We start by investigating two common hypotheses for fine-tuning instability : catastrophic forgetting and small size of the fine-tuning datasets and demonstrate that both hypotheses fail to explain fine-tuning instability . We then investigate fine-tuning failures on datasets from the popular GLUE benchmark and show that the observed fine-tuning instability can be decomposed into two separate aspects : ( 1 ) optimization difficulties early in training , characterized by vanishing gradients , and ( 2 ) differences in generalization late in training , characterized by a large variance of development set accuracy for runs with almost equivalent training loss . Based on our analysis , we present a simple but strong baseline for fine-tuning pre-trained language models that significantly improves the fine-tuning stability compared to previous works ( Fig . 1 ) . Moreover , we show that our findings apply not only to the widely used BERT model but also to more recent pre-trained models such as RoBERTa and ALBERT . 2 RELATED WORK . The fine-tuning instability of BERT has been pointed out in various studies . Devlin et al . ( 2019 ) report instabilities when fine-tuning BERTLARGE on small datasets and resort to performing multiple restarts of fine-tuning and selecting the model that performs best on the development set . Recently , Dodge et al . ( 2020 ) performed a large-scale empirical investigation of the fine-tuning instability of BERT . They found dramatic variations in fine-tuning accuracy across multiple restarts and argue how it might be related to the choice of random seed and the dataset size . Few approaches have been proposed to directly address the observed fine-tuning instability . Phang et al . ( 2018 ) study intermediate task training ( STILTS ) before fine-tuning with the goal of improving performance on the GLUE benchmark . They also find that their proposed method leads to improved fine-tuning stability . However , due to the intermediate task training , their work is not directly comparable to ours . Lee et al . ( 2020 ) propose a new regularization technique termed Mixout . The authors show that Mixout improves stability during fine-tuning which they attribute to the prevention of catastrophic forgetting . Another line of work investigates optimization difficulties of pre-training transformer-based language models ( Xiong et al. , 2020 ; Liu et al. , 2020 ) . Similar to our work , they highlight the importance of the learning rate warmup for optimization . Both works focus on pre-training and we hence view them as orthogonal to our work . 3 BACKGROUND . 3.1 DATASETS . We study four datasets from the GLUE benchmark ( Wang et al. , 2019b ) following previous work studying instability during fine-tuning : CoLA , MRPC , RTE , and QNLI . Detailed statistics for each of the datasets can be found in Section 7.2 in the Appendix . CoLA . The Corpus of Linguistic Acceptability ( Warstadt et al. , 2018 ) is a sentence-level classification task containing sentences labeled as either grammatical or ungrammatical . Fine-tuning on CoLA was observed to be particularly stable in previous work ( Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) . Performance on CoLA is reported in Matthew ’ s correlation coefficient ( MCC ) . MRPC . The Microsoft Research Paraphrase Corpus ( Dolan and Brockett , 2005 ) is a sentence-pair classification task . Given two sentences , a model has to judge whether the sentences paraphrases of each other . Performance on MRPC is measured using the F1 score . RTE . The Recognizing Textual Entailment dataset is a collection of sentence-pairs collected from a series of textual entailment challenges ( Dagan et al. , 2005 ; Bar-Haim et al. , 2006 ; Giampiccolo et al. , 2007 ; Bentivogli et al. , 2009 ) . RTE is the second smallest dataset in the GLUE benchmark and fine-tuning on RTE was observed to be particularly unstable ( Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) . Accuracy is used to measure performance on RTE . QNLI . The Question-answering Natural Language Inference dataset contains sentence pairs obtained from SQuAD ( Rajpurkar et al. , 2016 ) . Wang et al . ( 2019b ) converted SQuAD into a sentence pair classification task by forming a pair between each question and each sentence in the corresponding paragraph . The task is to determine whether the context sentence contains the answer to the question , i.e . entails the answer . Accuracy is used to measure performance on QNLI . 3.2 FINE-TUNING . Unless mentioned otherwise , we follow the default fine-tuning strategy recommended by Devlin et al . ( 2019 ) : we fine-tune uncased BERTLARGE ( henceforth BERT ) using a batch size of 16 and a learning rate of 2e−5 . The learning rate is linearly increased from 0 to 2e−5 for the first 10 % of iterations—which is known as a warmup—and linearly decreased to 0 afterward . We apply dropout with probability p = 0.1 and weight decay with λ = 0.01 . We train for 3 epochs on all datasets and use global gradient clipping . Following Devlin et al . ( 2019 ) , we use the AdamW optimizer ( Loshchilov and Hutter , 2019 ) without bias correction . We decided to not show results for BERTBASE since previous works observed no instability when fine-tuning BERTBASE which we also confirmed in our experiments . Instead , we show additional results on RoBERTaLARGE ( Liu et al. , 2019 ) and ALBERTLARGE-V2 ( Lan et al. , 2020 ) using the same fine-tuning strategy . We note that compared to BERT , both RoBERTa and ALBERT have slightly different hyperparameters . In particular , RoBERTa uses weight decay with λ = 0.1 and no gradient clipping , and ALBERT does not use dropout . A detailed list of all default hyperparameters for all models can be found in Section 7.3 of the Appendix . Our implementation is based on HuggingFace ’ s transformers library ( Wolf et al. , 2019 ) and is available online : https : //github . com/uds-lsv/bert-stable-fine-tuning . Fine-tuning stability . By fine-tuning stability we mean the standard deviation of the fine-tuning performance ( measured , e.g. , in terms of accuracy , MCC or F1 score ) over the randomness of an algorithm . We follow previous works ( Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) and measure fine-tuning stability using the development sets from the GLUE benchmark . We discuss alternative notions of stability in Section 7.1 in the Appendix . Failed runs . Following Dodge et al . ( 2020 ) , we refer to a fine-tuning run as a failed run if its accuracy at the end of training is less or equal to that of a majority classifier on the respective dataset . The majority baselines for all tasks are found in Section 7.2 in the Appendix . 4 INVESTIGATING PREVIOUS HYPOTHESES FOR FINE-TUNING INSTABILITY . Previous works on fine-tuning predominantly state two hypotheses for what can be related to finetuning instability : catastrophic forgetting and small training data size of the downstream tasks . Despite the ubiquity of these hypotheses ( Devlin et al. , 2019 ; Phang et al. , 2018 ; Dodge et al. , 2020 ; Lee et al. , 2020 ) , we argue that none of them has a causal relationship with fine-tuning instability . 4.1 DOES CATASTROPHIC FORGETTING CAUSE FINE-TUNING INSTABILITY ? . Catastrophic forgetting ( McCloskey and Cohen , 1989 ; Kirkpatrick et al. , 2017 ) refers to the phenomenon when a neural network is sequentially trained to perform two different tasks , and it loses its ability to perform the first task after being trained on the second . More specifically , in our setup , it means that after fine-tuning a pre-trained model , it can no longer perform the original masked language modeling task used for pre-training . This can be measured in terms of the perplexity on the original training data . Although the language modeling performance of a pre-trained model correlates with its fine-tuning accuracy ( Liu et al. , 2019 ; Lan et al. , 2020 ) , there is no clear motivation for why preserving the original masked language modeling performance after fine-tuning is important.1 In the context of fine-tuning BERT , Lee et al . ( 2020 ) suggest that their regularization method has an effect of alleviating catastrophic forgetting . Thus , it is important to understand how exactly catastrophic forgetting occurs during fine-tuning and how it relates to the observed fine-tuning instability . To better understand this , we perform the following experiment : we fine-tune BERT on RTE , following the default strategy by Devlin et al . ( 2019 ) . We select three successful and three failed fine-tuning runs and evaluate their masked language modeling perplexity on the test set of the WikiText-2 language modeling benchmark ( Merity et al. , 2016 ) .2 We sequentially substitute the top-k layers of the network varying k from 0 ( i.e . all layers are from the fine-tuned model ) to 24 ( i.e . all layers are from the pre-trained model ) . We show the results in Fig . 2 ( a ) and ( b ) . We can observe that although catastrophic forgetting occurs for the failed models ( Fig . 2a ) — perplexity on WikiText-2 is indeed degraded for k = 0 — the phenomenon is much more nuanced . Namely , catastrophic forgetting affects only the top layers of the network — in our experiments often around 1An exception could by the case where supervised fine-tuning is performed as an intermediate training step , e.g . with the goal of domain adaptation . We leave an investigation of this setting for future work . 2BERT was trained on English Wikipedia , hence WikiText-2 can be seen as a subset of its training data . 10 out of 24 layers , and the same is however also true for the successfully fine-tuned models , except for a much smaller increase in perplexity . Another important aspect of our experiment is that catastrophic forgetting typically requires that the model at least successfully learns how to perform the new task . However , this is not the case for the failed fine-tuning runs . Not only is the development accuracy equal to that of the majority classifier , but also the training loss on the fine-tuning task ( here RTE ) is trivial , i.e . close to − ln ( 1/2 ) ( see Fig . 2 ( c ) ) . This suggests that the observed fine-tuning failure is rather an optimization problem causing catastrophic forgetting in the top layers of the pre-trained model . We will show later that the optimization aspect is actually sufficient to explain most of the fine-tuning variance .
The paper focuses on the instability phenomenon happening in the fine-tuning of BERT-like models in downstream tasks. The reasons of such instability were assumed to be catastrophic forgetting and the small size of datasets on which being fine-tuned in previous literature. The authors conduct experiments on several sub tasks of GLUE in an attempt to show the aforementioned two assumptions cannot explain the instability of fine-tuning. Instead they claim that the real reasons are gradient vanishing and the lack of generalization and subsequently propose a set of training hyperparameters to improve the stability.
SP:06f1aeb9546000b8a91dd6fbdf94d3113466f9fe
Multi-Representation Ensemble in Few-Shot Learning
Deep neural networks ( DNNs ) compute representations in a layer by layer fashion , producing a final representation at the top layer of the pipeline , and classification or regression is made using the final representation . A number of DNNs ( e.g. , ResNet , DenseNet ) have shown that representations from the earlier layers can be beneficial . They improved performance by aggregating representations from different layers . In this work , we asked the question , besides forming an aggregation , whether these representations can be utilized directly with the classification layer ( s ) to obtain better performance . We started our quest to the answer by investigating the classifiers based on the representations from different layers and observed that these classifiers were diverse and many of their decisions were complementary to each other , hence having the potential to generate a better overall decision when combined . Following this observation , we propose an ensemble method that creates an ensemble of classifiers , each taking a representation from a different depth of a base DNN as the input . We tested this ensemble method in the setting of few-shot learning . Experiments were conducted on the mini-ImageNet and tiered-ImageNet datasets which are commonly used in the evaluation of fewshot learning methods . Our ensemble achieves the new state-of-the-art results for both datasets , comparing to previous regular and ensemble approaches . 1 INTRODUCTION . The depth of a deep neural network is a main factor that contributes to the high capacity of the network . In deep neural networks , information is often processed in a layer by layer fashion through many layers , before it is fed to the final classification ( regression ) layer ( s ) . From a representation learning point of view , a representation is computed sequentially through the layers and a final representation is used to perform the targeted task . There have been deep neural networks that try to exploit the lower layers in the sequence to achieve better learning results . GoogLeNets ( Szegedy et al. , 2015 ) added auxiliary losses to the lower layers to facilitate training . Skip links ( such as the ones used in ResNet ( He et al. , 2016 ) and DenseNet ( Huang et al. , 2017 ) ) may be added to connect the lower layers to the higher ones in a deep architecture . Even though the main purposes of these approaches are to assist the training process or to help the gradient back-propagation , the success of these approaches suggests that the representations from the lower layers may be beneficial to many learning tasks . Therefore , it is worth to rethink the standard sequential structure where a final representation is used to make the prediction . In this work , we ask the question whether the representations from the lower layers can be used directly ( instead of being auxiliary or being aggregated into a final representation ) for decision making . If so , how can we take advantage of these lower-level representations and what are good practices in doing so ? We first investigated the problem by conducting classifications using the representations from different layers . We took the convolutional layers of a trained network as an encoder . The representations ( feature maps ) from different layers of the encoder were tested for their classification performance . We observed that although overall , the feature maps from the higher layers led to better performance , there was a significant number of cases that correct predictions could be made with the lower feature maps but the higher-level feature maps failed to do so . This suggested that the lower-level representations have the potential to help the classification directly ( detailed analysis in Section 3 ) . Based on the inspiration from the prior models ( i.e. , GoogLeNet , ResNet and DenseNet ) and our own observations , we propose an ensemble approach to directly take advantage of the lower-level representations . By integrating multiple models , an ensemble is likely to compensate the errors of a single classifier , and thus the overall performance of the ensemble would be better than that of a single classifier . This makes ensemble a suitable technique for our purpose . A variety of methods exist for ensemble construction . Some utilize sampling to obtain individual models from different subsets of the training data . Others construct models with different structures or initialization . However , these common ensemble methods can not achieve our goal to exploit the lower-level representations . Instead , we propose a special type of ensembles , different from the existing ones . In particular , each classifier in our ensemble takes a feature map from a different depth of a CNN encoder as input and the whole ensemble utilizes the feature maps from multiple convolutional layers . We call this approach the multi-representation ensemble . Figure 1 illustrates our ensemble approach and compares it to the common ensemble method . We evaluate our ensemble method on the few-shot learning ( FSL ) problem ( Snell et al. , 2017 ) . FSL aims to learn a network capable of recognizing instances ( query images ) from novel classes with only few labeled examples ( support images ) available in each class . Given the demanding nature ( learning from a few examples ) of the problem , many FSL approaches first train an encoder following a regular training paradigm and then further-train the encoder and the classifier using a FSL paradigm . Because the encoder plays an important role in few-shot learning , it is a good learning task to apply and test our ensemble method which takes advantage of multiple representations from the encoder . Note that in recent years , many FSL works have employed extra data from the test ( novel ) classes for better performance . The extra data can be unlabeled and given at the test time ( transductive learning ) ( Kye et al. , 2020 ; Yang et al. , 2020 ) or during the training phase ( semi-supervised learning ) ( Rodrı́guez et al. , 2020 ; Lichtenstein et al. , 2020 ) . Our problem scope focuses on the traditional FSL setting , where only a few ( one or five ) support images per novel class are available at the test time . Experiments with our ensemble model were conducted on two FSL benchmark datasets and we obtained new state-of-the-art results for both . Besides evaluating our ensemble and comparing it to the existing methods for FSL tasks , we also conducted experiments that demonstrated that the utilization of multiple representations in the ensemble is crucial for the success of our method . Our main contributions are as follows : 1 ) We propose a novel ensemble method that creates a collection of models by employing multiple representations from different depth of a deep neural network . 2 ) We demonstrated the advantage of our ensemble model on the FSL problems and achieved new stateof-the-art results on two benchmark datasets . Our experiments also showed that multi-representation is necessary for the improved performance of the ensemble . 2 RELATED WORK . Ensemble methods . Ensemble methods are commonly used to improve prediction quality . Some example ensemble strategies include : ( 1 ) manipulate the data , such as data augmentation or dividing the original dataset into smaller subsets and then training a different model on each subset . ( 2 ) apply different models or learning algorithms . For example , train a neural network with varied hyperparameter values such as different learning rates or different structures . ( 3 ) hybridize multiple ensemble strategies , e.g. , random forest . Ensembles have also been applied to FSL problems . Liu et al . ( 2019b ) proposed to learn an ensemble of temporal base-learners , which are generated along the training time , producing encouraging results on the mini-ImageNet and the Fewshot-CIFAR100 datasets . Dvornik et al . ( 2019 ) introduced mechanisms to encourage cooperation and diversity of individual classifiers in an ensemble model . The main difference between our method and the previous ones is the ensemble construction that utilizes multiple representations from different depth of a neural network . Few-shot learning . Meta-learning method has shown great success in FSL ( Finn et al. , 2017 ; Grant et al. , 2018 ; Lee & Choi , 2018 ) . MAML ( Finn et al. , 2017 ) used a meta-learner that learns from the training images to effectively initialize a base-learner for a new learning task in the test dataset . Further works aimed to enhance the generalization ability by improving the learning algorithm ( Nichol et al. , 2018 ) , fine-tuning the image embedding space ( Sun et al. , 2019 ; Rusu et al. , 2018 ) . Another popular direction for FSL is metric-learning which targets on learning metric space where classes can be easily separated . For example , Prototypical Networks use euclidean distance with each class prototype set to be the mean of the support embeddings ( Snell et al. , 2017 ) . Relation network ( Sung et al. , 2018 ) was proposed to compute the similarity score between a pair of support and query images . The query image is classified into the category with the highest similarity . Each individual model in our ensemble employs a relation network for classification while the relational network in different models receives different representation as input . Many recent FSL studies proposed approaches that utilized extra unlabled data or other additional information ( Li et al. , 2019b ; Kye et al. , 2020 ; Yang et al. , 2020 ; Hu et al. , 2020 ; Rodrı́guez et al. , 2020 ; Lichtenstein et al. , 2020 ) . They are not in the scope of the problem we were considering and thus not compared in the result section . 3 MOTIVATION . As a beginning investigation on the lower layer representations , we conducted a set of experiments to gain insight into their classification power . We took the FSL setting as the experiment environment and measured the performance of the representations from different convolutional layers in the encoder . ( ResNet-18 and its two variants were used as encoders . After encoder pretraining , FSL was conducted using the representation from an encoder layer combined with a classification network . Representations from different layers were tested . ) Figure 2 ( a ) shows the classification accuracy across different convolutional layers . The best performance did not come from the final convolutional layers ( layer 18 in ResNet-18-v1 and 16 in ResNet-18 and ResNet-18-v2 ) . Instead the fourth or the fifth layer from the last ( layer 14 in ResNet-18-v1 and 12 in ResNet-18 and ResNet-18v2 ) generated the highest accuracy . Going further towards the lower layers , we observe that overall for the three models , the lower the convolutional layer is , the worse the classification performance becomes . We looked further into the predictions made by different layers and investigated whether these predictions can be complementary , that is , is there enough diversity among the predictions such that by combining them together , we may obtain a better prediction . Taking layers 16 and 14 of ResNet-18 as examples , we examined the FSL predictions on a random sample of 75,000 images . The classification results using the representations from these two layers are shown in Figure 2 ( b ) . The model using the representation from layer 14 had a little higher overall accuracy ( ( 44.9 + 8.4 + 6.5 ) % = 59.8 % ) than that of the one using layer 16 ( ( 44.9 + 5.6 + 8.3 ) % =58.8 % ) . We can categorize the results into 4 scenarios : 1 ) Both classified correctly ( labeled and colored as “ Both ” in Figure 2 ( b ) ) ; 2 ) Only the model using representation from layer 16 made correct prediction ( labeled and colored as “ Layer16 ” ) . The model with layer 14 gave incorrect results to these images ; 3 ) Only the model with layer 14 predicted correctly ( labeled and colored as “ Layer14 ” ) ; 4 ) Neither made correct prediction ( labeled and colored as “ Neither ” ) . Although many images were classified correctly by both models ( 44.9 % of the total ) , some images could be only recognized by one of them ( scenario 2 and 3 ) . In an ideal situation , if we find a way to resolve perfectly the conflicts between the two models in both scenarios 2 and 3 and make correct prediction for these images , a classification accuracy as high as 73.7 % may be achieved . Ensemble is a potential approach towards this goal . We did a quick test by constructing an ensemble from the two models and using the average of their outputs as the output of the ensemble . Figure 2 ( b ) also shows the result of this quick ensemble . The ensemble reached a accuracy of 61.6 % , higher than any individual model . Clearly , for images in scenario 1 , the ensemble still made the correct predictions . For images in the scenarios 2 and 3 , the ensemble was able to resolve more than half of them and make correct classifications . ( There were 13.9 % of the images in scenario 2 , 8.3 % were resolved and had correct predictions from the ensemble . There were 14.9 % of the images in scenario 3 , 8.4 % were resolved . ) Although the ensemble did not reach the ideal limit mentioned above , it did provide a better classification , more accurate than any of the individual model in the ensemble . This quick experiment shed light on the possibility to exploit representations from different layers in a deep neural network as a way to obtain better learning performance . Following this direction , we designed our ensemble method for FSL tasks . We conducted more thorough experiments to validate the approach and to determine the design choices that can optimize the performance gain .
This paper presents a deeply supervised few-shot learning model via ensemble achieving state-of-the-art performance on mini-ImageNet and tiredImageNet. The authors first studied the classification accuracy on mini-Image across convolutional layers and found the network could perform well even in the middle layer. Therefore, they added classification headers on the selected layers, so that these layers can directly output predictions. The final result is the ensemble of all the select layer predictions, called the Multiple Representation Emsemble. To improve the result, they further average the results of two models with different network backbones, called Multi-Model Emsemble. The results show this method can achieve state-of-the-art performance on the two datasets.
SP:551d4ab2faa435d4f352efc6109525f0a1a5510c
Multi-Representation Ensemble in Few-Shot Learning
Deep neural networks ( DNNs ) compute representations in a layer by layer fashion , producing a final representation at the top layer of the pipeline , and classification or regression is made using the final representation . A number of DNNs ( e.g. , ResNet , DenseNet ) have shown that representations from the earlier layers can be beneficial . They improved performance by aggregating representations from different layers . In this work , we asked the question , besides forming an aggregation , whether these representations can be utilized directly with the classification layer ( s ) to obtain better performance . We started our quest to the answer by investigating the classifiers based on the representations from different layers and observed that these classifiers were diverse and many of their decisions were complementary to each other , hence having the potential to generate a better overall decision when combined . Following this observation , we propose an ensemble method that creates an ensemble of classifiers , each taking a representation from a different depth of a base DNN as the input . We tested this ensemble method in the setting of few-shot learning . Experiments were conducted on the mini-ImageNet and tiered-ImageNet datasets which are commonly used in the evaluation of fewshot learning methods . Our ensemble achieves the new state-of-the-art results for both datasets , comparing to previous regular and ensemble approaches . 1 INTRODUCTION . The depth of a deep neural network is a main factor that contributes to the high capacity of the network . In deep neural networks , information is often processed in a layer by layer fashion through many layers , before it is fed to the final classification ( regression ) layer ( s ) . From a representation learning point of view , a representation is computed sequentially through the layers and a final representation is used to perform the targeted task . There have been deep neural networks that try to exploit the lower layers in the sequence to achieve better learning results . GoogLeNets ( Szegedy et al. , 2015 ) added auxiliary losses to the lower layers to facilitate training . Skip links ( such as the ones used in ResNet ( He et al. , 2016 ) and DenseNet ( Huang et al. , 2017 ) ) may be added to connect the lower layers to the higher ones in a deep architecture . Even though the main purposes of these approaches are to assist the training process or to help the gradient back-propagation , the success of these approaches suggests that the representations from the lower layers may be beneficial to many learning tasks . Therefore , it is worth to rethink the standard sequential structure where a final representation is used to make the prediction . In this work , we ask the question whether the representations from the lower layers can be used directly ( instead of being auxiliary or being aggregated into a final representation ) for decision making . If so , how can we take advantage of these lower-level representations and what are good practices in doing so ? We first investigated the problem by conducting classifications using the representations from different layers . We took the convolutional layers of a trained network as an encoder . The representations ( feature maps ) from different layers of the encoder were tested for their classification performance . We observed that although overall , the feature maps from the higher layers led to better performance , there was a significant number of cases that correct predictions could be made with the lower feature maps but the higher-level feature maps failed to do so . This suggested that the lower-level representations have the potential to help the classification directly ( detailed analysis in Section 3 ) . Based on the inspiration from the prior models ( i.e. , GoogLeNet , ResNet and DenseNet ) and our own observations , we propose an ensemble approach to directly take advantage of the lower-level representations . By integrating multiple models , an ensemble is likely to compensate the errors of a single classifier , and thus the overall performance of the ensemble would be better than that of a single classifier . This makes ensemble a suitable technique for our purpose . A variety of methods exist for ensemble construction . Some utilize sampling to obtain individual models from different subsets of the training data . Others construct models with different structures or initialization . However , these common ensemble methods can not achieve our goal to exploit the lower-level representations . Instead , we propose a special type of ensembles , different from the existing ones . In particular , each classifier in our ensemble takes a feature map from a different depth of a CNN encoder as input and the whole ensemble utilizes the feature maps from multiple convolutional layers . We call this approach the multi-representation ensemble . Figure 1 illustrates our ensemble approach and compares it to the common ensemble method . We evaluate our ensemble method on the few-shot learning ( FSL ) problem ( Snell et al. , 2017 ) . FSL aims to learn a network capable of recognizing instances ( query images ) from novel classes with only few labeled examples ( support images ) available in each class . Given the demanding nature ( learning from a few examples ) of the problem , many FSL approaches first train an encoder following a regular training paradigm and then further-train the encoder and the classifier using a FSL paradigm . Because the encoder plays an important role in few-shot learning , it is a good learning task to apply and test our ensemble method which takes advantage of multiple representations from the encoder . Note that in recent years , many FSL works have employed extra data from the test ( novel ) classes for better performance . The extra data can be unlabeled and given at the test time ( transductive learning ) ( Kye et al. , 2020 ; Yang et al. , 2020 ) or during the training phase ( semi-supervised learning ) ( Rodrı́guez et al. , 2020 ; Lichtenstein et al. , 2020 ) . Our problem scope focuses on the traditional FSL setting , where only a few ( one or five ) support images per novel class are available at the test time . Experiments with our ensemble model were conducted on two FSL benchmark datasets and we obtained new state-of-the-art results for both . Besides evaluating our ensemble and comparing it to the existing methods for FSL tasks , we also conducted experiments that demonstrated that the utilization of multiple representations in the ensemble is crucial for the success of our method . Our main contributions are as follows : 1 ) We propose a novel ensemble method that creates a collection of models by employing multiple representations from different depth of a deep neural network . 2 ) We demonstrated the advantage of our ensemble model on the FSL problems and achieved new stateof-the-art results on two benchmark datasets . Our experiments also showed that multi-representation is necessary for the improved performance of the ensemble . 2 RELATED WORK . Ensemble methods . Ensemble methods are commonly used to improve prediction quality . Some example ensemble strategies include : ( 1 ) manipulate the data , such as data augmentation or dividing the original dataset into smaller subsets and then training a different model on each subset . ( 2 ) apply different models or learning algorithms . For example , train a neural network with varied hyperparameter values such as different learning rates or different structures . ( 3 ) hybridize multiple ensemble strategies , e.g. , random forest . Ensembles have also been applied to FSL problems . Liu et al . ( 2019b ) proposed to learn an ensemble of temporal base-learners , which are generated along the training time , producing encouraging results on the mini-ImageNet and the Fewshot-CIFAR100 datasets . Dvornik et al . ( 2019 ) introduced mechanisms to encourage cooperation and diversity of individual classifiers in an ensemble model . The main difference between our method and the previous ones is the ensemble construction that utilizes multiple representations from different depth of a neural network . Few-shot learning . Meta-learning method has shown great success in FSL ( Finn et al. , 2017 ; Grant et al. , 2018 ; Lee & Choi , 2018 ) . MAML ( Finn et al. , 2017 ) used a meta-learner that learns from the training images to effectively initialize a base-learner for a new learning task in the test dataset . Further works aimed to enhance the generalization ability by improving the learning algorithm ( Nichol et al. , 2018 ) , fine-tuning the image embedding space ( Sun et al. , 2019 ; Rusu et al. , 2018 ) . Another popular direction for FSL is metric-learning which targets on learning metric space where classes can be easily separated . For example , Prototypical Networks use euclidean distance with each class prototype set to be the mean of the support embeddings ( Snell et al. , 2017 ) . Relation network ( Sung et al. , 2018 ) was proposed to compute the similarity score between a pair of support and query images . The query image is classified into the category with the highest similarity . Each individual model in our ensemble employs a relation network for classification while the relational network in different models receives different representation as input . Many recent FSL studies proposed approaches that utilized extra unlabled data or other additional information ( Li et al. , 2019b ; Kye et al. , 2020 ; Yang et al. , 2020 ; Hu et al. , 2020 ; Rodrı́guez et al. , 2020 ; Lichtenstein et al. , 2020 ) . They are not in the scope of the problem we were considering and thus not compared in the result section . 3 MOTIVATION . As a beginning investigation on the lower layer representations , we conducted a set of experiments to gain insight into their classification power . We took the FSL setting as the experiment environment and measured the performance of the representations from different convolutional layers in the encoder . ( ResNet-18 and its two variants were used as encoders . After encoder pretraining , FSL was conducted using the representation from an encoder layer combined with a classification network . Representations from different layers were tested . ) Figure 2 ( a ) shows the classification accuracy across different convolutional layers . The best performance did not come from the final convolutional layers ( layer 18 in ResNet-18-v1 and 16 in ResNet-18 and ResNet-18-v2 ) . Instead the fourth or the fifth layer from the last ( layer 14 in ResNet-18-v1 and 12 in ResNet-18 and ResNet-18v2 ) generated the highest accuracy . Going further towards the lower layers , we observe that overall for the three models , the lower the convolutional layer is , the worse the classification performance becomes . We looked further into the predictions made by different layers and investigated whether these predictions can be complementary , that is , is there enough diversity among the predictions such that by combining them together , we may obtain a better prediction . Taking layers 16 and 14 of ResNet-18 as examples , we examined the FSL predictions on a random sample of 75,000 images . The classification results using the representations from these two layers are shown in Figure 2 ( b ) . The model using the representation from layer 14 had a little higher overall accuracy ( ( 44.9 + 8.4 + 6.5 ) % = 59.8 % ) than that of the one using layer 16 ( ( 44.9 + 5.6 + 8.3 ) % =58.8 % ) . We can categorize the results into 4 scenarios : 1 ) Both classified correctly ( labeled and colored as “ Both ” in Figure 2 ( b ) ) ; 2 ) Only the model using representation from layer 16 made correct prediction ( labeled and colored as “ Layer16 ” ) . The model with layer 14 gave incorrect results to these images ; 3 ) Only the model with layer 14 predicted correctly ( labeled and colored as “ Layer14 ” ) ; 4 ) Neither made correct prediction ( labeled and colored as “ Neither ” ) . Although many images were classified correctly by both models ( 44.9 % of the total ) , some images could be only recognized by one of them ( scenario 2 and 3 ) . In an ideal situation , if we find a way to resolve perfectly the conflicts between the two models in both scenarios 2 and 3 and make correct prediction for these images , a classification accuracy as high as 73.7 % may be achieved . Ensemble is a potential approach towards this goal . We did a quick test by constructing an ensemble from the two models and using the average of their outputs as the output of the ensemble . Figure 2 ( b ) also shows the result of this quick ensemble . The ensemble reached a accuracy of 61.6 % , higher than any individual model . Clearly , for images in scenario 1 , the ensemble still made the correct predictions . For images in the scenarios 2 and 3 , the ensemble was able to resolve more than half of them and make correct classifications . ( There were 13.9 % of the images in scenario 2 , 8.3 % were resolved and had correct predictions from the ensemble . There were 14.9 % of the images in scenario 3 , 8.4 % were resolved . ) Although the ensemble did not reach the ideal limit mentioned above , it did provide a better classification , more accurate than any of the individual model in the ensemble . This quick experiment shed light on the possibility to exploit representations from different layers in a deep neural network as a way to obtain better learning performance . Following this direction , we designed our ensemble method for FSL tasks . We conducted more thorough experiments to validate the approach and to determine the design choices that can optimize the performance gain .
Thanks to the authors for providing such an ensemble approach. This paper aims to find a way to directly utilize representations with the classification layer(s) to obtain better performance. The ensemble method is able to create an ensemble of classifiers. And the ensemble achieves the new state-of-the-art results in a few-shot setting, comparing to previous regular and ensemble approaches.
SP:551d4ab2faa435d4f352efc6109525f0a1a5510c
Novel Policy Seeking with Constrained Optimization
1 INTRODUCTION . In the sense of learning through interactions with the environment , the scheme of reinforcement learning ( RL ) is conceptually similar to the emergence of intelligence ( Sutton et al. , 1998 ) : an agent explores and exploits information of a given environment , learns to master some certain skills through trials and errors to gain as much reward as possible . When solving a problem , we humans could be creative to come up with multiple different solutions and gain insights from searching for diverse solutions . e.g. , a self-containing example is the various approaches in RL research . While the state-of-the-art algorithms have achieved superhuman performance in a variety of challenging tasks ( Vinyals et al. , 2019 ; Akkaya et al. , 2019 ; Berner et al. , 2019 ; Badia et al. , 2020 ; Elbarbari et al. , 2021 ) , the task of encouraging individualized diversity 2 of learned agents , on the other hand , is relatively under-explored . Different from conventional RL agents that are only learned through interactions with the external environment , novel policy generation is a task considering the differentiation among individual policies . The differentiation among policies can be explained as the social influence ( Rogoff , 1990 ; Ryan & Deci , 2000 ; van Schaik & Burkart , 2011 ; Henrich , 2017 ; Harari , 2014 ) in social science literature . Although many works have been proposed applying social motivation to Multi-Agent Reinforcement Learning ( MARL ) settings ( Jaques et al. , 2019 ; Hughes et al. , 2018 ; Sequeira et al. , 2011 ; Peysakhovich & Lerer , 2017 ) , how to motivate a single RL agent to perform differently against existing agents is still an open question . In previous attempts for novel policy generation , there are three main challenges : ( 1 ) heuristically defined metric for novelty estimation is computational expensive ( Zhang et al. , 2019 ) , ( 2 ) defining novelty reward for an entire episode yields additional challenge in credit assignment , and ( 3 ) solving 1Code is included in the supplemental material . 2Note that this is different from diversity-driven exploration . While the latter focuses on the inner-diversity of a policy , in our work we focus on the inter-diversity between policies the problem under the formulation of multi-objective optimization leads to the performance decay in the original task . Fig . 1 compares the policy gradients of three cases , namely the one without novel policy seeking , novelty-seeking with multi-objective optimization , and novelty-seeking with constrained optimization methods , respectively . In this work we take into consideration not only the novelty of a set of learned policies but also the performance of those novel policies in the primal task , when addressing the problem of novel-policygeneration . Our contributions can be summarized as follows : 1 . We introduce a lightweight metric to compute the difference between policies with instant feedback at every timestep , to address the first two drawbacks of previous novel policy seeking methods discussed above ; 2 . We propose a constrained optimization formulation for novel policy generation and design a practical algorithm of IPD , resembling the interior point method in constrained optimization literature ; 3 . The proposed method , IPD , is evaluated on several continuous control benchmarks , showing the strengths of our constrained optimization solution for novelty-seeking can generate a series of diverse and well-performing policies , compared to previous multi-objective novel policy generation methods . 2 RELATED WORK . Intrinsic motivation methods . In previous work , different approaches are proposed to provide intrinsic motivation or intrinsic reward as a supplementary to the primal task reward for better exploration ( Houthooft et al. , 2016 ; Pathak et al. , 2017 ; Burda et al. , 2018a ; b ; Liu et al. , 2019 ) . All those approaches use the weighted sum of two rewards , the primal rewards provided by environments and the intrinsic rewards provided by different heuristics . On the other hand , the work of DIAYN and DADS ( Eysenbach et al. , 2018 ; Sharma et al. , 2019 ) learn diverse skills without extrinsic reward . Those approaches focus on decomposing diverse skills of a single policy , while our work focuses on learning diverse behaviors among a batch of policies for the same task . Diverse policy generation methods . The work of Such et al . shows that different RL algorithms may converge to different policies for the same task ( Such et al. , 2018 ) . On the contrary , we are interested in learning different policies through a single algorithm with the capability of avoiding local optimum . The work of Pugh et al . establishes a standard framework for understanding and comparing different approaches to search for quality diversity ( QD ) ( Pugh et al. , 2016 ) . Conti et al . proposes a solution which avoids local optima as well as achieves higher performance by adding novelty search and QD to evolution strategies ( Conti et al. , 2018 ) . The Task-Novelty Bisector ( TNB ) ( Zhang et al. , 2019 ) aims to solve novel policy generation problem by jointly optimize the extrinsic rewards and novelty rewards defined by an auto-encoder . In this work , we first adopt TNB in the constrained optimization framework , resulting in Contrained TNB , to demonstrate the dilemma between the task performance and novelty pursuance . Constrained Markov Decision Process . The Constrained Markov Decision Process ( CMDP ) ( Altman , 1999 ) considers the situation where an agent interacts with the environment under certain constraints . Formally , the CMDP can be defined as a tuple ( S , A , γ , r , c , C , P , s0 ) , where S andA are the state and action space ; γ ∈ [ 0 , 1 ) is a discount factor ; r : S×A×S → R and c : S×A×S → R denote the reward function and cost function ; C ∈ R+ is the upper bound of permitted expected cumulative cost ; P ( ·|s , a ) : S ×A → S denotes the transition dynamics , and s0 is the initial state . Denote the Markovian policy class as Π , where Π = { π : S × A → [ 0 , 1 ] , ∑ a π ( a|π ) = 1 } The learning objective of a policy for CMDP is to find a π∗ ∈ Π , such that π∗ = max π∈Π Eτ∼π , s′∼P [ ∞∑ t=0 γtr ( s , a , s′ ) ] , s.t . Eτ∼π , s′∼P [ ∞∑ t=0 γtc ( s , a , s′ ) ] ≤ C , ( 1 ) where τ indicates a trajectory ( s0 , a0 , s1 , ... ) and τ ∼ π represents the distribution over trajectories following policy π : at ∼ π ( ·|st ) , st+1 ∼ P ( ·|st , at ) ; t = 0 , 1 , 2 , .... Previous literature provide several approaches to solve CMDP ( Achiam et al. , 2017 ; Chow et al. , 2018 ; Ray et al. , 2019 ; Sun et al. , 2021 ) . In Sec.2.1 , we define a metric space that measures the difference between policies , which is the fundamental element for the proposed methods . In Sec.2.2 , we develop a practical estimation method for this metric . Sec.2.3 describes the formulation of constrained optimization on novel policy generation . The implementations of two practical algorithms are further introduced in Sec.2.4 . We denote the policies as { πθi ; θi ∈ Θ , i = 1 , 2 , ... } , wherein θi represents parameters of the i-th policy , Θ denotes the whole parameter space . In this work , we focus on improving the behavioral diversity of policies from PPO ( Schulman et al. , 2017 ) , thus we use Θ to represent ΘPPO in this paper . It is worth noting that the proposed methods can be easily extended to other RL algorithms ( Schulman et al. , 2015 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018 ) . To simplify the notation , we omit π and denote a policy πθi as θi unless stated otherwise . 2.1 MEASURING THE DIFFERENCE BETWEEN POLICIES . We use the Wasserstein metric Wp ( Rüschendorf , 1985 ; Villani , 2008 ; Arjovsky et al. , 2017 ) to measure the distance between policies . Concretely , we consider the Gaussian-parameterized policies , where the Wp over two policies can be written in the closed form W 22 ( N ( m1 , Σ1 ) , N ( m2 , Σ2 ) ) = ||m1 −m2||2 + tr [ Σ1 + Σ2 − 2 ( Σ1/21 Σ2Σ 1/2 1 ) 1/2 ] as p = 2 , where m1 , Σ1 , m2 , Σ2 are mean and covariance metrics of the two normal distributions . In the following of this paper , we use DW to denote the W2 and it is worth noting that for the deterministic policy class , the trace term disappears and the only term involving the means remains , i.e. , DW = |m1 − m2| for Dirac delta policies located at points m1 and m2 . This diversity metric satisfies the three properties of a metric , namely identity , symmetry as well as triangle inequality . Proposition 1 ( Metric Space ( Θ , DqW ) ) . The expectation of DW ( · , · ) of two policies over any state distribution q ( s ) : D q W ( θi , θj ) : = Es∼q ( s ) [ DW ( θi ( a|s ) , θj ( a|s ) ) ] , ( 2 ) is a metric on Θ , thus ( Θ , D q W ) is a metric space . The proof of Proposition 1 is straightforward . It is worth mentioning that although the KL-divergence is commonly applied in measuring differences between policies ( Schulman et al. , 2015 ; 2017 ; Hong et al. , 2018 ) . It can not be used directly as a metric for novelty quantification as the symmetric property do not hold . In this sense , the Jensen Shannon divergence DJS and Total Variance Distance DTV ( Endres & Schindelin , 2003 ; Fuglede & Topsoe , 2004 ; Schulman et al. , 2015 ) can be also used as alternative choices , we choose DW in our work for that the Wasserstein metric better preserves the continuity ( Arjovsky et al. , 2017 ) . On top of the metric space ( Θ , D q W ) , the novelty of a policy can be computed as follows , Definition 1 ( Novelty of Policy ) . Given a reference policy set Θref such that Θref = { θrefi , i = 1 , 2 , ... } , Θref ⊂ Θ , the novelty U ( θ|Θref ) of policy θ is the minimal difference between θ and all policies in the reference policy set , i.e. , U ( θ|Θref ) : = min θj∈Θref D q W ( θ , θj ) , ( 3 ) Consequently , to encourage the discovery of novel policies discovery , typical novel policy generation methods tend to directly maximize the novelty of a new policy , i.e. , maxθ U ( θ|Θref ) , where Θref includes all existing policies . 2.2 ESTIMATION OF D q W ( θi , θj ) AND THE SELECTION OF q ( s ) In practice , the calculation of D q W ( θi , θj ) is based on Monte Carlo estimation where we need to sample s from q ( s ) . Although in Eq . ( 2 ) q ( s ) can be selected simply as a uniform distribution over the state space , there remains two obstacles : first , in a finite state space we can get precise estimation after establishing ergodicity , but problem arises when facing continuous state spaces due to the difficulty of efficiently obtaining enough samples ; second , when s is sampled from a uniform distribution q , we can only get sparse episodic reward instead of dense online reward which is more useful in learning . Therefore , we make an approximation here based on importance sampling . Formally , we denote the domain of q ( s ) as Sq ⊂ S and assume q ( s ) to be a uniform distribution over Sq , without loss of generality in later analysis . Notice Sq is closely related to the algorithm being used in generating trajectories ( Henderson et al. , 2018 ) . As we only care about the reachable regions of a certain algorithm ( in this work , PPO ) , the domain Sq can be decomposed by Sq = limN→∞ ⋃N i=1 Sθi , where Sθi denotes all the possible states a policy θi can visit given a starting state distribution . In order to get online-reward , we estimate Eq . ( 2 ) with D q W ( θi , θj ) = Es∼q ( s ) [ DW ( θi ( a|s ) , θj ( a|s ) ) ] = Es∼ρθi ( s ) [ q ( s ) ρθi ( s ) DW ( θi ( a|s ) , θj ( a|s ) ) ] , ( 4 ) where we use ρθ ( s ) to denote the stationary state visitation frequency under policy θ , i.e. , ρθ ( s ) = P ( s0 = s|θ ) + P ( s1 = s|θ ) + ... + P ( sT = s|θ ) in finite horizon problems . We propose to use the averaged stationary visitation frequency as q ( s ) , e.g. , for PPO , q ( s ) = ρ ( s ) = Eθ∼ΘPPO [ ρθ ( s ) ] . Clearly , choosing q ( s ) = ρ ( s ) will be much better than choosing a uniform distribution as the importance weight will be closer to 1 . Such an importance sampling process requires a necessary condition that ρθi ( s ) and q ( s ) have the same domain , which can be guaranteed by applying a sufficient exploration noise on θ . Another difficulty lies in the estimation of ρ ( s ) , which is always intractable given a limited number of trajectories . However , during training , θi is a policy to be optimized and θj ∈ Θref is a fixed reference policy . The error introduced by approximating the importance weight as 1 will get larger when θi becomes more distinct from normal policies , at least in terms of the state visitation frequency . We may just regard increasing of the approximation error as the discovery of novel policies . Proposition 2 ( Unbiased Single Trajectory Estimation ) . The estimation of ρθ ( s ) using a single trajectory τ is unbiased . The Proposition 2 follows the usual trick in RL that uses a single trajectory to estimate the stationary state visitation frequency , and indicates that with a sufficiently large number of trajectories , we are able to access the exact value of novelty . Given the definition of novelty and a practically unbiased sampling method , the next step is to develop an efficient learning algorithm .
This paper aims at novel policy seeking which incorporates curiosity-driven exploration for better reinforcement learning. This paper first propose to use a Wasserstein-based metric to calculate the difference between policies, and use it to define the policy novelty. With these, the authors modeled the novel policy seeking as a constrained markov decision process(CMDP) and solved it using CTNB and IPD.
SP:f7b7dfafb03090a2c940ba738234a6c80bd5ad0e
Novel Policy Seeking with Constrained Optimization
1 INTRODUCTION . In the sense of learning through interactions with the environment , the scheme of reinforcement learning ( RL ) is conceptually similar to the emergence of intelligence ( Sutton et al. , 1998 ) : an agent explores and exploits information of a given environment , learns to master some certain skills through trials and errors to gain as much reward as possible . When solving a problem , we humans could be creative to come up with multiple different solutions and gain insights from searching for diverse solutions . e.g. , a self-containing example is the various approaches in RL research . While the state-of-the-art algorithms have achieved superhuman performance in a variety of challenging tasks ( Vinyals et al. , 2019 ; Akkaya et al. , 2019 ; Berner et al. , 2019 ; Badia et al. , 2020 ; Elbarbari et al. , 2021 ) , the task of encouraging individualized diversity 2 of learned agents , on the other hand , is relatively under-explored . Different from conventional RL agents that are only learned through interactions with the external environment , novel policy generation is a task considering the differentiation among individual policies . The differentiation among policies can be explained as the social influence ( Rogoff , 1990 ; Ryan & Deci , 2000 ; van Schaik & Burkart , 2011 ; Henrich , 2017 ; Harari , 2014 ) in social science literature . Although many works have been proposed applying social motivation to Multi-Agent Reinforcement Learning ( MARL ) settings ( Jaques et al. , 2019 ; Hughes et al. , 2018 ; Sequeira et al. , 2011 ; Peysakhovich & Lerer , 2017 ) , how to motivate a single RL agent to perform differently against existing agents is still an open question . In previous attempts for novel policy generation , there are three main challenges : ( 1 ) heuristically defined metric for novelty estimation is computational expensive ( Zhang et al. , 2019 ) , ( 2 ) defining novelty reward for an entire episode yields additional challenge in credit assignment , and ( 3 ) solving 1Code is included in the supplemental material . 2Note that this is different from diversity-driven exploration . While the latter focuses on the inner-diversity of a policy , in our work we focus on the inter-diversity between policies the problem under the formulation of multi-objective optimization leads to the performance decay in the original task . Fig . 1 compares the policy gradients of three cases , namely the one without novel policy seeking , novelty-seeking with multi-objective optimization , and novelty-seeking with constrained optimization methods , respectively . In this work we take into consideration not only the novelty of a set of learned policies but also the performance of those novel policies in the primal task , when addressing the problem of novel-policygeneration . Our contributions can be summarized as follows : 1 . We introduce a lightweight metric to compute the difference between policies with instant feedback at every timestep , to address the first two drawbacks of previous novel policy seeking methods discussed above ; 2 . We propose a constrained optimization formulation for novel policy generation and design a practical algorithm of IPD , resembling the interior point method in constrained optimization literature ; 3 . The proposed method , IPD , is evaluated on several continuous control benchmarks , showing the strengths of our constrained optimization solution for novelty-seeking can generate a series of diverse and well-performing policies , compared to previous multi-objective novel policy generation methods . 2 RELATED WORK . Intrinsic motivation methods . In previous work , different approaches are proposed to provide intrinsic motivation or intrinsic reward as a supplementary to the primal task reward for better exploration ( Houthooft et al. , 2016 ; Pathak et al. , 2017 ; Burda et al. , 2018a ; b ; Liu et al. , 2019 ) . All those approaches use the weighted sum of two rewards , the primal rewards provided by environments and the intrinsic rewards provided by different heuristics . On the other hand , the work of DIAYN and DADS ( Eysenbach et al. , 2018 ; Sharma et al. , 2019 ) learn diverse skills without extrinsic reward . Those approaches focus on decomposing diverse skills of a single policy , while our work focuses on learning diverse behaviors among a batch of policies for the same task . Diverse policy generation methods . The work of Such et al . shows that different RL algorithms may converge to different policies for the same task ( Such et al. , 2018 ) . On the contrary , we are interested in learning different policies through a single algorithm with the capability of avoiding local optimum . The work of Pugh et al . establishes a standard framework for understanding and comparing different approaches to search for quality diversity ( QD ) ( Pugh et al. , 2016 ) . Conti et al . proposes a solution which avoids local optima as well as achieves higher performance by adding novelty search and QD to evolution strategies ( Conti et al. , 2018 ) . The Task-Novelty Bisector ( TNB ) ( Zhang et al. , 2019 ) aims to solve novel policy generation problem by jointly optimize the extrinsic rewards and novelty rewards defined by an auto-encoder . In this work , we first adopt TNB in the constrained optimization framework , resulting in Contrained TNB , to demonstrate the dilemma between the task performance and novelty pursuance . Constrained Markov Decision Process . The Constrained Markov Decision Process ( CMDP ) ( Altman , 1999 ) considers the situation where an agent interacts with the environment under certain constraints . Formally , the CMDP can be defined as a tuple ( S , A , γ , r , c , C , P , s0 ) , where S andA are the state and action space ; γ ∈ [ 0 , 1 ) is a discount factor ; r : S×A×S → R and c : S×A×S → R denote the reward function and cost function ; C ∈ R+ is the upper bound of permitted expected cumulative cost ; P ( ·|s , a ) : S ×A → S denotes the transition dynamics , and s0 is the initial state . Denote the Markovian policy class as Π , where Π = { π : S × A → [ 0 , 1 ] , ∑ a π ( a|π ) = 1 } The learning objective of a policy for CMDP is to find a π∗ ∈ Π , such that π∗ = max π∈Π Eτ∼π , s′∼P [ ∞∑ t=0 γtr ( s , a , s′ ) ] , s.t . Eτ∼π , s′∼P [ ∞∑ t=0 γtc ( s , a , s′ ) ] ≤ C , ( 1 ) where τ indicates a trajectory ( s0 , a0 , s1 , ... ) and τ ∼ π represents the distribution over trajectories following policy π : at ∼ π ( ·|st ) , st+1 ∼ P ( ·|st , at ) ; t = 0 , 1 , 2 , .... Previous literature provide several approaches to solve CMDP ( Achiam et al. , 2017 ; Chow et al. , 2018 ; Ray et al. , 2019 ; Sun et al. , 2021 ) . In Sec.2.1 , we define a metric space that measures the difference between policies , which is the fundamental element for the proposed methods . In Sec.2.2 , we develop a practical estimation method for this metric . Sec.2.3 describes the formulation of constrained optimization on novel policy generation . The implementations of two practical algorithms are further introduced in Sec.2.4 . We denote the policies as { πθi ; θi ∈ Θ , i = 1 , 2 , ... } , wherein θi represents parameters of the i-th policy , Θ denotes the whole parameter space . In this work , we focus on improving the behavioral diversity of policies from PPO ( Schulman et al. , 2017 ) , thus we use Θ to represent ΘPPO in this paper . It is worth noting that the proposed methods can be easily extended to other RL algorithms ( Schulman et al. , 2015 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018 ) . To simplify the notation , we omit π and denote a policy πθi as θi unless stated otherwise . 2.1 MEASURING THE DIFFERENCE BETWEEN POLICIES . We use the Wasserstein metric Wp ( Rüschendorf , 1985 ; Villani , 2008 ; Arjovsky et al. , 2017 ) to measure the distance between policies . Concretely , we consider the Gaussian-parameterized policies , where the Wp over two policies can be written in the closed form W 22 ( N ( m1 , Σ1 ) , N ( m2 , Σ2 ) ) = ||m1 −m2||2 + tr [ Σ1 + Σ2 − 2 ( Σ1/21 Σ2Σ 1/2 1 ) 1/2 ] as p = 2 , where m1 , Σ1 , m2 , Σ2 are mean and covariance metrics of the two normal distributions . In the following of this paper , we use DW to denote the W2 and it is worth noting that for the deterministic policy class , the trace term disappears and the only term involving the means remains , i.e. , DW = |m1 − m2| for Dirac delta policies located at points m1 and m2 . This diversity metric satisfies the three properties of a metric , namely identity , symmetry as well as triangle inequality . Proposition 1 ( Metric Space ( Θ , DqW ) ) . The expectation of DW ( · , · ) of two policies over any state distribution q ( s ) : D q W ( θi , θj ) : = Es∼q ( s ) [ DW ( θi ( a|s ) , θj ( a|s ) ) ] , ( 2 ) is a metric on Θ , thus ( Θ , D q W ) is a metric space . The proof of Proposition 1 is straightforward . It is worth mentioning that although the KL-divergence is commonly applied in measuring differences between policies ( Schulman et al. , 2015 ; 2017 ; Hong et al. , 2018 ) . It can not be used directly as a metric for novelty quantification as the symmetric property do not hold . In this sense , the Jensen Shannon divergence DJS and Total Variance Distance DTV ( Endres & Schindelin , 2003 ; Fuglede & Topsoe , 2004 ; Schulman et al. , 2015 ) can be also used as alternative choices , we choose DW in our work for that the Wasserstein metric better preserves the continuity ( Arjovsky et al. , 2017 ) . On top of the metric space ( Θ , D q W ) , the novelty of a policy can be computed as follows , Definition 1 ( Novelty of Policy ) . Given a reference policy set Θref such that Θref = { θrefi , i = 1 , 2 , ... } , Θref ⊂ Θ , the novelty U ( θ|Θref ) of policy θ is the minimal difference between θ and all policies in the reference policy set , i.e. , U ( θ|Θref ) : = min θj∈Θref D q W ( θ , θj ) , ( 3 ) Consequently , to encourage the discovery of novel policies discovery , typical novel policy generation methods tend to directly maximize the novelty of a new policy , i.e. , maxθ U ( θ|Θref ) , where Θref includes all existing policies . 2.2 ESTIMATION OF D q W ( θi , θj ) AND THE SELECTION OF q ( s ) In practice , the calculation of D q W ( θi , θj ) is based on Monte Carlo estimation where we need to sample s from q ( s ) . Although in Eq . ( 2 ) q ( s ) can be selected simply as a uniform distribution over the state space , there remains two obstacles : first , in a finite state space we can get precise estimation after establishing ergodicity , but problem arises when facing continuous state spaces due to the difficulty of efficiently obtaining enough samples ; second , when s is sampled from a uniform distribution q , we can only get sparse episodic reward instead of dense online reward which is more useful in learning . Therefore , we make an approximation here based on importance sampling . Formally , we denote the domain of q ( s ) as Sq ⊂ S and assume q ( s ) to be a uniform distribution over Sq , without loss of generality in later analysis . Notice Sq is closely related to the algorithm being used in generating trajectories ( Henderson et al. , 2018 ) . As we only care about the reachable regions of a certain algorithm ( in this work , PPO ) , the domain Sq can be decomposed by Sq = limN→∞ ⋃N i=1 Sθi , where Sθi denotes all the possible states a policy θi can visit given a starting state distribution . In order to get online-reward , we estimate Eq . ( 2 ) with D q W ( θi , θj ) = Es∼q ( s ) [ DW ( θi ( a|s ) , θj ( a|s ) ) ] = Es∼ρθi ( s ) [ q ( s ) ρθi ( s ) DW ( θi ( a|s ) , θj ( a|s ) ) ] , ( 4 ) where we use ρθ ( s ) to denote the stationary state visitation frequency under policy θ , i.e. , ρθ ( s ) = P ( s0 = s|θ ) + P ( s1 = s|θ ) + ... + P ( sT = s|θ ) in finite horizon problems . We propose to use the averaged stationary visitation frequency as q ( s ) , e.g. , for PPO , q ( s ) = ρ ( s ) = Eθ∼ΘPPO [ ρθ ( s ) ] . Clearly , choosing q ( s ) = ρ ( s ) will be much better than choosing a uniform distribution as the importance weight will be closer to 1 . Such an importance sampling process requires a necessary condition that ρθi ( s ) and q ( s ) have the same domain , which can be guaranteed by applying a sufficient exploration noise on θ . Another difficulty lies in the estimation of ρ ( s ) , which is always intractable given a limited number of trajectories . However , during training , θi is a policy to be optimized and θj ∈ Θref is a fixed reference policy . The error introduced by approximating the importance weight as 1 will get larger when θi becomes more distinct from normal policies , at least in terms of the state visitation frequency . We may just regard increasing of the approximation error as the discovery of novel policies . Proposition 2 ( Unbiased Single Trajectory Estimation ) . The estimation of ρθ ( s ) using a single trajectory τ is unbiased . The Proposition 2 follows the usual trick in RL that uses a single trajectory to estimate the stationary state visitation frequency , and indicates that with a sufficiently large number of trajectories , we are able to access the exact value of novelty . Given the definition of novelty and a practically unbiased sampling method , the next step is to develop an efficient learning algorithm .
This paper proposed a method to leverage the constrained optimization for policy training to learn diverse policies given some references. Based on a diversity metric defined on policy divergences, the paper employs two constrained optimization techniques for this problem with some modifications. Experiments on mujoco environments suggest that the proposed algorithms can beat existing diversity-driven policy optimization methods to learn both better and novel policies. Generally, the paper is well-written and easy to follow. Some concerns/comments:
SP:f7b7dfafb03090a2c940ba738234a6c80bd5ad0e
What Matters for On-Policy Deep Actor-Critic Methods? A Large-Scale Study
1 INTRODUCTION . Deep reinforcement learning ( RL ) has seen increased interest in recent years due to its ability to have neural-network-based agents learn to act in environments through interactions . For continuous control tasks , on-policy algorithms such as REINFORCE [ 2 ] , TRPO [ 10 ] , A3C [ 14 ] , PPO [ 17 ] and off-policy algorithms such as DDPG [ 13 ] and SAC [ 21 ] have enabled successful applications such as quadrupedal locomotion [ 20 ] , self-driving [ 30 ] or dexterous in-hand manipulation [ 20 , 25 , 32 ] . Many of these papers investigate in depth different algorithmic ideas , for example different loss functions and learning paradigms . Yet , it is less visible that behind successful experiments in deep RL there are complicated code bases that contain a large number of low- and high-level design decisions that are usually not discussed in research papers . While one may assume that such “ choices ” do not matter , there is evidence that they are in fact crucial for or even driving good performance [ 27 ] . While there are open-source implementations available that can be used by practitioners , this is still unsatisfactory : Research publications often contain one-to-one comparisons of different algorithmic ideas based on implementations in different code bases . This makes it impossible to assess whether improvements are due to the underlying algorithmic idea or due to the implementation . In fact , it is hard to assess the performance of high-level algorithmic ideas without an understanding of lower-level choices as performance may strongly depend on the tuning of hyperparameters and implementationlevel details . Overall , this makes it hard to attribute progress in reinforcement learning and slows down further research [ 15 , 22 , 27 ] . Our contributions . Our key goal in this paper is to investigate such lower level choices in depth and to understand their impact on final agent performance . Hence , as our key contributions , we ( 1 ) implement > 50 choices in a unified on-policy deep actor-critic implementation1 , ( 2 ) conducted a large-scale ( more than 250 ’ 000 agents trained ) experimental study that covers different aspects of the training process , and ( 3 ) analyze the experimental results to provide practical insights and recommendations for the training of on-policy deep actor-critic RL agents . 1The implementation is available at https : //github.com/google-research/seed_rl . Most surprising finding . While many of our experimental findings confirm common RL practices , some of them are quite surprising , e.g . the policy initialization scheme significantly influences the performance while it is rarely even mentioned in RL publications . In particular , we have found that initializing the network so that the initial action distribution has zero mean , a rather low standard deviation and is independent of the observation significantly improves the training speed ( Sec . 3.2 ) . Paper outline . The rest of of this paper is structured as follows : We describe our experimental setup and performance metrics used in Sec . 2 . Then , in Sec . 3 we present and analyse the experimental results and finish with related work in Sec . 4 and conclusions in Sec . 5 . The appendices contain the detailed description of all design choices we experiment with ( App . B ) , default hyperparameters ( App . C ) and the raw experimental results ( App . D - K ) . 2 STUDY DESIGN . Considered setting . In this paper , we consider the setting of on-policy deep actor-critic reinforcement learning for continuous control . We define on-policy learning in the following loose sense : We consider policy iteration algorithms that iterate between generating experience using the current policy and using that experience to improve the policy . This is the standard modus operandi of algorithms usually considered on-policy such as PPO [ 17 ] . However , we note that algorithms often perform several model updates and thus may operate technically on off-policy data within a single policy improvement iteration . As benchmark environments , we consider five widely used continuous control environments from OpenAI Gym [ 12 ] of varying complexity : Hopper-v1 , Walker2d-v1 , HalfCheetah-v1 , Ant-v1 , and Humanoid-v1 2 . Unified on-policy deep actor-critic gradient algorithm . We took the following approach to create a highly configurable unified on-policy deep actor-critic gradient algorithm with as many choices as possible : 1 . We researched prior work and popular code bases to make a list of commonly used choices , i.e. , different loss functions ( both for value functions and policies ) , architectural choices such as initialization methods , heuristic tricks such as gradient clipping and all their corresponding hyperparameters . 2 . Based on this , we implemented a single , unified on-policy deep actor-critic agent and corresponding training protocol starting from the SEED RL code base [ 28 ] . Whenever we were faced with implementation decisions that required us to take decisions that could not be clearly motivated or had alternative solutions , we further added such decisions as additional choices . 3 . We verified that when all choices are selected as in the PPO implementation from OpenAI baselines , we obtain similar performance as reported in the PPO paper [ 17 ] . We chose PPO because it is probably the most commonly used on-policy deep actor-critic RL algorithm at the moment . The resulting agent implementation is detailed in Appendix B . The key property is that the implementation exposes all choices as configuration options in an unified manner . For convenience , we mark each of the choice in this paper with a number ( e.g. , C1 ) and a fixed name ( e.g . num_envs ( C1 ) ) that can be easily used to find a description of the choice in Appendix B . Difficulty of investigating choices . The primary goal of this paper is to understand how the different choices affect the final performance of an agent and to derive recommendations for these choices . There are two key reasons why this is challenging : First , we are mainly interested in insights on choices for good hyperparameter configurations . Yet , if all choices are sampled randomly , the performance is very bad and little ( if any ) training progress is made . This may be explained by the presence of sub-optimal settings ( e.g. , hyperparameters of the wrong scale ) that prohibit learning at all . If there are many choices , the probability of such failure increases exponentially . 2It has been noticed that the version of the Mujoco physics simulator [ 5 ] can slightly influence the behaviour of some of the environments — https : //github.com/openai/gym/issues/1541 . We used Mujoco 2.0 in our experiments . Second , many choices may have strong interactions with other related choices , for example the learning rate and the minibatch size . This means that such choices need to be tuned together and experiments where only a single choice is varied but interacting choices are kept fixed may lead to misleading conclusions . Basic experimental design . To address these issues , we design a series of experiments as follows : We create groups of choices around thematic groups where we suspect interactions between different choices , for example we group together all choices related to neural network architecture . We also include Adam learning rate ( C24 ) in all of the groups as we suspect that it may interact with many other choices . Then , in each experiment , we train a large number of models where we randomly sample the choices within the corresponding group 3 . All other settings ( for choices not in the group ) are set to settings of a competitive base configuration ( detailed in Appendix C ) that is close to the default PPOv2 configuration4 scaled up to 256 parallel environments . This has two effects : First , it ensures that our set of trained models contains good models ( as verified by performance statistics in the corresponding results ) . Second , it guarantees that we have models that have different combinations of potentially interacting choices . We consider two different analyses for each choice ( e.g , for advantage_estimator ( C6 ) ) : Conditional 95th percentile : For each potential value of that choice ( e.g. , advantage_estimator ( C6 ) = N-Step ) , we look at the performance distribution of sampled configurations with that value . We report the 95th percentile of the performance as well as a confidence interval based on a binomial approximation 5 . Intuitively , this corresponds to a robust estimate of the performance one can expect if all other choices in the group were tuned with random search and a limited budget of roughly 20 hyperparameter configurations . Distribution of choice within top 5 % configurations . We further consider for each choice the distribution of values among the top 5 % configurations trained in that experiment . The reasoning is as follows : By design of the experiment , values for each choice are distributed uniformly at random . Thus , if certain values are over-represented in the top models , this indicates that the specific choice is important in guaranteeing good performance . Performance measures . We employ the following way to compute performance : For each choice configuration , we train 3 models with independent random seeds where each model is trained for one million ( Hopper , HalfCheetah , Walker2d ) or two million environment steps ( Ant , Humanoid ) . We evaluate trained policies every hundred thousand steps by freezing the policy and computing the average undiscounted episode return of 100 episodes ( with the stochastic policy ) . We then average these score to obtain a single performance score of the seed which is proportional to the area under the learning curve . This ensures we assign higher scores to agents that learn quickly . The performance score of a hyperparameter configuration is finally set to the median performance score across the 3 seeds . This reduces the impact of training noise , i.e. , that certain seeds of the same configuration may train much better than others . Robustness of results . While we take 3 random seeds to compute the performance measure for a single choice configuration , it is important to note that all the experimental results reported in this paper are based on more than 3 random seeds : The reported conditional 95th percentile and distribution of choice within top 5 % configurations are computed based upon the performance of hundreds of choice configurations . Furthermore , we also report confidence intervals for the conditional 95th percentile . 3Exact details for the different experiments are provided in Appendices D - K. 4https : //github.com/openai/baselines/blob/master/baselines/ppo2/ defaults.py 5We compute confidence intervals with a significance level of α = 5 % as follows : We find il = icdf ( α 2 ) and ih = icdf ( 1− α 2 ) where icdf is the inverse cumulative density function of a binomial distribution with p = 0.95 ( as we consider the 95th percentile ) and the number of draws equals the number of samples . We then report the ilth and ihth highest scores as the confidence interval . 3 EXPERIMENTS . We run experiments for eight thematic groups : Policy Losses ( Sec . 3.1 ) , Networks architecture ( Sec . 3.2 ) , Normalization and clipping ( Sec . 3.3 ) , Advantage Estimation ( Sec . 3.4 ) , Training setup ( Sec . 3.5 ) , Timesteps handling ( Sec . 3.6 ) , Optimizers ( Sec . 3.7 ) , and Regularization ( Sec . 3.8 ) . For each group , we provide a full experimental design and full experimental plots in Appendices D - K so that the reader can draw their own conclusions from the experimental results . Moreover , the raw data from all training runs and a script used to generate all plots for this paper can be found online6 . In the following sections , we provide short descriptions of the experiments , our interpretation of the results , as well as practical recommendations for agent training for continuous control .
The paper presents an empirical evaluation of many algorithmic choices made in the implementations of on-policy actor-critic algorithms in deep reinforcement learning (RL). The authors group those choices in clusters in which they expect some interactions. For each cluster, they test sets of randomly made choices while assuming that choices outside a cluster are set to competitive default values. Based on those experimental results, the authors formulate recommendations about how to make those choices for each cluster.
SP:41f93461a907d77fc2e0f4f4e3e89a0e7a133736
What Matters for On-Policy Deep Actor-Critic Methods? A Large-Scale Study
1 INTRODUCTION . Deep reinforcement learning ( RL ) has seen increased interest in recent years due to its ability to have neural-network-based agents learn to act in environments through interactions . For continuous control tasks , on-policy algorithms such as REINFORCE [ 2 ] , TRPO [ 10 ] , A3C [ 14 ] , PPO [ 17 ] and off-policy algorithms such as DDPG [ 13 ] and SAC [ 21 ] have enabled successful applications such as quadrupedal locomotion [ 20 ] , self-driving [ 30 ] or dexterous in-hand manipulation [ 20 , 25 , 32 ] . Many of these papers investigate in depth different algorithmic ideas , for example different loss functions and learning paradigms . Yet , it is less visible that behind successful experiments in deep RL there are complicated code bases that contain a large number of low- and high-level design decisions that are usually not discussed in research papers . While one may assume that such “ choices ” do not matter , there is evidence that they are in fact crucial for or even driving good performance [ 27 ] . While there are open-source implementations available that can be used by practitioners , this is still unsatisfactory : Research publications often contain one-to-one comparisons of different algorithmic ideas based on implementations in different code bases . This makes it impossible to assess whether improvements are due to the underlying algorithmic idea or due to the implementation . In fact , it is hard to assess the performance of high-level algorithmic ideas without an understanding of lower-level choices as performance may strongly depend on the tuning of hyperparameters and implementationlevel details . Overall , this makes it hard to attribute progress in reinforcement learning and slows down further research [ 15 , 22 , 27 ] . Our contributions . Our key goal in this paper is to investigate such lower level choices in depth and to understand their impact on final agent performance . Hence , as our key contributions , we ( 1 ) implement > 50 choices in a unified on-policy deep actor-critic implementation1 , ( 2 ) conducted a large-scale ( more than 250 ’ 000 agents trained ) experimental study that covers different aspects of the training process , and ( 3 ) analyze the experimental results to provide practical insights and recommendations for the training of on-policy deep actor-critic RL agents . 1The implementation is available at https : //github.com/google-research/seed_rl . Most surprising finding . While many of our experimental findings confirm common RL practices , some of them are quite surprising , e.g . the policy initialization scheme significantly influences the performance while it is rarely even mentioned in RL publications . In particular , we have found that initializing the network so that the initial action distribution has zero mean , a rather low standard deviation and is independent of the observation significantly improves the training speed ( Sec . 3.2 ) . Paper outline . The rest of of this paper is structured as follows : We describe our experimental setup and performance metrics used in Sec . 2 . Then , in Sec . 3 we present and analyse the experimental results and finish with related work in Sec . 4 and conclusions in Sec . 5 . The appendices contain the detailed description of all design choices we experiment with ( App . B ) , default hyperparameters ( App . C ) and the raw experimental results ( App . D - K ) . 2 STUDY DESIGN . Considered setting . In this paper , we consider the setting of on-policy deep actor-critic reinforcement learning for continuous control . We define on-policy learning in the following loose sense : We consider policy iteration algorithms that iterate between generating experience using the current policy and using that experience to improve the policy . This is the standard modus operandi of algorithms usually considered on-policy such as PPO [ 17 ] . However , we note that algorithms often perform several model updates and thus may operate technically on off-policy data within a single policy improvement iteration . As benchmark environments , we consider five widely used continuous control environments from OpenAI Gym [ 12 ] of varying complexity : Hopper-v1 , Walker2d-v1 , HalfCheetah-v1 , Ant-v1 , and Humanoid-v1 2 . Unified on-policy deep actor-critic gradient algorithm . We took the following approach to create a highly configurable unified on-policy deep actor-critic gradient algorithm with as many choices as possible : 1 . We researched prior work and popular code bases to make a list of commonly used choices , i.e. , different loss functions ( both for value functions and policies ) , architectural choices such as initialization methods , heuristic tricks such as gradient clipping and all their corresponding hyperparameters . 2 . Based on this , we implemented a single , unified on-policy deep actor-critic agent and corresponding training protocol starting from the SEED RL code base [ 28 ] . Whenever we were faced with implementation decisions that required us to take decisions that could not be clearly motivated or had alternative solutions , we further added such decisions as additional choices . 3 . We verified that when all choices are selected as in the PPO implementation from OpenAI baselines , we obtain similar performance as reported in the PPO paper [ 17 ] . We chose PPO because it is probably the most commonly used on-policy deep actor-critic RL algorithm at the moment . The resulting agent implementation is detailed in Appendix B . The key property is that the implementation exposes all choices as configuration options in an unified manner . For convenience , we mark each of the choice in this paper with a number ( e.g. , C1 ) and a fixed name ( e.g . num_envs ( C1 ) ) that can be easily used to find a description of the choice in Appendix B . Difficulty of investigating choices . The primary goal of this paper is to understand how the different choices affect the final performance of an agent and to derive recommendations for these choices . There are two key reasons why this is challenging : First , we are mainly interested in insights on choices for good hyperparameter configurations . Yet , if all choices are sampled randomly , the performance is very bad and little ( if any ) training progress is made . This may be explained by the presence of sub-optimal settings ( e.g. , hyperparameters of the wrong scale ) that prohibit learning at all . If there are many choices , the probability of such failure increases exponentially . 2It has been noticed that the version of the Mujoco physics simulator [ 5 ] can slightly influence the behaviour of some of the environments — https : //github.com/openai/gym/issues/1541 . We used Mujoco 2.0 in our experiments . Second , many choices may have strong interactions with other related choices , for example the learning rate and the minibatch size . This means that such choices need to be tuned together and experiments where only a single choice is varied but interacting choices are kept fixed may lead to misleading conclusions . Basic experimental design . To address these issues , we design a series of experiments as follows : We create groups of choices around thematic groups where we suspect interactions between different choices , for example we group together all choices related to neural network architecture . We also include Adam learning rate ( C24 ) in all of the groups as we suspect that it may interact with many other choices . Then , in each experiment , we train a large number of models where we randomly sample the choices within the corresponding group 3 . All other settings ( for choices not in the group ) are set to settings of a competitive base configuration ( detailed in Appendix C ) that is close to the default PPOv2 configuration4 scaled up to 256 parallel environments . This has two effects : First , it ensures that our set of trained models contains good models ( as verified by performance statistics in the corresponding results ) . Second , it guarantees that we have models that have different combinations of potentially interacting choices . We consider two different analyses for each choice ( e.g , for advantage_estimator ( C6 ) ) : Conditional 95th percentile : For each potential value of that choice ( e.g. , advantage_estimator ( C6 ) = N-Step ) , we look at the performance distribution of sampled configurations with that value . We report the 95th percentile of the performance as well as a confidence interval based on a binomial approximation 5 . Intuitively , this corresponds to a robust estimate of the performance one can expect if all other choices in the group were tuned with random search and a limited budget of roughly 20 hyperparameter configurations . Distribution of choice within top 5 % configurations . We further consider for each choice the distribution of values among the top 5 % configurations trained in that experiment . The reasoning is as follows : By design of the experiment , values for each choice are distributed uniformly at random . Thus , if certain values are over-represented in the top models , this indicates that the specific choice is important in guaranteeing good performance . Performance measures . We employ the following way to compute performance : For each choice configuration , we train 3 models with independent random seeds where each model is trained for one million ( Hopper , HalfCheetah , Walker2d ) or two million environment steps ( Ant , Humanoid ) . We evaluate trained policies every hundred thousand steps by freezing the policy and computing the average undiscounted episode return of 100 episodes ( with the stochastic policy ) . We then average these score to obtain a single performance score of the seed which is proportional to the area under the learning curve . This ensures we assign higher scores to agents that learn quickly . The performance score of a hyperparameter configuration is finally set to the median performance score across the 3 seeds . This reduces the impact of training noise , i.e. , that certain seeds of the same configuration may train much better than others . Robustness of results . While we take 3 random seeds to compute the performance measure for a single choice configuration , it is important to note that all the experimental results reported in this paper are based on more than 3 random seeds : The reported conditional 95th percentile and distribution of choice within top 5 % configurations are computed based upon the performance of hundreds of choice configurations . Furthermore , we also report confidence intervals for the conditional 95th percentile . 3Exact details for the different experiments are provided in Appendices D - K. 4https : //github.com/openai/baselines/blob/master/baselines/ppo2/ defaults.py 5We compute confidence intervals with a significance level of α = 5 % as follows : We find il = icdf ( α 2 ) and ih = icdf ( 1− α 2 ) where icdf is the inverse cumulative density function of a binomial distribution with p = 0.95 ( as we consider the 95th percentile ) and the number of draws equals the number of samples . We then report the ilth and ihth highest scores as the confidence interval . 3 EXPERIMENTS . We run experiments for eight thematic groups : Policy Losses ( Sec . 3.1 ) , Networks architecture ( Sec . 3.2 ) , Normalization and clipping ( Sec . 3.3 ) , Advantage Estimation ( Sec . 3.4 ) , Training setup ( Sec . 3.5 ) , Timesteps handling ( Sec . 3.6 ) , Optimizers ( Sec . 3.7 ) , and Regularization ( Sec . 3.8 ) . For each group , we provide a full experimental design and full experimental plots in Appendices D - K so that the reader can draw their own conclusions from the experimental results . Moreover , the raw data from all training runs and a script used to generate all plots for this paper can be found online6 . In the following sections , we provide short descriptions of the experiments , our interpretation of the results , as well as practical recommendations for agent training for continuous control .
This paper carries out a large-scale study for understanding of on-policy deep actor-critic. The study looks into a large choices of many implementation settings and design decisions, and investigate their impact on the task performance. The evaluations are done with 250000 RL agents on 5 different continuous control tasks. For each evaluation category, there is a finding summary that provides practical recommendations.
SP:41f93461a907d77fc2e0f4f4e3e89a0e7a133736
CIGMO: Learning categorical invariant deep generative models from grouped data
1 INTRODUCTION . In everyday life , we see objects in a great variety . Categories of objects are numerous and their shape variations are tremendously rich ; different views make an object look totally different ( Figure 1 ( A ) ) . Recent neuroscientific studies have revealed how the primate brain organizes representation of complex objects in the higher visual cortex ( Freiwald & Tsao , 2010 ; Srihasam et al. , 2014 ; Bao et al. , 2020 ) . According to these , it comprises multi-stream networks , each of which is specialized to a particular object category , encodes category-specific visual features , and undergoes multiple stages with increasing view invariance . These biological findings inspire us a new form of learning model that has multiple modules of category-specific invariant feature representations . More specifically , our goal is , given an image dataset of general objects , to learn a generative model representing three latent factors : ( 1 ) category ( e.g. , cars , chairs ) , ( 2 ) shape ( e.g. , particular car or chair types ) , and ( 3 ) view ( e.g. , 3D orientation ) . A similar problem has been addressed by recent disentangling models that discover complex factors of input variations in a way invariant to each other ( Tenenbaum & Freeman , 2000 ; Kingma et al. , 2014 ; Chen et al. , 2016 ; Higgins et al. , 2016 ; Bouchacourt et al. , 2018 ; Hosoya , 2019 ) . However , although these models can effectively infer a category or shape factor separately from a view factor , these typically can not capture the structure in general object images that the diversity of shapes is much larger across categories than within a category . In this study , we propose a novel model called CIGMO ( Categorical Invariant Generative MOdel ) , which can learn to represent all the three factors ( category , shape , and view ) at once only with weak supervision . Our model has the form of mixture of deep generative models , where the mixture components correspond to categories and each component model gives a disentangled representation of shape and view for a particular category . We develop a learning algorithm based on variational autoencoders ( VAE ) method ( Kingma & Welling , 2014 ) that does not use explicit labels , but uses only grouping information that links together different views of the same object ( Bouchacourt et al. , 2018 ; Chen et al. , 2018 ; Hosoya , 2019 ) . Using two image datasets of 3D objects ( one derived from ShapeNet ( Chang et al. , 2015 ) ) , we demonstrate that CIGMO can solve multiple unconventional visual tasks on objects that are unseen during training . These include invariant clustering , i.e. , clustering of objects regardless of the view , one-shot classification , i.e. , object recognition given one example per class , and other various feature manipulations using the disentangled representation . Quantitative comparison indicates that our model often outperforms many existing approaches including state-of-the-art methods . Our key contributions are ( 1 ) development of the new deep generative model CIGMO , together with the VAE-based weakly supervised learning algorithm , ( 2 ) experiments of the model on two datasets with quantitative comparisons that show performance advantages over several existing models , and ( 3 ) empirical exposition of the importance of separate representation of category , shape , and view factors in modeling general object images . 2 RELATED WORK . The present work is closely related to recently proposed disentangling models for discovering mutually invariant factors of variation in the input . In one direction , some models have used unsupervised learning with certain constraints on the latent variable , though these seem to be effective only in limited cases ( Higgins et al. , 2016 ; Chen et al. , 2016 ) . Thus , more practical approaches have made use of explicit labels , such as semi-supervised learning for a part of dataset ( Kingma et al. , 2014 ; Siddharth et al. , 2017 ) or adversarial learning to promote disentanglement ( Lample et al. , 2017 ; Mathieu et al. , 2016 ) . However , labels are often expensive . To find out a good compromise , weaker forms of supervision have been investigated . One such direction is group-based learning , which assumes inputs with the same shape to be grouped together ( Bouchacourt et al. , 2018 ; Chen et al. , 2018 ; Hosoya , 2019 ) . In particular , our study here is technically much influenced by Group-based VAE ( GVAE ) ( Hosoya , 2019 ) in the algorithm construction ( Section 3 ) . However , these existing group-based methods are fundamentally limited in that the factors that can be separated are two—a group-common factor ( shape ) and an instance-specific factor ( view ) —and there is no obvious way to extend it to more than two . Thus , our novelty here is to introduce a mixture model comprising multiple GVAE models ( each with shape and view variables ) so that fitting the mixture model to a grouped dataset can give rise to the third factor , categories , as mixture components . In Section 4 , we examine the empirical merits of this technique in several tasks . Note that grouping information can most naturally be found in temporal data ( like videos ) since the object identity is often stable over time , cf . classical temporal coherence principle ( Földiák , 1991 ) . Indeed , some weakly supervised disentangling approaches have explicitly used such temporal structure ( Yang et al. , 2015 ) . Some recent work has used deep nets for clustering of complex object images . The most typical approach is a simple combination of a deep generative model ( e.g. , VAE ) and a conventional clustering method ( e.g. , Gaussian mixture ) , although such approach seems to be limited in capturing large object view variation ( Jiang et al. , 2017 ) . A latest approach proposes a feedforward approach that takes pairs of image data , similarly to ours , and maximizes the mutual information between the categorical posterior probability distributions for such paired image ; this has shown remarkable clustering performance on natural images under various view variation ( Ji et al. , 2019 ) . In Section 4 , we experimentally compare their method with ours . Note , however , that these methods are specialized to clustering and throw away all information other than the category . 3 CIGMO : CATEGORICAL INVARIANT GENERATIVE MODEL . 3.1 MODEL . In our framework , we assume a grouped dataset D = { ( x ( n ) 1 , . . . , x ( n ) K ) | x ( n ) k ∈ R D , n = 1 , . . . , N } ( 1 ) where each data point is a group ( tuple ) ofK data instances ( e.g. , images ) ; we assume independence between groups but not instances within a group . For a data group ( x1 , . . . , xK ) , we consider three types of hidden variables : category c ∈ { 1 , . . . , C } , shape z ∈ RM , and views y1 , . . . , yK ∈ RL ( eliding the superscript ( n ) for brevity ) , where the category and shape are common for the group while the views are specific to each instance . We consider the following generative model ( Figure 1 ( B ) ) : p ( c ) = πc ( 2 ) p ( z ) = NM ( 0 , I ) ( 3 ) p ( yk ) = NL ( 0 , I ) ( 4 ) p ( xk|yk , z , c ) = ND ( fc ( yk , z ) , I ) ( 5 ) for c = 1 , . . . , C and k = 1 , . . . , K. Here , fc is a decoder deep net defined for each category c and πc is a category prior with ∑C c=1 πc = 1 . In the generative process , first , the category c is drawn from the categorical distribution ( π1 , . . . , πC ) , while the shape z and views yk are drawn from standard Gaussian priors . Then , each data instance xk is generated by the decoder deep net fc for category c applied to the group-common shape z and the instance-specific view yk ( added with Gaussian noise of unit variance ) . In other words , the decoder fc generates different data instances in a group from the same shape and different views . Having defined a mixture of deep generative models as above , we expect that , after fitting it to a view-grouped object image dataset , object categories will arise as mixture components and category-specific shapes and views will be represented in each component model . 3.2 LEARNING . We construct a learning algorithm following the VAE approach ( Kingma & Welling , 2014 ) . As the most important step , we specify inference models to encode approximate posterior distributions ( Figure 1 ( C ) ) . First , we estimate the posterior probability for category c as follows : q ( c|x1 , . . . , xK ) = 1 K K∑ k=1 u ( c ) ( xk ) ( 6 ) Here , u is a classifier deep net that takes an individual instance x and outputs a probability distribution over the categories ( ∑C c=1 u ( c ) ( x ) = 1 ) , similarly to ( Kingma et al. , 2014 ) . We then take the average over the instance-specific probability distributions and use it as the group-common distribution . This is a simple approach to make the instance-specific distributions converge to equal values , i.e. , u ( x1 ) ≈ u ( x2 ) . This is an adaptation of a key technique of GVAE used for computing the group-common shape representation ( Hosoya , 2019 ) ; see below . Then , given the estimated category c , we infer each instance-specific view yk from the input xk as follows : q ( yk|xk , c ) = NL ( gc ( xk ) , diag ( rc ( xk ) ) ) ( 7 ) where gc and rc are encoder deep nets that are defined for each category c to specify the mean and variance , respectively . To estimate shape z , we compute the following : q ( z|x1 , . . . , xK , c ) = NM ( 1 K K∑ k=1 hc ( xk ) , 1 K K∑ k=1 diag ( sc ( xk ) ) ) ( 8 ) Here , again , encoder deep nets hc and sc are defined for each category c. These compute the mean and variance , respectively , of the posterior distribution for the individual shape for each instance xk . Then , the group-common shape z is obtained as the average over all the individual shapes . In this way , again , the instance-specific shape representations are expected to converge to an equal value in the course of training , i.e. , hc ( x1 ) ≈ hc ( x2 ) ( Hosoya , 2019 ) . Note that the way the view and shape are inferred here is mostly borrowed from Hosoya ( 2019 ) . For training , we define the following variational lower bound of the marginal log likelihood for a data point : L ( φ ; x1 , . . . , xK ) = Lrecon + LKL ( 9 ) where Lrecon = Eq ( y1 , ... , yK , z , c|x1 , ... , xK ) [ K∑ k=1 log p ( xk|yk , z , c ) ] ( 10 ) LKL = −DKL ( q ( y1 , . . . , yK , z , c|x1 , . . . , xK ) ‖p ( y1 , . . . , yK , z , c ) ) ( 11 ) with the set φ of all weight parameters in the classifier , encoder , and decoder deep nets . We compute the reconstruction term Lrecon as follows : Lrecon = C∑ c=1 q ( c|x1 , . . . , xK ) Eq ( y1 , ... , yK , z|x1 , ... , xK , c ) [ K∑ k=1 log p ( xk|yk , z , c ) ] ( 12 ) ≈ C∑ c=1 q ( c|x1 , . . . , xK ) K∑ k=1 log p ( xk|yk , z , c ) ( 13 ) where we approximate the expectation using one sample z ∼ q ( z|x1 , . . . , xK , c ) and yk ∼ q ( yk|xk , c ) for each k , but directly use the probability value q ( c|x1 , . . . , xK ) for c. The KL term LKL is computed as follows : LKL = −DKL ( q ( c|x1 , . . . , xK ) ‖p ( c ) ) − C∑ c=1 q ( c|x1 , . . . , xK ) K∑ k=1 DKL ( q ( yk|xk , c ) ‖p ( yk ) ) − C∑ c=1 q ( c|x1 , . . . , xK ) DKL ( q ( z|x1 , . . . , xK , c ) ‖p ( z ) ) ( 14 ) Finally , our training procedure is to maximize the lower bound for the entire dataset with respect to the weight parameters : φ̂ = argmaxφ 1 N ∑N n=1 L ( φ ; x ( n ) 1 , . . . , x ( n ) K ) . A diagrammatic outline of the algorithm is given in Figure 2 .
This work proposes a probabilistic model which disentangles view, class and shape attributes explicitly (it does not rely on an emergent phenomena of disentangled factors in the latent space). In comparison to a similar approach, GVAE, CIGMO additionally disentangles the content factor into category and shape factors. Obtained results are reasonable and show advantage of the proposed method over related approaches.
SP:c4eef128786551f4e0ec9f43853df8b59a04f205
CIGMO: Learning categorical invariant deep generative models from grouped data
1 INTRODUCTION . In everyday life , we see objects in a great variety . Categories of objects are numerous and their shape variations are tremendously rich ; different views make an object look totally different ( Figure 1 ( A ) ) . Recent neuroscientific studies have revealed how the primate brain organizes representation of complex objects in the higher visual cortex ( Freiwald & Tsao , 2010 ; Srihasam et al. , 2014 ; Bao et al. , 2020 ) . According to these , it comprises multi-stream networks , each of which is specialized to a particular object category , encodes category-specific visual features , and undergoes multiple stages with increasing view invariance . These biological findings inspire us a new form of learning model that has multiple modules of category-specific invariant feature representations . More specifically , our goal is , given an image dataset of general objects , to learn a generative model representing three latent factors : ( 1 ) category ( e.g. , cars , chairs ) , ( 2 ) shape ( e.g. , particular car or chair types ) , and ( 3 ) view ( e.g. , 3D orientation ) . A similar problem has been addressed by recent disentangling models that discover complex factors of input variations in a way invariant to each other ( Tenenbaum & Freeman , 2000 ; Kingma et al. , 2014 ; Chen et al. , 2016 ; Higgins et al. , 2016 ; Bouchacourt et al. , 2018 ; Hosoya , 2019 ) . However , although these models can effectively infer a category or shape factor separately from a view factor , these typically can not capture the structure in general object images that the diversity of shapes is much larger across categories than within a category . In this study , we propose a novel model called CIGMO ( Categorical Invariant Generative MOdel ) , which can learn to represent all the three factors ( category , shape , and view ) at once only with weak supervision . Our model has the form of mixture of deep generative models , where the mixture components correspond to categories and each component model gives a disentangled representation of shape and view for a particular category . We develop a learning algorithm based on variational autoencoders ( VAE ) method ( Kingma & Welling , 2014 ) that does not use explicit labels , but uses only grouping information that links together different views of the same object ( Bouchacourt et al. , 2018 ; Chen et al. , 2018 ; Hosoya , 2019 ) . Using two image datasets of 3D objects ( one derived from ShapeNet ( Chang et al. , 2015 ) ) , we demonstrate that CIGMO can solve multiple unconventional visual tasks on objects that are unseen during training . These include invariant clustering , i.e. , clustering of objects regardless of the view , one-shot classification , i.e. , object recognition given one example per class , and other various feature manipulations using the disentangled representation . Quantitative comparison indicates that our model often outperforms many existing approaches including state-of-the-art methods . Our key contributions are ( 1 ) development of the new deep generative model CIGMO , together with the VAE-based weakly supervised learning algorithm , ( 2 ) experiments of the model on two datasets with quantitative comparisons that show performance advantages over several existing models , and ( 3 ) empirical exposition of the importance of separate representation of category , shape , and view factors in modeling general object images . 2 RELATED WORK . The present work is closely related to recently proposed disentangling models for discovering mutually invariant factors of variation in the input . In one direction , some models have used unsupervised learning with certain constraints on the latent variable , though these seem to be effective only in limited cases ( Higgins et al. , 2016 ; Chen et al. , 2016 ) . Thus , more practical approaches have made use of explicit labels , such as semi-supervised learning for a part of dataset ( Kingma et al. , 2014 ; Siddharth et al. , 2017 ) or adversarial learning to promote disentanglement ( Lample et al. , 2017 ; Mathieu et al. , 2016 ) . However , labels are often expensive . To find out a good compromise , weaker forms of supervision have been investigated . One such direction is group-based learning , which assumes inputs with the same shape to be grouped together ( Bouchacourt et al. , 2018 ; Chen et al. , 2018 ; Hosoya , 2019 ) . In particular , our study here is technically much influenced by Group-based VAE ( GVAE ) ( Hosoya , 2019 ) in the algorithm construction ( Section 3 ) . However , these existing group-based methods are fundamentally limited in that the factors that can be separated are two—a group-common factor ( shape ) and an instance-specific factor ( view ) —and there is no obvious way to extend it to more than two . Thus , our novelty here is to introduce a mixture model comprising multiple GVAE models ( each with shape and view variables ) so that fitting the mixture model to a grouped dataset can give rise to the third factor , categories , as mixture components . In Section 4 , we examine the empirical merits of this technique in several tasks . Note that grouping information can most naturally be found in temporal data ( like videos ) since the object identity is often stable over time , cf . classical temporal coherence principle ( Földiák , 1991 ) . Indeed , some weakly supervised disentangling approaches have explicitly used such temporal structure ( Yang et al. , 2015 ) . Some recent work has used deep nets for clustering of complex object images . The most typical approach is a simple combination of a deep generative model ( e.g. , VAE ) and a conventional clustering method ( e.g. , Gaussian mixture ) , although such approach seems to be limited in capturing large object view variation ( Jiang et al. , 2017 ) . A latest approach proposes a feedforward approach that takes pairs of image data , similarly to ours , and maximizes the mutual information between the categorical posterior probability distributions for such paired image ; this has shown remarkable clustering performance on natural images under various view variation ( Ji et al. , 2019 ) . In Section 4 , we experimentally compare their method with ours . Note , however , that these methods are specialized to clustering and throw away all information other than the category . 3 CIGMO : CATEGORICAL INVARIANT GENERATIVE MODEL . 3.1 MODEL . In our framework , we assume a grouped dataset D = { ( x ( n ) 1 , . . . , x ( n ) K ) | x ( n ) k ∈ R D , n = 1 , . . . , N } ( 1 ) where each data point is a group ( tuple ) ofK data instances ( e.g. , images ) ; we assume independence between groups but not instances within a group . For a data group ( x1 , . . . , xK ) , we consider three types of hidden variables : category c ∈ { 1 , . . . , C } , shape z ∈ RM , and views y1 , . . . , yK ∈ RL ( eliding the superscript ( n ) for brevity ) , where the category and shape are common for the group while the views are specific to each instance . We consider the following generative model ( Figure 1 ( B ) ) : p ( c ) = πc ( 2 ) p ( z ) = NM ( 0 , I ) ( 3 ) p ( yk ) = NL ( 0 , I ) ( 4 ) p ( xk|yk , z , c ) = ND ( fc ( yk , z ) , I ) ( 5 ) for c = 1 , . . . , C and k = 1 , . . . , K. Here , fc is a decoder deep net defined for each category c and πc is a category prior with ∑C c=1 πc = 1 . In the generative process , first , the category c is drawn from the categorical distribution ( π1 , . . . , πC ) , while the shape z and views yk are drawn from standard Gaussian priors . Then , each data instance xk is generated by the decoder deep net fc for category c applied to the group-common shape z and the instance-specific view yk ( added with Gaussian noise of unit variance ) . In other words , the decoder fc generates different data instances in a group from the same shape and different views . Having defined a mixture of deep generative models as above , we expect that , after fitting it to a view-grouped object image dataset , object categories will arise as mixture components and category-specific shapes and views will be represented in each component model . 3.2 LEARNING . We construct a learning algorithm following the VAE approach ( Kingma & Welling , 2014 ) . As the most important step , we specify inference models to encode approximate posterior distributions ( Figure 1 ( C ) ) . First , we estimate the posterior probability for category c as follows : q ( c|x1 , . . . , xK ) = 1 K K∑ k=1 u ( c ) ( xk ) ( 6 ) Here , u is a classifier deep net that takes an individual instance x and outputs a probability distribution over the categories ( ∑C c=1 u ( c ) ( x ) = 1 ) , similarly to ( Kingma et al. , 2014 ) . We then take the average over the instance-specific probability distributions and use it as the group-common distribution . This is a simple approach to make the instance-specific distributions converge to equal values , i.e. , u ( x1 ) ≈ u ( x2 ) . This is an adaptation of a key technique of GVAE used for computing the group-common shape representation ( Hosoya , 2019 ) ; see below . Then , given the estimated category c , we infer each instance-specific view yk from the input xk as follows : q ( yk|xk , c ) = NL ( gc ( xk ) , diag ( rc ( xk ) ) ) ( 7 ) where gc and rc are encoder deep nets that are defined for each category c to specify the mean and variance , respectively . To estimate shape z , we compute the following : q ( z|x1 , . . . , xK , c ) = NM ( 1 K K∑ k=1 hc ( xk ) , 1 K K∑ k=1 diag ( sc ( xk ) ) ) ( 8 ) Here , again , encoder deep nets hc and sc are defined for each category c. These compute the mean and variance , respectively , of the posterior distribution for the individual shape for each instance xk . Then , the group-common shape z is obtained as the average over all the individual shapes . In this way , again , the instance-specific shape representations are expected to converge to an equal value in the course of training , i.e. , hc ( x1 ) ≈ hc ( x2 ) ( Hosoya , 2019 ) . Note that the way the view and shape are inferred here is mostly borrowed from Hosoya ( 2019 ) . For training , we define the following variational lower bound of the marginal log likelihood for a data point : L ( φ ; x1 , . . . , xK ) = Lrecon + LKL ( 9 ) where Lrecon = Eq ( y1 , ... , yK , z , c|x1 , ... , xK ) [ K∑ k=1 log p ( xk|yk , z , c ) ] ( 10 ) LKL = −DKL ( q ( y1 , . . . , yK , z , c|x1 , . . . , xK ) ‖p ( y1 , . . . , yK , z , c ) ) ( 11 ) with the set φ of all weight parameters in the classifier , encoder , and decoder deep nets . We compute the reconstruction term Lrecon as follows : Lrecon = C∑ c=1 q ( c|x1 , . . . , xK ) Eq ( y1 , ... , yK , z|x1 , ... , xK , c ) [ K∑ k=1 log p ( xk|yk , z , c ) ] ( 12 ) ≈ C∑ c=1 q ( c|x1 , . . . , xK ) K∑ k=1 log p ( xk|yk , z , c ) ( 13 ) where we approximate the expectation using one sample z ∼ q ( z|x1 , . . . , xK , c ) and yk ∼ q ( yk|xk , c ) for each k , but directly use the probability value q ( c|x1 , . . . , xK ) for c. The KL term LKL is computed as follows : LKL = −DKL ( q ( c|x1 , . . . , xK ) ‖p ( c ) ) − C∑ c=1 q ( c|x1 , . . . , xK ) K∑ k=1 DKL ( q ( yk|xk , c ) ‖p ( yk ) ) − C∑ c=1 q ( c|x1 , . . . , xK ) DKL ( q ( z|x1 , . . . , xK , c ) ‖p ( z ) ) ( 14 ) Finally , our training procedure is to maximize the lower bound for the entire dataset with respect to the weight parameters : φ̂ = argmaxφ 1 N ∑N n=1 L ( φ ; x ( n ) 1 , . . . , x ( n ) K ) . A diagrammatic outline of the algorithm is given in Figure 2 .
This paper proposes a categorical invariant generative model (CIGMO) from a set of 2D images that tries to disentangle the factors of data category, intra-category geometry, and rendering viewpoint. CIGMO trains a VAE with a hierarchical graphical model that explicitly factors out the three components by design. Experiments on two datasets (ShapeNet rendered images, MultiPie face images) show that the proposed method can discover the concept of data category without using explicit supervision. It also supports feature manipulation over the geometry and viewpoint factors.
SP:c4eef128786551f4e0ec9f43853df8b59a04f205
A General Computational Framework to Measure the Expressiveness of Complex Networks using a Tight Upper Bound of Linear Regions
1 INTRODUCTION . Deep nerual network ( DNN ) ( LeCun et al. , 2015 ) has obtained great success in many fields such as computer vision , speech recognition and neural language process ( Krizhevsky et al. , 2012 ; Hinton et al. , 2012 ; Devlin et al. , 2018 ; Goodfellow et al. , 2014 ) . However , it has not been completely understood why DNNs can perform well with satisfying generalization on different tasks . Expressiveness is one perspective used to address this open question . More specifically , one can theoretically study expressiveness of DNNs using approximation theory ( Cybenko , 1989 ; Hornik et al. , 1989 ; Hanin , 2019 ; Mhaskar & Poggio , 2016 ; Arora et al. , 2016 ) , or measure the expressiveness of a DNN . While sigmoid or tanh functions are employed as the activation functions in early work of DNNs , rectified linear units ( ReLU ) or other piece-wise linear functions are more popular in nowadays . Yarotsky ( 2017 ) has proved that any DNN with piece-wise linear activation functions can be transformed to a DNN with ReLU . Thus , the study of expressiveness usually focuses on ReLU DNNs . It is known that a ReLU DNN represents a piece-wise linear ( PWL ) function , which can be regarded to have different linear transforms for each region . And with more regions the PWL function is more complex and has stronger expressive ability . Therefore , the number of linear regions is intuitively a meaningful measurement of expressiveness ( Pascanu et al. , 2013 ; Montufar et al. , 2014 ; Raghu et al. , 2017 ; Serra et al. , 2018 ; Hinz & Van de Geer , 2019 ) . A direct measurement of linear regions number is difficult , if not impossible , and thus the upper bound of linear regions number is practically used as a figure of metrics to characterize the expressiveness . Inspired by the computational framework in ( Hinz & Van de Geer , 2019 ) , we improve the upper bound in Serra et al . ( 2018 ) for multilayer perceptrons ( MLPs ) and extend the framework to more complex networks . More importantly , we propose a general approach to construct a more accurate upper bound for almost any type of network . The contributions of this paper are listed as follows . • Through a geometric analysis , we derive a recursive formula for γ , which is a key parameter to construct a tight upper bound . Employing a better initial value , we propose a tighter upper bound for deep fully-connected ReLU networks . In addition , the recursive formula provide a potential to further improve the upper bound given an improved initial value . • Different from Hinz & Van de Geer ( 2019 ) , we not only consider deep fully-connected ReLU networks , but also extend the computational framework to more widely used network architectures , such as skip connections , pooling layers and so on . With the extension , the upper bound of U-Net ( Ronneberger et al. , 2015 ) or other common networks can be computed . By comparing the upper bound of different networks , we show the relation between expressiveness of networks with or without special structures . • Our experiments show that novel network structures enhance the upper bound in most cases . For cases in which the upper bound is almost not enhanced by novel network settings , we explain it by analysing the partition efficiency and the practical number of linear regions . 2 RELATED WORK AND PRELIMINARIES . 2.1 RELATED WORK . There are literature on the linear regions number in the case of ReLU DNNs . Pascanu et al . ( 2013 ) compare the linear regions number of shallow networks by providing a lower bound . Montufar et al . ( 2014 ) give a simple but improved upper bound compared with Pascanu et al . ( 2013 ) . Montúfar ( 2017 ) proposes a even tighter upper bound than Montufar et al . ( 2014 ) . And Raghu et al . ( 2017 ) also prove a similar result which has the same order compared to Montúfar ( 2017 ) . Later , Serra et al . ( 2018 ) propose a tighter upper bound and a method to count the practical number of linear regions . Furthermore , Serra & Ramalingam ( 2018 ) ; Hanin & Rolnick ( 2019a ; b ) explore the properties of the practical number of linear regions . Finally , Hinz & Van de Geer ( 2019 ) employ the form of matrix computation to erect a framework to compute the upper bound , which is a generalization of previous work ( Montufar et al. , 2014 ; Montúfar , 2017 ; Serra et al. , 2018 ) 2.2 NOTATIONS , DEFINITIONS AND PROPERTIES . In this section , we will introduce some definitions and propositions . Since the main computational framework is inspired by Hinz & Van de Geer ( 2019 ) , some notations and definitions are similar . Let us assume a ReLU MLP has the form as follows . f ( x ) = W ( L ) σ ( W ( L−1 ) · · ·σ︸ ︷︷ ︸ ( L−1 ) ( W ( 1 ) x + b ( 1 ) ) · · ·+ b ( L−1 ) ) + b ( L ) ( 1 ) where x ∈ Rn0 , W ( i ) ∈ Rni×ni−1 , b ( i ) ∈ Rni and σ ( x ) = max ( x , 0 ) denoting the ReLU function . W ( i ) is the weights in the ith layer and b ( i ) is the bias vector . f ( x ) can also be written as : h0 ( x ) = x , hi ( x ) = σ ( W ( i ) hi−1 ( x ) + b ( i ) ) , 1 ≤ i < L , ( 2 ) f ( x ) = hL ( x ) = W ( L ) hL−1 ( x ) + b ( L ) ( 3 ) Firstly , we define the linear region in the following way . Definition 1 . For a PWL function f ( x ) : Rn0 → RnL , we define D is a linear region , if D satisfies that : ( a ) D is connected ; ( b ) f is an affine function on D ; ( c ) Any D′ % D , f is not affine on D′ . For a PWL function f , the domain can be partitioned into different linear regions . Let P ( f ) = { Di|Di is a linear region of f , ∀Di 6= Dj , Di ∩ Dj = ∅ } represent all the linear regions of f . We then define the activation pattern of ReLU DNNs as follows . Definition 2 . For any x ∈ Rn0 , we define the activation pattern of x in ith layer shi ( x ) ∈ { 0 , 1 } ni as follows . shi ( x ) j = { 1 , if W ( i ) j , : hi−1 ( x ) + b ( i ) j > 0 0 , if W ( i ) j , : hi−1 ( x ) + b ( i ) j ≤ 0 , for i ∈ { 1 , 2 , . . . , L− 1 } , j ∈ { 1 , 2 , . . . , ni } , where W ( i ) j , : is the j th row of W ( i ) , b ( i ) j is the j th component of b ( i ) . ( Hinz & Van de Geer , 2019 ) For any x , hi ( x ) can be rewritten as hi ( x ) = W ( i ) ( x ) hi−1 ( x ) + b ( i ) ( x ) , where W ( i ) ( x ) is a matrix with some rows of zeros and b ( i ) ( x ) is a vector with some zeros . More precisely , W ( i ) ( x ) j , : = { W ( i ) j , : , if shi ( x ) j = 1 ; 0 , if shi ( x ) j = 0. b ( i ) ( x ) j = { b ( i ) j , if shi ( x ) j = 1 ; 0 , if shi ( x ) j = 0 . ( 4 ) To conveniently represent activation patterns of multi-layer in a MLP , we denote h ( i ) = { h1 , ... , hi } , where hi is defined in Eq.2 , and Sh ( i ) ( x ) = ( sh1 ( x ) , ... , shi ( x ) ) , S ( h ( i ) ) = { Sh ( i ) ( x ) |x ∈ Rn0 } . Given a fixed x , it is easy to prove that hi ( x ) is an affine transform ( i = 1 , 2 , . . . , L ) . Suppose that s ∈ { 0 , 1 } n1 × · · · × { 0 , 1 } nL−1 , h = { h1 , ... , hL−1 } and h ( x ) represents hL−1 ( x ) , if D = { x|Sh ( x ) = s } 6= ∅ , then f is an affine transform in D. And it is easy to prove that there exists a linear region D′ so that D ⊆ D′ . Therefore we have |P ( f ) | ≤ |S ( h ) | . In our computational framework , histogram is a key concept and defined as follows . Definition 3 . Define a histogram v as follows . ( Hinz & Van de Geer , 2019 ) v ∈ V = x ∈ NN| ‖ x‖1 = ∞∑ j=0 xj < ∞ ( 5 ) A histogram is used to represent a discrete distribution of N. For example , the histogram of nonnegative integers G = { 1 , 0 , 1 , 4 , 3 , 2 , 3 , 1 } is ( 1 , 3 , 1 , 2 , 1 ) > . For convenience , let vi = ∑ x∈G 1x=i and the histogram of G is denoted by Hist ( G ) . We can then define an order relation . Definition 4 . For any two histograms v , w , define the order relation as follows . ( Hinz & Van de Geer , 2019 ) v w : ⇔ ∀J ∈ N , ∞∑ j=J vj ≤ ∞∑ j=J wj ( 6 ) It is obvious that any two histograms are not always comparable . But we can define a max operation such that v ( i ) max ( { v ( i ) |i ∈ I } ) where I is an index collection . More precisely : Definition 5 . For a finite index collection I , let VI = { v ( i ) |i ∈ I } , define max operation as follows . max ( VI ) J = maxi∈I ∞∑ j=J v ( i ) j −max i∈I ∞∑ j=J+1 v ( i ) j for J ∈ N ( 7 ) where v ( i ) j is the j th component of the histogram v ( i ) . ( Hinz & Van de Geer , 2019 ) When a region is divided by hyperplanes , the partitioned regions number will be affected by the space dimension which is defined as : Definition 6 . For a connected and convex set D ⊆ Rn , if there exists a set of linear independent vectors { v ( i ) |v ( i ) ∈ Rn , i = 1 , . . . , k , k ≤ n } and a fixed vector c ∈ Rn , s.t . ( a ) any x 6= c ∈ D , x = c + ∑k i=1 aiv ( i ) where { ai } are not all 0 ; ( b ) there exists ai 6= 0 s.t . aiv ( i ) + c ∈ D. Then the space dimension of D is k and denote it as Sd ( D ) = k. The following proposition shows the change of space dimension after an affine transform . Proposition 1 . Suppose D ⊆ Rn is a connected and convex set with space dimension of k ( k ≤ n ) , f is an affine transform with domain of D and can be written as f ( x ) = Ax+b , where A ∈ Rm×n and b ∈ Rm . Then f ( D ) is a connected and convex set and Sd ( f ( D ) ) ≤ min ( k , rank ( A ) ) ( 8 ) The proof of proposition 1 is given in Appendix A.1.1 . Now we can analyze the relationship between the change of space dimension and activation patterns . Let us first consider the 1st layer in an MLP f . W ( 1 ) j , : and b ( 1 ) j construct a hyperplane ( W ( 1 ) j , : x + b ( 1 ) j = 0 ) in Rn0 and this hyperplane divides the whole region of Rn0 into two parts . One part corresponds to successful activation of the jth node in the 1st layer and the other to unsuccessful activation . This can be represented by the jth component of sh1 ( x ) . Therefore all the possible activation pattern sh1 ( x ) is one by one correspondent to the divided regions by n1 hyperplanes of { W ( 1 ) j , : x+b ( 1 ) j = 0 , j = 1 , . . . , n1 } , which are denoted as Hh1 . For any region D divided by Hh1 , we have h1 ( x ) = W ( 1 ) ( x ( 0 ) ) x+b ( 1 ) ( x ( 0 ) ) where x ( 0 ) is any point in D and rank ( W ( 1 ) ( x ( 0 ) ) ) ≤ |s|1 where s is the correspondent activation pattern of D. According to proposition 1 , h1 ( D ) satisfies that Sd ( h1 ( D ) ) ≤ min { n0 , |s|1 } . Similarly , Hh2 divides h1 ( D ) into different parts , and this corresponds to divide D into more sub-regions . In general , every element of S ( h ( i ) ) is correspondent to one of regions that are partitioned by Hh1 , Hh2 , . . . , Hhi . The next two definitions are used to describe the relationship between the change of space dimension and activation patterns . Definition 7 . Define Hsd ( Sh ) as the space dimension histogram of regions partitioned by a ReLU network defined by Eq.1 where h = { h1 , . . . , hL−1 } , i.e . Hsd ( Sh ) = Hist ( { Sd ( h ( D ( s ) ) ) | D ( s ) = { x|Sh ( x ) = s } , s ∈ S ( h ) } ) . ( 9 ) Definition 8 . DefineHd ( Sh ) as the dimension histogram of regions partitioned by a ReLU network defined by Eq.1 where h = { h1 , . . . , hL−1 } , i.e . Hd ( Sh ) = Hist ( { min { n0 , |sh1 |1 , ... , |shL−1 |1 } |s ∈ S ( h ) } ) . ( 10 ) We then have the following proposition . Proposition 2 . Given a ReLU network defined by Eq.1 , let h = { h1 , . . . , hL−1 } , then Hsd ( Sh ) Hd ( Sh ) . The proof of Proposition 2 is given in the Appendix A.1.2 . Proposition 2 shows that space dimension is limited by dimension histogram . This idea is used to compute the upper bound . We can then start to introduce our computational framework . For convenience , we denote RL ( n , n′ ) as one layer of a ReLU MLP with n input nodes and n′ output nodes ( containing one linear transform and one ReLU activation function ) , and define its activation histogram as follows . Definition 9 . Given h ∈ RL ( n , n′ ) , define Ha ( Sh ) as the activation histogram of regions partitioned by h , i.e . Ha ( Sh ) = Hist ( { |s|1 | s ∈ { sh ( x ) | x ∈ R n } } ) . ( 11 ) The activation histogram is similar to the dimension histogram , and it is used to define γ which is a key parameter to construct an upper bound . Definition 10 . If γ′n , n satisfies following conditions : ( a ) ∀n′ ∈ N+ , n ∈ { 0 , . . . , n′ } , max { Ha ( Sh ) |h ∈ RL ( n , n′ ) } γn , n′ ; ( b ) ∀n′ ∈ N+ , n , ñ ∈ { 0 , . . . , n′ } , n ≤ ñ =⇒ γn , n′ γñ , n′ . Then , γn , n′ ( n′ ∈ N+ , n ∈ 1 , ... , n′ ) satisfies the bound condition . ( Hinz & Van de Geer , 2019 ) Here , for h ∈ RL ( 0 , n′ ) , we define H ( Sh ) = e0 = ( 1 , 0 , 0 , . . . ) > . Let Γ be the set of all ( γn , n′ ) n′∈N+ , n∈ { 0 , ... , n′ } that satisfy the bound conditions . When n > n ′ , γn , n′ is defined to be equal to γn′ , n′ since max { Ha ( Sh ) |h ∈ RL ( n , n′ ) } is equal to max { Ha ( Sh ) |h ∈ RL ( n′ , n′ ) } ( Hinz & Van de Geer , 2019 ) . By the definition γn , n′ represents an upper bound of the activation histogram of regions which are derived from n-dimension space partitioned by n′ hyperplanes . According to Proposition 1 , this upper bound is also related to the upper bound of space dimension . Therefore when γn , n′ is tighter the computation of upper bound of linear regions number will be more accurate . The following function is used to describe the relationship between upper bounds of activation histogram and space dimension . Definition 11 . For i∗ ∈ N , define a clipping function cli∗ ( · ) : V → V as follows . ( Hinz & Van de Geer , 2019 ) cli∗ ( v ) i = vi for i < i ∗∑∞ j=i∗ vj for i = i ∗ 0 for i > i∗ ( 12 ) With the definitions and notations above , we can introduce the computational framework to compute the upper bound of linear regions number as follows . Proposition 3 . For a γ ∈ Γ , define the matrix B ( γ ) n′ ∈ N ( n ′+1 ) × ( n′+1 ) as ( B ( γ ) n′ ) i , j = ( clj−1 ( γj−1 , n′ ) ) i−1 , i , j ∈ { 1 , . . . , n ′ + 1 } . Then , the upper bound of linear regions number of an MLP in Eq.1 is∥∥∥B ( γ ) nL−1MnL−2 , nL−1 . . .B ( γ ) n1 Mn0 , n1en0+1∥∥∥ 1 , ( 13 ) where Mn , n′ ∈ R ( n ′+1 ) × ( n+1 ) , ( M ) i , j = δi , min ( j , n′+1 ) . ( Hinz & Van de Geer , 2019 )
This paper extends on the framework of matrix computation in Hinz & Van d Geer (2019) to give a tight upper bound for linear regions. In particular, the paper shows improvement over the bounds derived in Serra et al. 2018 and extends the bounds for more complex networks with skip and residual connections. The paper also shows why skip and residual connections can be beneficial by showing that they lead to networks with larger number of linear regions.
SP:48df1a6af80b29c4c38439bda1d69472ade37f2c
A General Computational Framework to Measure the Expressiveness of Complex Networks using a Tight Upper Bound of Linear Regions
1 INTRODUCTION . Deep nerual network ( DNN ) ( LeCun et al. , 2015 ) has obtained great success in many fields such as computer vision , speech recognition and neural language process ( Krizhevsky et al. , 2012 ; Hinton et al. , 2012 ; Devlin et al. , 2018 ; Goodfellow et al. , 2014 ) . However , it has not been completely understood why DNNs can perform well with satisfying generalization on different tasks . Expressiveness is one perspective used to address this open question . More specifically , one can theoretically study expressiveness of DNNs using approximation theory ( Cybenko , 1989 ; Hornik et al. , 1989 ; Hanin , 2019 ; Mhaskar & Poggio , 2016 ; Arora et al. , 2016 ) , or measure the expressiveness of a DNN . While sigmoid or tanh functions are employed as the activation functions in early work of DNNs , rectified linear units ( ReLU ) or other piece-wise linear functions are more popular in nowadays . Yarotsky ( 2017 ) has proved that any DNN with piece-wise linear activation functions can be transformed to a DNN with ReLU . Thus , the study of expressiveness usually focuses on ReLU DNNs . It is known that a ReLU DNN represents a piece-wise linear ( PWL ) function , which can be regarded to have different linear transforms for each region . And with more regions the PWL function is more complex and has stronger expressive ability . Therefore , the number of linear regions is intuitively a meaningful measurement of expressiveness ( Pascanu et al. , 2013 ; Montufar et al. , 2014 ; Raghu et al. , 2017 ; Serra et al. , 2018 ; Hinz & Van de Geer , 2019 ) . A direct measurement of linear regions number is difficult , if not impossible , and thus the upper bound of linear regions number is practically used as a figure of metrics to characterize the expressiveness . Inspired by the computational framework in ( Hinz & Van de Geer , 2019 ) , we improve the upper bound in Serra et al . ( 2018 ) for multilayer perceptrons ( MLPs ) and extend the framework to more complex networks . More importantly , we propose a general approach to construct a more accurate upper bound for almost any type of network . The contributions of this paper are listed as follows . • Through a geometric analysis , we derive a recursive formula for γ , which is a key parameter to construct a tight upper bound . Employing a better initial value , we propose a tighter upper bound for deep fully-connected ReLU networks . In addition , the recursive formula provide a potential to further improve the upper bound given an improved initial value . • Different from Hinz & Van de Geer ( 2019 ) , we not only consider deep fully-connected ReLU networks , but also extend the computational framework to more widely used network architectures , such as skip connections , pooling layers and so on . With the extension , the upper bound of U-Net ( Ronneberger et al. , 2015 ) or other common networks can be computed . By comparing the upper bound of different networks , we show the relation between expressiveness of networks with or without special structures . • Our experiments show that novel network structures enhance the upper bound in most cases . For cases in which the upper bound is almost not enhanced by novel network settings , we explain it by analysing the partition efficiency and the practical number of linear regions . 2 RELATED WORK AND PRELIMINARIES . 2.1 RELATED WORK . There are literature on the linear regions number in the case of ReLU DNNs . Pascanu et al . ( 2013 ) compare the linear regions number of shallow networks by providing a lower bound . Montufar et al . ( 2014 ) give a simple but improved upper bound compared with Pascanu et al . ( 2013 ) . Montúfar ( 2017 ) proposes a even tighter upper bound than Montufar et al . ( 2014 ) . And Raghu et al . ( 2017 ) also prove a similar result which has the same order compared to Montúfar ( 2017 ) . Later , Serra et al . ( 2018 ) propose a tighter upper bound and a method to count the practical number of linear regions . Furthermore , Serra & Ramalingam ( 2018 ) ; Hanin & Rolnick ( 2019a ; b ) explore the properties of the practical number of linear regions . Finally , Hinz & Van de Geer ( 2019 ) employ the form of matrix computation to erect a framework to compute the upper bound , which is a generalization of previous work ( Montufar et al. , 2014 ; Montúfar , 2017 ; Serra et al. , 2018 ) 2.2 NOTATIONS , DEFINITIONS AND PROPERTIES . In this section , we will introduce some definitions and propositions . Since the main computational framework is inspired by Hinz & Van de Geer ( 2019 ) , some notations and definitions are similar . Let us assume a ReLU MLP has the form as follows . f ( x ) = W ( L ) σ ( W ( L−1 ) · · ·σ︸ ︷︷ ︸ ( L−1 ) ( W ( 1 ) x + b ( 1 ) ) · · ·+ b ( L−1 ) ) + b ( L ) ( 1 ) where x ∈ Rn0 , W ( i ) ∈ Rni×ni−1 , b ( i ) ∈ Rni and σ ( x ) = max ( x , 0 ) denoting the ReLU function . W ( i ) is the weights in the ith layer and b ( i ) is the bias vector . f ( x ) can also be written as : h0 ( x ) = x , hi ( x ) = σ ( W ( i ) hi−1 ( x ) + b ( i ) ) , 1 ≤ i < L , ( 2 ) f ( x ) = hL ( x ) = W ( L ) hL−1 ( x ) + b ( L ) ( 3 ) Firstly , we define the linear region in the following way . Definition 1 . For a PWL function f ( x ) : Rn0 → RnL , we define D is a linear region , if D satisfies that : ( a ) D is connected ; ( b ) f is an affine function on D ; ( c ) Any D′ % D , f is not affine on D′ . For a PWL function f , the domain can be partitioned into different linear regions . Let P ( f ) = { Di|Di is a linear region of f , ∀Di 6= Dj , Di ∩ Dj = ∅ } represent all the linear regions of f . We then define the activation pattern of ReLU DNNs as follows . Definition 2 . For any x ∈ Rn0 , we define the activation pattern of x in ith layer shi ( x ) ∈ { 0 , 1 } ni as follows . shi ( x ) j = { 1 , if W ( i ) j , : hi−1 ( x ) + b ( i ) j > 0 0 , if W ( i ) j , : hi−1 ( x ) + b ( i ) j ≤ 0 , for i ∈ { 1 , 2 , . . . , L− 1 } , j ∈ { 1 , 2 , . . . , ni } , where W ( i ) j , : is the j th row of W ( i ) , b ( i ) j is the j th component of b ( i ) . ( Hinz & Van de Geer , 2019 ) For any x , hi ( x ) can be rewritten as hi ( x ) = W ( i ) ( x ) hi−1 ( x ) + b ( i ) ( x ) , where W ( i ) ( x ) is a matrix with some rows of zeros and b ( i ) ( x ) is a vector with some zeros . More precisely , W ( i ) ( x ) j , : = { W ( i ) j , : , if shi ( x ) j = 1 ; 0 , if shi ( x ) j = 0. b ( i ) ( x ) j = { b ( i ) j , if shi ( x ) j = 1 ; 0 , if shi ( x ) j = 0 . ( 4 ) To conveniently represent activation patterns of multi-layer in a MLP , we denote h ( i ) = { h1 , ... , hi } , where hi is defined in Eq.2 , and Sh ( i ) ( x ) = ( sh1 ( x ) , ... , shi ( x ) ) , S ( h ( i ) ) = { Sh ( i ) ( x ) |x ∈ Rn0 } . Given a fixed x , it is easy to prove that hi ( x ) is an affine transform ( i = 1 , 2 , . . . , L ) . Suppose that s ∈ { 0 , 1 } n1 × · · · × { 0 , 1 } nL−1 , h = { h1 , ... , hL−1 } and h ( x ) represents hL−1 ( x ) , if D = { x|Sh ( x ) = s } 6= ∅ , then f is an affine transform in D. And it is easy to prove that there exists a linear region D′ so that D ⊆ D′ . Therefore we have |P ( f ) | ≤ |S ( h ) | . In our computational framework , histogram is a key concept and defined as follows . Definition 3 . Define a histogram v as follows . ( Hinz & Van de Geer , 2019 ) v ∈ V = x ∈ NN| ‖ x‖1 = ∞∑ j=0 xj < ∞ ( 5 ) A histogram is used to represent a discrete distribution of N. For example , the histogram of nonnegative integers G = { 1 , 0 , 1 , 4 , 3 , 2 , 3 , 1 } is ( 1 , 3 , 1 , 2 , 1 ) > . For convenience , let vi = ∑ x∈G 1x=i and the histogram of G is denoted by Hist ( G ) . We can then define an order relation . Definition 4 . For any two histograms v , w , define the order relation as follows . ( Hinz & Van de Geer , 2019 ) v w : ⇔ ∀J ∈ N , ∞∑ j=J vj ≤ ∞∑ j=J wj ( 6 ) It is obvious that any two histograms are not always comparable . But we can define a max operation such that v ( i ) max ( { v ( i ) |i ∈ I } ) where I is an index collection . More precisely : Definition 5 . For a finite index collection I , let VI = { v ( i ) |i ∈ I } , define max operation as follows . max ( VI ) J = maxi∈I ∞∑ j=J v ( i ) j −max i∈I ∞∑ j=J+1 v ( i ) j for J ∈ N ( 7 ) where v ( i ) j is the j th component of the histogram v ( i ) . ( Hinz & Van de Geer , 2019 ) When a region is divided by hyperplanes , the partitioned regions number will be affected by the space dimension which is defined as : Definition 6 . For a connected and convex set D ⊆ Rn , if there exists a set of linear independent vectors { v ( i ) |v ( i ) ∈ Rn , i = 1 , . . . , k , k ≤ n } and a fixed vector c ∈ Rn , s.t . ( a ) any x 6= c ∈ D , x = c + ∑k i=1 aiv ( i ) where { ai } are not all 0 ; ( b ) there exists ai 6= 0 s.t . aiv ( i ) + c ∈ D. Then the space dimension of D is k and denote it as Sd ( D ) = k. The following proposition shows the change of space dimension after an affine transform . Proposition 1 . Suppose D ⊆ Rn is a connected and convex set with space dimension of k ( k ≤ n ) , f is an affine transform with domain of D and can be written as f ( x ) = Ax+b , where A ∈ Rm×n and b ∈ Rm . Then f ( D ) is a connected and convex set and Sd ( f ( D ) ) ≤ min ( k , rank ( A ) ) ( 8 ) The proof of proposition 1 is given in Appendix A.1.1 . Now we can analyze the relationship between the change of space dimension and activation patterns . Let us first consider the 1st layer in an MLP f . W ( 1 ) j , : and b ( 1 ) j construct a hyperplane ( W ( 1 ) j , : x + b ( 1 ) j = 0 ) in Rn0 and this hyperplane divides the whole region of Rn0 into two parts . One part corresponds to successful activation of the jth node in the 1st layer and the other to unsuccessful activation . This can be represented by the jth component of sh1 ( x ) . Therefore all the possible activation pattern sh1 ( x ) is one by one correspondent to the divided regions by n1 hyperplanes of { W ( 1 ) j , : x+b ( 1 ) j = 0 , j = 1 , . . . , n1 } , which are denoted as Hh1 . For any region D divided by Hh1 , we have h1 ( x ) = W ( 1 ) ( x ( 0 ) ) x+b ( 1 ) ( x ( 0 ) ) where x ( 0 ) is any point in D and rank ( W ( 1 ) ( x ( 0 ) ) ) ≤ |s|1 where s is the correspondent activation pattern of D. According to proposition 1 , h1 ( D ) satisfies that Sd ( h1 ( D ) ) ≤ min { n0 , |s|1 } . Similarly , Hh2 divides h1 ( D ) into different parts , and this corresponds to divide D into more sub-regions . In general , every element of S ( h ( i ) ) is correspondent to one of regions that are partitioned by Hh1 , Hh2 , . . . , Hhi . The next two definitions are used to describe the relationship between the change of space dimension and activation patterns . Definition 7 . Define Hsd ( Sh ) as the space dimension histogram of regions partitioned by a ReLU network defined by Eq.1 where h = { h1 , . . . , hL−1 } , i.e . Hsd ( Sh ) = Hist ( { Sd ( h ( D ( s ) ) ) | D ( s ) = { x|Sh ( x ) = s } , s ∈ S ( h ) } ) . ( 9 ) Definition 8 . DefineHd ( Sh ) as the dimension histogram of regions partitioned by a ReLU network defined by Eq.1 where h = { h1 , . . . , hL−1 } , i.e . Hd ( Sh ) = Hist ( { min { n0 , |sh1 |1 , ... , |shL−1 |1 } |s ∈ S ( h ) } ) . ( 10 ) We then have the following proposition . Proposition 2 . Given a ReLU network defined by Eq.1 , let h = { h1 , . . . , hL−1 } , then Hsd ( Sh ) Hd ( Sh ) . The proof of Proposition 2 is given in the Appendix A.1.2 . Proposition 2 shows that space dimension is limited by dimension histogram . This idea is used to compute the upper bound . We can then start to introduce our computational framework . For convenience , we denote RL ( n , n′ ) as one layer of a ReLU MLP with n input nodes and n′ output nodes ( containing one linear transform and one ReLU activation function ) , and define its activation histogram as follows . Definition 9 . Given h ∈ RL ( n , n′ ) , define Ha ( Sh ) as the activation histogram of regions partitioned by h , i.e . Ha ( Sh ) = Hist ( { |s|1 | s ∈ { sh ( x ) | x ∈ R n } } ) . ( 11 ) The activation histogram is similar to the dimension histogram , and it is used to define γ which is a key parameter to construct an upper bound . Definition 10 . If γ′n , n satisfies following conditions : ( a ) ∀n′ ∈ N+ , n ∈ { 0 , . . . , n′ } , max { Ha ( Sh ) |h ∈ RL ( n , n′ ) } γn , n′ ; ( b ) ∀n′ ∈ N+ , n , ñ ∈ { 0 , . . . , n′ } , n ≤ ñ =⇒ γn , n′ γñ , n′ . Then , γn , n′ ( n′ ∈ N+ , n ∈ 1 , ... , n′ ) satisfies the bound condition . ( Hinz & Van de Geer , 2019 ) Here , for h ∈ RL ( 0 , n′ ) , we define H ( Sh ) = e0 = ( 1 , 0 , 0 , . . . ) > . Let Γ be the set of all ( γn , n′ ) n′∈N+ , n∈ { 0 , ... , n′ } that satisfy the bound conditions . When n > n ′ , γn , n′ is defined to be equal to γn′ , n′ since max { Ha ( Sh ) |h ∈ RL ( n , n′ ) } is equal to max { Ha ( Sh ) |h ∈ RL ( n′ , n′ ) } ( Hinz & Van de Geer , 2019 ) . By the definition γn , n′ represents an upper bound of the activation histogram of regions which are derived from n-dimension space partitioned by n′ hyperplanes . According to Proposition 1 , this upper bound is also related to the upper bound of space dimension . Therefore when γn , n′ is tighter the computation of upper bound of linear regions number will be more accurate . The following function is used to describe the relationship between upper bounds of activation histogram and space dimension . Definition 11 . For i∗ ∈ N , define a clipping function cli∗ ( · ) : V → V as follows . ( Hinz & Van de Geer , 2019 ) cli∗ ( v ) i = vi for i < i ∗∑∞ j=i∗ vj for i = i ∗ 0 for i > i∗ ( 12 ) With the definitions and notations above , we can introduce the computational framework to compute the upper bound of linear regions number as follows . Proposition 3 . For a γ ∈ Γ , define the matrix B ( γ ) n′ ∈ N ( n ′+1 ) × ( n′+1 ) as ( B ( γ ) n′ ) i , j = ( clj−1 ( γj−1 , n′ ) ) i−1 , i , j ∈ { 1 , . . . , n ′ + 1 } . Then , the upper bound of linear regions number of an MLP in Eq.1 is∥∥∥B ( γ ) nL−1MnL−2 , nL−1 . . .B ( γ ) n1 Mn0 , n1en0+1∥∥∥ 1 , ( 13 ) where Mn , n′ ∈ R ( n ′+1 ) × ( n+1 ) , ( M ) i , j = δi , min ( j , n′+1 ) . ( Hinz & Van de Geer , 2019 )
This paper studies the counting of linear regions of a multi-layer ReLU network and gives an upper bound on the number of linear regions that is tighter than existing results. Networks with skip connections and pooling layers are also considered. The authors then compare their bounds for standard multi-layer networks and networks with skip connections/pooling layers and conclude that the latter has certain advantages in expressive power.
SP:48df1a6af80b29c4c38439bda1d69472ade37f2c
NASOA: Towards Faster Task-oriented Online Fine-tuning
1 INTRODUCTION . Fine-tuning using pre-trained models becomes the de-facto standard in the field of computer vision because of its impressive results on various downstream tasks such as fine-grained image classification ( Nilsback & Zisserman , 2008 ; Welinder et al. , 2010 ) , object detection ( He et al. , 2019 ; Jiang et al. , 2018 ; Xu et al. , 2019 ) and segmentation ( Chen et al. , 2017 ; Liu et al. , 2019 ) . Kornblith et al . ( 2019 ) ; He et al . ( 2019 ) verified that fine-tuning pre-trained networks outperform training from scratch . It can further help to avoid over-fitting ( Cui et al. , 2018 ) as well as reduce training time significantly ( He et al. , 2019 ) . Due to those merits , many cloud computing and AutoML pipelines provide fine-tuning services for an online stream of upcoming users with new data , different tasks and time limits . In order to save the user ’ s time , money , energy consumption , or even CO2 emission , an efficient online automated fine-tuning framework is practically useful and in great demand . Thus , in this work , we propose to explore the problem of faster online fine-tuning . The conventional practice of fine-tuning is to adopt a set of predefined hyperparameters for training a predefined model ( Li et al. , 2020 ) . It has three drawbacks in the current online setting : 1 ) The design of the backbone model is not optimized for the upcoming fine-tuning task and the selection of the backbone model is not data-specific . 2 ) A default setting of hyperparameters may not be optimal across tasks and the training settings may not meet the time constraints provided by users . 3 ) With the incoming tasks , the regular diagram is not suitable for this online setting since it can not memorize and accumulate experience from the past fine-tuning tasks . Thus , we propose to decouple our faster fine-tuning problem into two parts : finding efficient fine-tuning networks and generating optimal fine-tuning schedules pertinent to specific time constraints in an online learning fashion . 1The efficient training model zoo ( ET-NAS ) has been released at : https : //github.com/NAS-OA/ NASOA Recently , Neural Architecture Search ( NAS ) algorithms demonstrate promising results on discovering top-accuracy architectures , which surpass the performance of hand-crafted networks and saves human ’ s efforts ( Zoph et al. , 2018 ; Liu et al. , 2018a ; b ; Radosavovic et al. , 2019 ; Tan et al. , 2019b ; Real et al. , 2019a ; Tan & Le , 2019 ; Yao et al. , 2020 ) . However , those NAS works usually focus on inference time/FLOPS optimization and their search space is not flexible enough which can not guarantee the optimality for fast fine-tuning . In contrast , we resort to developing a NAS scheme with a novel flexible search space for fast fine-tuning . On the other hand , hyperparameter optimization ( HPO ) methods such as grid search ( Bergstra & Bengio , 2012 ) , Bayesian optimization ( BO ) ( Strubell et al. , 2019a ; Mendoza et al. , 2016 ) , and BOHB ( Falkner et al. , 2018 ) are used in deep learning and achieve good performance . However , those search-based methods are computationally expensive and require iterative “ trial and error ” , which violate our goal for faster adaptation time . In this work , we propose a novel Neural Architecture Search and Online Adaption framework named NASOA . First , we conduct an offline NAS for generating an efficient fine-tuning model zoo . We design a novel block-level and macro-structure search space to allow a flexible choice of the networks . Once the efficient training model zoo is created offline NAS by Pareto optimal models , the online user can enjoy the benefit of those efficient training networks without any marginal cost . We then propose an online learning algorithm with an adaptive predictor to modeling the relation between different hyperparameter , model , dataset meta-info and the final fine-tuning performance . The final training schedule is generated directly from selecting the fine-tuning regime with the best predicted performance . Benefiting from the experience accumulation via online learning , the diversity of the data and the increasing results can further continuously improve our regime generator . Our method behaves in a one-shot fashion and doesn ’ t involve additional searching cost as HPO , endowing the capability of providing various training regimes under different time constraints . Extensive experiments are conducted on multiple widely used fine-tuning datasets . The searched model zoo ET-NAS is more training efficient than SOTA ImageNet models , e.g . 5x training faster than RegNetY-16GF , and 1.7x faster than EfficientNetB3 . Moreover , by using the whole NASOA , our online algorithm achieves superior fine-tuning results in terms of both accuracy and fine-tuning speed , i.e . improving around 2.1 % accuracy than the best performance in RegNet series under various tasks ; saving 40x computational cost comparing to the BOHB method . In summary , our contributions are summarized as follows : • To the best of our knowledge , we make the first effort to propose a faster fine-tuning pipeline that seamlessly combines the training-efficient NAS and online adaption algorithm . Our NASOA can effectively generate a personalized fine-tuning schedule of each desired task via an adaptive model for accumulating experience from the past tasks . • The proposed novel joint block/macro level search space enables a flexible and efficient search . The resulting model zoo ET-NAS is more training efficient than very strong ImageNet SOTA models e.g . EfficientNet , RegNet . All the ET-NAS models have been released to help the community skipping the computation-heavy NAS stage and directly enjoy the benefit of NASOA . • The whole NASOA pipeline achieves much better fine-tuning results in terms of both accuracy and fine-tuning efficiency than current fine-tuning best practice and HPO method , e.g . BOHB . 2 RELATED WORK . Neural Architecture Search ( NAS ) . The goal of NAS is to automatically optimize network architecture and release human effort from this handcraft network architecture engineering . Most previous works ( Liu et al. , 2018b ; Cai et al. , 2019b ; Liu et al. , 2018a ; Tan et al. , 2019a ; Xie et al. , 2019 ; Howard et al. , 2019 ) aim at searching for CNN architectures with better inference and fewer FLOPS . Baker et al . ( 2017 ) ; Cai et al . ( 2018 ) ; Zhong et al . ( 2018 ) apply reinforcement learning to train an RNN controller to generate a cell architecture . Liu et al . ( 2018b ) ; Xie et al . ( 2019 ) ; Cai et al . ( 2019b ) try to search a cell structure by weight-sharing and differentiable optimization . Tan & Le ( 2019 ) use a grid search for an efficient network by altering the depth/width of the network with a fixed block structure . On the contrary , our NAS focuses creating an efficient training model zoo for fast fine-tuning . Moreover , the existing search space design can not meet the purpose of our search . Generating Hyperparameters for Fine-tuning . HPO methods such as Bayesian optimization ( BO ) ( Strubell et al. , 2019a ; Mendoza et al. , 2016 ) , BOHB ( Falkner et al. , 2018 ) achieves very promising result but require a lot of computational resources which is contradictory to our original objective of efficient fine-tuning . On the other hand , limited works discuss the model selection and HPO for fine-tuning . Kornblith et al . ( 2019 ) finds that ImageNet accuracy and fine-tuning accuracy of different models are highly correlated . Li et al . ( 2020 ) ; Achille et al . ( 2019 ) suggest that the optimal hyperparameters and model for fine-tuning should be both dataset dependent and domain similarity dependent ( Cui et al. , 2018 ) . HyperStar ( Mittal et al. , 2020 ) is a concurrent HPO work demonstrating that a performance predictor can effectively generate good hyper-parameters for a single model . However , those works don ’ t give an explicit solution about how to perform finetuning in a more practical online scenario . In this work , we take the advantage of online learning ( Hoi et al. , 2018 ; Sahoo et al. , 2017 ) to build a schedule generator , which allows us to memorize the past training history and provide up-and-coming training regimes for new coming tasks on the fly . Besides , we introduce the NAS model zoo to further push up the speed and performance . 3 THE PROPOSED APPROACH . The goal of this paper is to develop an online fine-tuning pipeline to facilitate a fast continuous cross-task model adaption . By the preliminary experiments in Section 4.1 , we confirm that the model architectures and hyperparameters such as the learning rate and frozen stages will greatly influence the accuracy and speed of the fine-tuning program . Thus , our NASOA includes two parts as shown in the Figure 1 : 1 ) Searching a group of neural architectures with good accuracy and fast training speed to create a pretrained model zoo ; 2 ) Designing an online task-oriented algorithm to generate an efficient fine-tuning regime with the most suitable model under user ’ s time constraint . 3.1 CREATING AN EFFICIENT TRAINING MODEL ZOO ( ET-NAS ) BY NAS . The commonly used hand-craft backbones for fine-tuning including MobileNet ( Sandler et al. , 2018 ) , ResNet ( He et al. , 2016 ) , and ResNeXt ( Xie et al. , 2017 ) . Recently , some state-of-the-art backbone series such as RegNet ( Radosavovic et al. , 2020 ) , and EfficientNet ( Tan et al. , 2019b ) are developed by automated algorithms for higher accuracy and faster inference speed . However , the objective of our NAS is to find a group of models with good model generalization ability and training speed . Suggested by Kornblith et al . ( 2019 ) , the model fine-tuning accuracy ( model generalization ability ) has a strong correlation between ImageNet accuracy ( r = 0.96 ) . Meanwhile , the training speed can be measured by the step time of each training iteration . Thus , our NAS can be formulated by a multi-objective optimization problem ( MOOP ) on the search space S given by : max A∈S ( acc ( A ) , −Ts ( A ) ) subject to Ts ( A ) ≤ Tm ( 1 ) whereA is the architecture , acc ( . ) is the Top-1 accuracy on ImageNet , Ts ( . ) is the average step time of one iteration , and Tm is the maximum step time allowed . The step time is defined to be the total time of one iteration , including forward/backward propagation , and parameter update . Search Space Design is extremely important ( Radosavovic et al. , 2020 ) . As shown in Figure 2 , to enable an efficient model , we propose a novel flexible joint block-level and macro-level search space to enable simple to complex block design and fine adjustment of the computation allocation on each stage . Unlike existing topological cell-level search space such as DARTS ( Liu et al. , 2018b ) , AmoebaNet ( Real et al. , 2019a ) , and NASBench101 ( Dong & Yang , 2019 ) , ours is more compact and avoids redundant skip-connections which have great memory access cost ( MAC ) . Our block-level search space is more flexible to adjust the width , depth ( for each stage ) , when to down-sample/raise the channels . In contrast , EfficientNet only scales up/down the total width and depth by a fixed allocation ratio , and RegNet can not change the number/type of operations in each block .
In this paper, a joint Neural Architecture Search and Online Adaption (NASOA) framework is proposed to achieve a faster task-oriented fine-tuning upon the request of users. In particular, two main contributions are made in this paper: (1) A fine-tuning pipeline that seamlessly combines the training-efficient NAS and online adaption algorithm is introduced, which can effectively generate a personalized fine-tuning schedule of each desired task via an adaptive model for accumulating experience from the past tasks. (2) A block-level and macro-level search space is introduced in the resulting framework, which enables a simple to complex block design and fine adjustment of the computation allocation on each stage.
SP:4fe317ebc002abdec341b978f730b3dcaa58b9cf
NASOA: Towards Faster Task-oriented Online Fine-tuning
1 INTRODUCTION . Fine-tuning using pre-trained models becomes the de-facto standard in the field of computer vision because of its impressive results on various downstream tasks such as fine-grained image classification ( Nilsback & Zisserman , 2008 ; Welinder et al. , 2010 ) , object detection ( He et al. , 2019 ; Jiang et al. , 2018 ; Xu et al. , 2019 ) and segmentation ( Chen et al. , 2017 ; Liu et al. , 2019 ) . Kornblith et al . ( 2019 ) ; He et al . ( 2019 ) verified that fine-tuning pre-trained networks outperform training from scratch . It can further help to avoid over-fitting ( Cui et al. , 2018 ) as well as reduce training time significantly ( He et al. , 2019 ) . Due to those merits , many cloud computing and AutoML pipelines provide fine-tuning services for an online stream of upcoming users with new data , different tasks and time limits . In order to save the user ’ s time , money , energy consumption , or even CO2 emission , an efficient online automated fine-tuning framework is practically useful and in great demand . Thus , in this work , we propose to explore the problem of faster online fine-tuning . The conventional practice of fine-tuning is to adopt a set of predefined hyperparameters for training a predefined model ( Li et al. , 2020 ) . It has three drawbacks in the current online setting : 1 ) The design of the backbone model is not optimized for the upcoming fine-tuning task and the selection of the backbone model is not data-specific . 2 ) A default setting of hyperparameters may not be optimal across tasks and the training settings may not meet the time constraints provided by users . 3 ) With the incoming tasks , the regular diagram is not suitable for this online setting since it can not memorize and accumulate experience from the past fine-tuning tasks . Thus , we propose to decouple our faster fine-tuning problem into two parts : finding efficient fine-tuning networks and generating optimal fine-tuning schedules pertinent to specific time constraints in an online learning fashion . 1The efficient training model zoo ( ET-NAS ) has been released at : https : //github.com/NAS-OA/ NASOA Recently , Neural Architecture Search ( NAS ) algorithms demonstrate promising results on discovering top-accuracy architectures , which surpass the performance of hand-crafted networks and saves human ’ s efforts ( Zoph et al. , 2018 ; Liu et al. , 2018a ; b ; Radosavovic et al. , 2019 ; Tan et al. , 2019b ; Real et al. , 2019a ; Tan & Le , 2019 ; Yao et al. , 2020 ) . However , those NAS works usually focus on inference time/FLOPS optimization and their search space is not flexible enough which can not guarantee the optimality for fast fine-tuning . In contrast , we resort to developing a NAS scheme with a novel flexible search space for fast fine-tuning . On the other hand , hyperparameter optimization ( HPO ) methods such as grid search ( Bergstra & Bengio , 2012 ) , Bayesian optimization ( BO ) ( Strubell et al. , 2019a ; Mendoza et al. , 2016 ) , and BOHB ( Falkner et al. , 2018 ) are used in deep learning and achieve good performance . However , those search-based methods are computationally expensive and require iterative “ trial and error ” , which violate our goal for faster adaptation time . In this work , we propose a novel Neural Architecture Search and Online Adaption framework named NASOA . First , we conduct an offline NAS for generating an efficient fine-tuning model zoo . We design a novel block-level and macro-structure search space to allow a flexible choice of the networks . Once the efficient training model zoo is created offline NAS by Pareto optimal models , the online user can enjoy the benefit of those efficient training networks without any marginal cost . We then propose an online learning algorithm with an adaptive predictor to modeling the relation between different hyperparameter , model , dataset meta-info and the final fine-tuning performance . The final training schedule is generated directly from selecting the fine-tuning regime with the best predicted performance . Benefiting from the experience accumulation via online learning , the diversity of the data and the increasing results can further continuously improve our regime generator . Our method behaves in a one-shot fashion and doesn ’ t involve additional searching cost as HPO , endowing the capability of providing various training regimes under different time constraints . Extensive experiments are conducted on multiple widely used fine-tuning datasets . The searched model zoo ET-NAS is more training efficient than SOTA ImageNet models , e.g . 5x training faster than RegNetY-16GF , and 1.7x faster than EfficientNetB3 . Moreover , by using the whole NASOA , our online algorithm achieves superior fine-tuning results in terms of both accuracy and fine-tuning speed , i.e . improving around 2.1 % accuracy than the best performance in RegNet series under various tasks ; saving 40x computational cost comparing to the BOHB method . In summary , our contributions are summarized as follows : • To the best of our knowledge , we make the first effort to propose a faster fine-tuning pipeline that seamlessly combines the training-efficient NAS and online adaption algorithm . Our NASOA can effectively generate a personalized fine-tuning schedule of each desired task via an adaptive model for accumulating experience from the past tasks . • The proposed novel joint block/macro level search space enables a flexible and efficient search . The resulting model zoo ET-NAS is more training efficient than very strong ImageNet SOTA models e.g . EfficientNet , RegNet . All the ET-NAS models have been released to help the community skipping the computation-heavy NAS stage and directly enjoy the benefit of NASOA . • The whole NASOA pipeline achieves much better fine-tuning results in terms of both accuracy and fine-tuning efficiency than current fine-tuning best practice and HPO method , e.g . BOHB . 2 RELATED WORK . Neural Architecture Search ( NAS ) . The goal of NAS is to automatically optimize network architecture and release human effort from this handcraft network architecture engineering . Most previous works ( Liu et al. , 2018b ; Cai et al. , 2019b ; Liu et al. , 2018a ; Tan et al. , 2019a ; Xie et al. , 2019 ; Howard et al. , 2019 ) aim at searching for CNN architectures with better inference and fewer FLOPS . Baker et al . ( 2017 ) ; Cai et al . ( 2018 ) ; Zhong et al . ( 2018 ) apply reinforcement learning to train an RNN controller to generate a cell architecture . Liu et al . ( 2018b ) ; Xie et al . ( 2019 ) ; Cai et al . ( 2019b ) try to search a cell structure by weight-sharing and differentiable optimization . Tan & Le ( 2019 ) use a grid search for an efficient network by altering the depth/width of the network with a fixed block structure . On the contrary , our NAS focuses creating an efficient training model zoo for fast fine-tuning . Moreover , the existing search space design can not meet the purpose of our search . Generating Hyperparameters for Fine-tuning . HPO methods such as Bayesian optimization ( BO ) ( Strubell et al. , 2019a ; Mendoza et al. , 2016 ) , BOHB ( Falkner et al. , 2018 ) achieves very promising result but require a lot of computational resources which is contradictory to our original objective of efficient fine-tuning . On the other hand , limited works discuss the model selection and HPO for fine-tuning . Kornblith et al . ( 2019 ) finds that ImageNet accuracy and fine-tuning accuracy of different models are highly correlated . Li et al . ( 2020 ) ; Achille et al . ( 2019 ) suggest that the optimal hyperparameters and model for fine-tuning should be both dataset dependent and domain similarity dependent ( Cui et al. , 2018 ) . HyperStar ( Mittal et al. , 2020 ) is a concurrent HPO work demonstrating that a performance predictor can effectively generate good hyper-parameters for a single model . However , those works don ’ t give an explicit solution about how to perform finetuning in a more practical online scenario . In this work , we take the advantage of online learning ( Hoi et al. , 2018 ; Sahoo et al. , 2017 ) to build a schedule generator , which allows us to memorize the past training history and provide up-and-coming training regimes for new coming tasks on the fly . Besides , we introduce the NAS model zoo to further push up the speed and performance . 3 THE PROPOSED APPROACH . The goal of this paper is to develop an online fine-tuning pipeline to facilitate a fast continuous cross-task model adaption . By the preliminary experiments in Section 4.1 , we confirm that the model architectures and hyperparameters such as the learning rate and frozen stages will greatly influence the accuracy and speed of the fine-tuning program . Thus , our NASOA includes two parts as shown in the Figure 1 : 1 ) Searching a group of neural architectures with good accuracy and fast training speed to create a pretrained model zoo ; 2 ) Designing an online task-oriented algorithm to generate an efficient fine-tuning regime with the most suitable model under user ’ s time constraint . 3.1 CREATING AN EFFICIENT TRAINING MODEL ZOO ( ET-NAS ) BY NAS . The commonly used hand-craft backbones for fine-tuning including MobileNet ( Sandler et al. , 2018 ) , ResNet ( He et al. , 2016 ) , and ResNeXt ( Xie et al. , 2017 ) . Recently , some state-of-the-art backbone series such as RegNet ( Radosavovic et al. , 2020 ) , and EfficientNet ( Tan et al. , 2019b ) are developed by automated algorithms for higher accuracy and faster inference speed . However , the objective of our NAS is to find a group of models with good model generalization ability and training speed . Suggested by Kornblith et al . ( 2019 ) , the model fine-tuning accuracy ( model generalization ability ) has a strong correlation between ImageNet accuracy ( r = 0.96 ) . Meanwhile , the training speed can be measured by the step time of each training iteration . Thus , our NAS can be formulated by a multi-objective optimization problem ( MOOP ) on the search space S given by : max A∈S ( acc ( A ) , −Ts ( A ) ) subject to Ts ( A ) ≤ Tm ( 1 ) whereA is the architecture , acc ( . ) is the Top-1 accuracy on ImageNet , Ts ( . ) is the average step time of one iteration , and Tm is the maximum step time allowed . The step time is defined to be the total time of one iteration , including forward/backward propagation , and parameter update . Search Space Design is extremely important ( Radosavovic et al. , 2020 ) . As shown in Figure 2 , to enable an efficient model , we propose a novel flexible joint block-level and macro-level search space to enable simple to complex block design and fine adjustment of the computation allocation on each stage . Unlike existing topological cell-level search space such as DARTS ( Liu et al. , 2018b ) , AmoebaNet ( Real et al. , 2019a ) , and NASBench101 ( Dong & Yang , 2019 ) , ours is more compact and avoids redundant skip-connections which have great memory access cost ( MAC ) . Our block-level search space is more flexible to adjust the width , depth ( for each stage ) , when to down-sample/raise the channels . In contrast , EfficientNet only scales up/down the total width and depth by a fixed allocation ratio , and RegNet can not change the number/type of operations in each block .
This works aims at task-oriented fine-tuning from pre-trained ImageNet models. It proposes a Neural Architecture Search and Online Adaption framework (NASOA) to perform fast task-oriented model fine-tuning. The NASOA first employ an offline NAS to select a group of models and then pick up the most suitable model from this group via an online schedule generator.
SP:4fe317ebc002abdec341b978f730b3dcaa58b9cf
Solving NP-Hard Problems on Graphs with Extended AlphaGo Zero
1 INTRODUCTION . There is no polynomial-time algorithm found for NP-hard problems [ 7 ] , but they often arise in many real-world optimization tasks . Therefore , a variety of algorithms have been developed in a long history , including approximation algorithms [ 2 , 14 ] , meta-heuristics based on local searches such as simulated annealing and evolutionary computation [ 15 , 10 ] , general-purpose exact solvers such as CPLEX 1 and Gurobi [ 16 ] , and problem-specific exact solvers [ 1 , 25 ] . Recently , machine learning approaches have been actively investigated to solve combinatorial optimization , with the expectation that the combinatorial structure of the problem can be automatically learned without complicated hand-crafted heuristics . In the early stage , many of these approaches focused on solving specific problems [ 17 , 5 ] such as the traveling salesperson problem ( TSP ) . Khalil et al . [ 19 ] proposed a general framework to solve combinatorial problems by a combination of reinforcement learning and graph embedding , which attracted attention for the following two reasons : It does not require any knowledge on graph algorithms other than greedy selection based on network outputs . Furthermore , it learns algorithms without any training dataset . Thanks to these advantages , the framework can be applied to a diverse range of problems over graphs and it also performs much better than previous learning-based approaches . However , we observed poor empirical performance on some graphs having different characteristics ( e.g. , synthetic graphs and real-world graphs ) than random graphs that were used for training , possibly because of the limited exploration space of their Q-learning method . In this paper , to overcome its weakness , we propose a novel solver , named CombOpt Zero . CombOpt Zero is inspired by AlphaGo Zero [ 33 ] , a superhuman engine of Go , which conducts Monte Carlo Tree Search ( MCTS ) to train deep neural networks . AlphaGo Zero was later generalized to AlphaZero [ 34 ] so that it can handle other games ; however , its range of applications is limited to two-player games whose state is win/lose ( or possibly draw ) . We extend AlphaGo Zero to a bunch of combinatorial 1www.cplex.com problems by a simple normalization technique based on random sampling . In the same way as AlphaGo Zero , CombOpt Zero automatically learns a policy network and value network by self-play based on MCTS . We train our networks for five kinds of NP-hard tasks and test on different instances including standard random graphs ( e.g. , the Erdős-Renyi model [ 11 ] and the Barabási-Albert model [ 3 ] ) , benchmark graphs , and real-world graphs . We show that , with only a greedy selection on the policy network , CombOpt Zero has a better generalization to a variety of graphs than the existing method , which indicates that the MCTS-based training strengthens the exploration of various actions . When more computation time is allowed , using the MCTS at test time with the full use of both the policy network and value network significantly improves the performance . Furthermore , we combine our framework with several graph neural network models [ 21 , 39 , 28 ] , and experimentally demonstrate that an appropriate choice of models contributes to improving the performance with a significant margin . 2 BACKGROUND . In this section , we introduce the background which our work is based on . 2.1 MACHINE LEARNING FOR COMBINATORIAL OPTIMIZATION . Machine learning approaches for combinatorial optimization problems have been studied in the literature , starting from Hopfield & Tank [ 17 ] , who applied a variant of neural networks to small instances of Traveling Salesperson Problem ( TSP ) . With the success of deep learning , more and more studies were conducted including Bello et al . [ 5 ] , Kool et al . [ 23 ] for TSP and Wang et al . [ 37 ] for MAXSAT . Khalil et al . [ 19 ] proposed an end-to-end reinforcement learning framework S2V-DQN , which attracted attention because of promising results in a wide range of problems over graphs such as MINIMUMVERTEXCOVER and MAXCUT . Another advantage of this method is that it does not require domain knowledge on specific algorithms or any training dataset . It optimizes a deep Q-network ( DQN ) where the Q-function is approximated by a graph embedding network , called structure2vec ( S2V ) [ 9 ] . The DQN is based on their reinforcement learning formulation , where each action is picking up a node and each state represents the “ sequence of actions ” . In each step , a partial solution S ⊂ V , i.e. , the current state , is expanded by the selected vertex v∗ = argmaxv∈V ( h ( S ) ) Q ( h ( S ) , v ) to ( S , v ∗ ) , where h ( · ) is a fixed function determined by the problem that maps a state to a certain graph , so that the selection of v will not violate the problem constraint . For example , in MAXIMUMINDEPENDENTSET , h ( S ) corresponds to the subgraph of the input graph G = ( V , E ) induced by V \ ( S ∪N ( S ) ) , where N ( S ) is the open neighbors of S. The immediate reward is the change in the objective function . The Q-network , i.e , S2V learns a fixed dimensional embedding for each node . In this work , we mitigate the issue of S2V-DQN ’ s generalization ability . We follow the idea of their reinforcement learning setting , with a different formulation , and replace their Q-learning by a novel learning strategy inspired by AlphaGo Zero . Note that although some studies combine classic heuristic algorithms and learning-based approaches ( using dataset ) to achieve the state-of-the-art performance [ 26 , 12 ] , we stick to learning without domain knowledge and dataset in the same way as S2V-DQN . 2.2 ALPHAGO ZERO . AlphaGo Zero [ 35 ] is a well-known superhuman engine designed for use with the game of Go . It trains a deep neural network fθ with parameter θ by reinforcement learning . Given a state ( game board ) , the network outputs fθ ( s ) = ( p , v ) , where p is the probability vector of each move and v ∈ [ −1 , 1 ] is a scalar denoting the state value . If v is close to 1 , the player who takes a corresponding action from state s is very likely to win . The fundamental idea of AlphaGo Zero is to enhance its own networks by self-play . For this self-play , a special version of Monte Carlo Tree Search ( MCTS ) [ 22 ] , which we describe later , is used . The network is trained in such a way that the policy imitates the enhanced policy by MCTS π , and the value imitates the actual reward from self play z ( i.e . z = 1 if the player wins and z = −1 otherwise ) . More formally , it learns to minimize the loss L = ( z − v ) 2 +CrossEntropy ( p , π ) + creg‖θ‖22 , ( 1 ) where creg is a nonnegative constant for L2 regularization . MCTS is a heuristic search on game trees . In AlphaGo Zero , the search tree is a rooted tree , where each node corresponds to a state and the root is the initial state . Each edge ( s , a ) denotes action a at state s and stores a tuple ( N ( s , a ) , W ( s , a ) , Q ( s , a ) , P ( s , a ) ) , where N ( s , a ) is the visit count , W ( s , a ) and Q ( s , a ) are the total and mean action value respectively , and P ( s , a ) is the prior probability . One iteration of MCTS consists of three parts : select , expand , and backup . First , from the root node , we keep choosing an action that maximizes an upper confidence bound Q ( s , a ) + cpuctP ( s , a ) √∑ a′ N ( s , a ′ ) 1 +N ( s , a ) , ( 2 ) where cpuct is a non-negative constant ( select ) . Once it reaches to unexplored node s , then the edge values are initialized using the network prediction ( p , v ) = fθ ( s ) ( expand ) . After expanding a new node , each visited edge is traversed and its edge values are updated ( backup ) so that Q maintain the mean of state evaluations over simulations : Q ( s , a ) = 1N ( s , a ) ∑ s′|s , a→s′ vs′ , where the sum is taken over those states reached from s after taking action a . After some iterations , the probability vector π is calculated by πa = N ( s0 , a ) 1/τ∑ bN ( s0 , b ) 1/τ for each a ∈ As0 , where τ is a temperature parameter . AlphaGo Zero defeated its previous engine AlphaGo [ 33 ] with 100-0 score without human knowledge , i.e. , the records of the games of professional players and some known techniques in the history of Go . We are motivated to take advantage of the AlphaGo Zero technique in our problem setting since we also aim at training deep neural networks for discrete optimization without domain knowledge . However , we can not directly apply AlphaGo Zero , which was designed for two-player games , to combinatorial optimization problems . Section 3.2 and 3.3 explains how we resolve this issue . 2.3 GRAPH NEURAL NETWORK . A Graph Neural Network ( GNN ) is a neural network that takes graphs as input . Kipf & Welling [ 21 ] proposed the Graph Convolutional Network ( GCN ) inspired by spectral graph convolutions . Because of its scalability , many variants of spatial based GNN were proposed . Many of them can be described as a Message Passing Neural Network ( MPNN ) [ 13 ] . They recursively aggregate neighboring feature vectors to obtain node embeddings that capture the structural information of the input graph . The Graph Isomorphism Network ( GIN ) [ 39 ] is one of the most expressive MPNNs in terms of graph isomorphism . Although they have a good empirical performance , some studies point out the limitation of the representation power of MPNNs [ 39 , 30 ] . Maron et al . [ 27 ] proposed an Invariant Graph Network ( IGN ) using tensor representations of a graph and was shown to be universal [ 29 , 18 ] . Since it requires a high-order tensor in middle layers , which is impractical , Maron et al . [ 28 ] proposed 2-IGN+ , a scalable and powerful model . All of these models , as well as S2V [ 9 ] used in S2V-DQN , are compared in the experiments to test the difference in the performance for combinatorial optimization . The detail of each model is described in Appendix B . 3 METHOD . In this section , we give a detailed explanation of our algorithm to solve combinatorial optimization problems over graphs . First , we introduce our reinforcement learning formulation for NP-hard problems . Then , we explain the basic ideas of our proposed CombOpt Zero in light of the difference between 2-player games and our formulation . Finally , we describe the whole algorithm .
This paper proposes an AlphaGo Zero style algorithm for training policies for solving combinatorial optimization problems. The main idea is to generate training data with MCTS for both a policy network and a value network via self-play. Different graph neural networks (GNNs) are considered as learning models to compare their performances. Empirical evaluations on 5 NP-hard class of problems are provided to demonstrate better performance than an existing RL method S2V-DQN. Comparisons are also provided with CPlex and other approximation algorithms for specific classes of problems.
SP:5c1ba72542bd2c3ebac7e96f88fb48599d725b6b
Solving NP-Hard Problems on Graphs with Extended AlphaGo Zero
1 INTRODUCTION . There is no polynomial-time algorithm found for NP-hard problems [ 7 ] , but they often arise in many real-world optimization tasks . Therefore , a variety of algorithms have been developed in a long history , including approximation algorithms [ 2 , 14 ] , meta-heuristics based on local searches such as simulated annealing and evolutionary computation [ 15 , 10 ] , general-purpose exact solvers such as CPLEX 1 and Gurobi [ 16 ] , and problem-specific exact solvers [ 1 , 25 ] . Recently , machine learning approaches have been actively investigated to solve combinatorial optimization , with the expectation that the combinatorial structure of the problem can be automatically learned without complicated hand-crafted heuristics . In the early stage , many of these approaches focused on solving specific problems [ 17 , 5 ] such as the traveling salesperson problem ( TSP ) . Khalil et al . [ 19 ] proposed a general framework to solve combinatorial problems by a combination of reinforcement learning and graph embedding , which attracted attention for the following two reasons : It does not require any knowledge on graph algorithms other than greedy selection based on network outputs . Furthermore , it learns algorithms without any training dataset . Thanks to these advantages , the framework can be applied to a diverse range of problems over graphs and it also performs much better than previous learning-based approaches . However , we observed poor empirical performance on some graphs having different characteristics ( e.g. , synthetic graphs and real-world graphs ) than random graphs that were used for training , possibly because of the limited exploration space of their Q-learning method . In this paper , to overcome its weakness , we propose a novel solver , named CombOpt Zero . CombOpt Zero is inspired by AlphaGo Zero [ 33 ] , a superhuman engine of Go , which conducts Monte Carlo Tree Search ( MCTS ) to train deep neural networks . AlphaGo Zero was later generalized to AlphaZero [ 34 ] so that it can handle other games ; however , its range of applications is limited to two-player games whose state is win/lose ( or possibly draw ) . We extend AlphaGo Zero to a bunch of combinatorial 1www.cplex.com problems by a simple normalization technique based on random sampling . In the same way as AlphaGo Zero , CombOpt Zero automatically learns a policy network and value network by self-play based on MCTS . We train our networks for five kinds of NP-hard tasks and test on different instances including standard random graphs ( e.g. , the Erdős-Renyi model [ 11 ] and the Barabási-Albert model [ 3 ] ) , benchmark graphs , and real-world graphs . We show that , with only a greedy selection on the policy network , CombOpt Zero has a better generalization to a variety of graphs than the existing method , which indicates that the MCTS-based training strengthens the exploration of various actions . When more computation time is allowed , using the MCTS at test time with the full use of both the policy network and value network significantly improves the performance . Furthermore , we combine our framework with several graph neural network models [ 21 , 39 , 28 ] , and experimentally demonstrate that an appropriate choice of models contributes to improving the performance with a significant margin . 2 BACKGROUND . In this section , we introduce the background which our work is based on . 2.1 MACHINE LEARNING FOR COMBINATORIAL OPTIMIZATION . Machine learning approaches for combinatorial optimization problems have been studied in the literature , starting from Hopfield & Tank [ 17 ] , who applied a variant of neural networks to small instances of Traveling Salesperson Problem ( TSP ) . With the success of deep learning , more and more studies were conducted including Bello et al . [ 5 ] , Kool et al . [ 23 ] for TSP and Wang et al . [ 37 ] for MAXSAT . Khalil et al . [ 19 ] proposed an end-to-end reinforcement learning framework S2V-DQN , which attracted attention because of promising results in a wide range of problems over graphs such as MINIMUMVERTEXCOVER and MAXCUT . Another advantage of this method is that it does not require domain knowledge on specific algorithms or any training dataset . It optimizes a deep Q-network ( DQN ) where the Q-function is approximated by a graph embedding network , called structure2vec ( S2V ) [ 9 ] . The DQN is based on their reinforcement learning formulation , where each action is picking up a node and each state represents the “ sequence of actions ” . In each step , a partial solution S ⊂ V , i.e. , the current state , is expanded by the selected vertex v∗ = argmaxv∈V ( h ( S ) ) Q ( h ( S ) , v ) to ( S , v ∗ ) , where h ( · ) is a fixed function determined by the problem that maps a state to a certain graph , so that the selection of v will not violate the problem constraint . For example , in MAXIMUMINDEPENDENTSET , h ( S ) corresponds to the subgraph of the input graph G = ( V , E ) induced by V \ ( S ∪N ( S ) ) , where N ( S ) is the open neighbors of S. The immediate reward is the change in the objective function . The Q-network , i.e , S2V learns a fixed dimensional embedding for each node . In this work , we mitigate the issue of S2V-DQN ’ s generalization ability . We follow the idea of their reinforcement learning setting , with a different formulation , and replace their Q-learning by a novel learning strategy inspired by AlphaGo Zero . Note that although some studies combine classic heuristic algorithms and learning-based approaches ( using dataset ) to achieve the state-of-the-art performance [ 26 , 12 ] , we stick to learning without domain knowledge and dataset in the same way as S2V-DQN . 2.2 ALPHAGO ZERO . AlphaGo Zero [ 35 ] is a well-known superhuman engine designed for use with the game of Go . It trains a deep neural network fθ with parameter θ by reinforcement learning . Given a state ( game board ) , the network outputs fθ ( s ) = ( p , v ) , where p is the probability vector of each move and v ∈ [ −1 , 1 ] is a scalar denoting the state value . If v is close to 1 , the player who takes a corresponding action from state s is very likely to win . The fundamental idea of AlphaGo Zero is to enhance its own networks by self-play . For this self-play , a special version of Monte Carlo Tree Search ( MCTS ) [ 22 ] , which we describe later , is used . The network is trained in such a way that the policy imitates the enhanced policy by MCTS π , and the value imitates the actual reward from self play z ( i.e . z = 1 if the player wins and z = −1 otherwise ) . More formally , it learns to minimize the loss L = ( z − v ) 2 +CrossEntropy ( p , π ) + creg‖θ‖22 , ( 1 ) where creg is a nonnegative constant for L2 regularization . MCTS is a heuristic search on game trees . In AlphaGo Zero , the search tree is a rooted tree , where each node corresponds to a state and the root is the initial state . Each edge ( s , a ) denotes action a at state s and stores a tuple ( N ( s , a ) , W ( s , a ) , Q ( s , a ) , P ( s , a ) ) , where N ( s , a ) is the visit count , W ( s , a ) and Q ( s , a ) are the total and mean action value respectively , and P ( s , a ) is the prior probability . One iteration of MCTS consists of three parts : select , expand , and backup . First , from the root node , we keep choosing an action that maximizes an upper confidence bound Q ( s , a ) + cpuctP ( s , a ) √∑ a′ N ( s , a ′ ) 1 +N ( s , a ) , ( 2 ) where cpuct is a non-negative constant ( select ) . Once it reaches to unexplored node s , then the edge values are initialized using the network prediction ( p , v ) = fθ ( s ) ( expand ) . After expanding a new node , each visited edge is traversed and its edge values are updated ( backup ) so that Q maintain the mean of state evaluations over simulations : Q ( s , a ) = 1N ( s , a ) ∑ s′|s , a→s′ vs′ , where the sum is taken over those states reached from s after taking action a . After some iterations , the probability vector π is calculated by πa = N ( s0 , a ) 1/τ∑ bN ( s0 , b ) 1/τ for each a ∈ As0 , where τ is a temperature parameter . AlphaGo Zero defeated its previous engine AlphaGo [ 33 ] with 100-0 score without human knowledge , i.e. , the records of the games of professional players and some known techniques in the history of Go . We are motivated to take advantage of the AlphaGo Zero technique in our problem setting since we also aim at training deep neural networks for discrete optimization without domain knowledge . However , we can not directly apply AlphaGo Zero , which was designed for two-player games , to combinatorial optimization problems . Section 3.2 and 3.3 explains how we resolve this issue . 2.3 GRAPH NEURAL NETWORK . A Graph Neural Network ( GNN ) is a neural network that takes graphs as input . Kipf & Welling [ 21 ] proposed the Graph Convolutional Network ( GCN ) inspired by spectral graph convolutions . Because of its scalability , many variants of spatial based GNN were proposed . Many of them can be described as a Message Passing Neural Network ( MPNN ) [ 13 ] . They recursively aggregate neighboring feature vectors to obtain node embeddings that capture the structural information of the input graph . The Graph Isomorphism Network ( GIN ) [ 39 ] is one of the most expressive MPNNs in terms of graph isomorphism . Although they have a good empirical performance , some studies point out the limitation of the representation power of MPNNs [ 39 , 30 ] . Maron et al . [ 27 ] proposed an Invariant Graph Network ( IGN ) using tensor representations of a graph and was shown to be universal [ 29 , 18 ] . Since it requires a high-order tensor in middle layers , which is impractical , Maron et al . [ 28 ] proposed 2-IGN+ , a scalable and powerful model . All of these models , as well as S2V [ 9 ] used in S2V-DQN , are compared in the experiments to test the difference in the performance for combinatorial optimization . The detail of each model is described in Appendix B . 3 METHOD . In this section , we give a detailed explanation of our algorithm to solve combinatorial optimization problems over graphs . First , we introduce our reinforcement learning formulation for NP-hard problems . Then , we explain the basic ideas of our proposed CombOpt Zero in light of the difference between 2-player games and our formulation . Finally , we describe the whole algorithm .
There has been a sequence of recent works on learning heuristics for combinatorial optimization problems on graphs by treating them as Markov decision processes, and learning by reinforcement a good policy. Since the dynamics of these problems can be readily simulated, in this paper, the authors propose to use AlphaZero, a MCTS variant, with a GNN architecture to learn and predict good solutions. They compare against the approach of Khalil et al. (2017), as well as hand-made heuristics, on three benchmark problems (Min Vertex Cover, Max Cut, Max Clique). There are results on Max Independent Set and Min Feedback Vertex Set in the appendix as well.
SP:5c1ba72542bd2c3ebac7e96f88fb48599d725b6b
Witches' Brew: Industrial Scale Data Poisoning via Gradient Matching
1 INTRODUCTION . Machine learning models have quickly become the backbone of many applications from photo processing on mobile devices and ad placement to security and surveillance ( LeCun et al. , 2015 ) . These applications often rely on large training datasets that aggregate samples of unknown origins , and the security implications of this are not yet fully understood ( Papernot , 2018 ) . Data is often sourced in a way that lets malicious outsiders contribute to the dataset , such as scraping images from the web , farming data from website users , or using large academic datasets scraped from social media ( Taigman et al. , 2014 ) . Data Poisoning is a security threat in which an attacker makes imperceptible changes to data that can then be disseminated through social media , user devices , or public datasets without being caught by human supervision . The goal of a poisoning attack is to modify the final model to achieve a malicious goal . In this work we focus on targeted attacks ∗Authors contributed equally . †Authors contributed equally . that achieve mis-classification of some predetermined target data as in Suciu et al . ( 2018 ) ; Shafahi et al . ( 2018 ) , effectively implementing a backdoor that is only triggered for a specific image . Yet , other potential goals of the attacker can include denial-of-service ( Steinhardt et al. , 2017 ; Shen et al. , 2019 ) , concealment of users ( Shan et al. , 2020 ) , or introduction of fingerprint information ( Lukas et al. , 2020 ) . These attacks are applied in scenarios such as social recommendation ( Hu et al. , 2019 ) , content management ( Li et al. , 2016 ; Fang et al. , 2018 ) , algorithmic fairness ( Solans et al. , 2020 ) and biometric recognition ( Lovisotto et al. , 2019 ) . Accordingly , industry practitioners ranked data poisoning as the most serious attack on ML systems in a recent survey of corporations ( Kumar et al. , 2020 ) . We show that efficient poisoned data causing targeted misclassfication can be created even in the setting of deep neural networks trained on large image classification tasks , such as ImageNet ( Russakovsky et al. , 2015 ) . Previous work on targeted data poisoning has often focused on either linear classification tasks ( Biggio et al. , 2012 ; Xiao et al. , 2015 ; Koh et al. , 2018 ) or poisoning of transfer learning and fine tuning ( Shafahi et al. , 2018 ; Koh & Liang , 2017 ) rather than a full end-to-end training pipeline . Attacks on deep neural networks ( and especially on ones trained from scratch ) have proven difficult in Muñoz-González et al . ( 2017 ) and Shafahi et al . ( 2018 ) . Only recently were targeted attacks against neural networks retrained from scratch shown to be possible in Huang et al . ( 2020 ) for CIFAR-10 - however with costs that render scaling to larger datasets , like the ImageNet dataset , prohibitively expensive . We formulate targeted data poisoning as the problem of solving a gradient matching problem and analyze the resulting novel attack algorithm that scales to unprecedented dataset size and effectiveness . Crucially , the new poisoning objective is orders-of-magnitude more efficient than a previous formulation based on on meta-learning ( Huang et al. , 2020 ) and succeeds more often . We conduct an experimental evaluation , showing that poisoned datasets created by this method are robustly compromised and significantly outperform other attacks on CIFAR-10 on the benchmark of Schwarzschild et al . ( 2020 ) . We then demonstrate reliably successful attacks on common ImageNet models in realistic training scenarios . For example , the attack successfully compromises a ResNet-34 by manipulating only 0.1 % of the data points with perturbations less than 8 pixel values in ` ∞-norm . We close by discussing previous defense strategies and how strong differential privacy ( Abadi et al. , 2016 ) is the only existing defense that can partially mitigate the effects of the attack . 2 RELATED WORK . The task of data poisoning is closely related to the problem of adversarial attacks at test time , also referred to as evasion attacks ( Szegedy et al. , 2013 ; Madry et al. , 2017 ) , where the attacker alters a target test image to fool an already-trained model . This attack is applicable in scenarios where the attacker has control over the target image , but not over the training data . In this work we are specifically interested in targeted data poisoning attacks – attacks which aim to cause a specific target test image ( or set of target test images ) to be mis-classified . For example , an attack may cause a certain target image of a otter not part of the training set to be classified as a dog by victim models at test time . This attack is difficult to detect , because it does not noticeably degrade either training or validation accuracy ( Shafahi et al. , 2018 ; Huang et al. , 2020 ) and is effectively invisible until it is triggered . From a security standpoint , these attacks break the integrity of a machine learning model and are as such also called poison integrity attacks in Barreno et al . ( 2010 ) - in contrast to poison availability attacks which reduce validation accuracy in general and are not a focus of this work . In comparison to evasion attacks , targeted data poisoning attacks generally consider a setting where the attacker can modify training data within limits , but can not modify test data and chooses specific target data a-priori . A related intermediary between data poisoning attacks we consider and evasion attacks are backdoor trigger attacks ( Turner et al. , 2018 ; Saha et al. , 2019 ) . These attacks involve inserting a trigger – often an image patch – into training data , which is later activated by also applying the trigger to test images . Backdoor attacks require perturbations to both training and test-time data – the more permissive threat model is a trade-off that allows for unknown target images . Two basic schemes for targeted poisoning are label flipping ( Barreno et al. , 2010 ; Paudice et al. , 2019 ) , and watermarking ( Suciu et al. , 2018 ; Shafahi et al. , 2018 ) . In label flipping attacks , an attacker is allowed to change the label of examples , whereas in a watermarking attack , the attacker perturbs the training image , not label , by superimposing a target image onto training images . These attacks can be successful , yet they are easily detected by supervision such as Papernot & McDaniel ( 2018 ) . This is in contrast to clean-label attacks which maintain the semantic labels of data . Mathematically speaking , data poisoning is a bilevel optimization problem ( Bard & Falk , 1982 ; Biggio et al. , 2012 ) ; the attacker optimizes image pixels to enforce ( malicious ) criteria on the resulting network parameters , which are themselves the solution to an “ inner ” optimization problem that minimizes the training objective . Direct solutions to the bilevel problem of data poisoning have been proposed where feasible , for example , SVMs in Biggio et al . ( 2012 ) or logistic regression in Demontis et al . ( 2019 ) . However , direct optimization of the poisoning objective is intractable for deep neural networks because it requires backpropagating through the entire SGD training procedure , see Muñoz-González et al . ( 2017 ) . As such , the bilevel objective has to be approximated . Recently , MetaPoison ( Huang et al. , 2020 ) proposed to approximately solve the bi-level problem based on methods from the meta-learning community ( Finn et al. , 2017 ) . The bilevel gradient is approximated by backpropagation through several unrolled gradient descent steps . This is the first attack to succeed against deep networks trained from scratch on CIFAR-10 as well as providing transferability to other models . Yet , Huang et al . ( 2020 ) uses a complex loss function averaged over a wide range of models trained to different epochs and a single unrolling step necessarily involves both clean and poisoned data , making it roughly as costly as one epoch of standard training . With an ensemble of 24 models , Huang et al . ( 2020 ) requires 3 ( 2 unrolling steps + 1 clean update step ) x 2 ( backpropagation through unrolled steps ) x 60 ( first-order optimization steps ) x 24 ( ensemble of models ) equivalent epochs of normal training to attack , as well as ( ∑23 k=0 k = 253 ) epochs of pretraining . All in all , this equates to 8893 training epochs . While this can be mitigated by smart caching and parallelization strategies , unrolled ensembles remain costly . In contrast to bilevel approaches stand heuristics for data poisoning of neural networks . The most prominent heuristic is feature collision , as in Poison Frogs ( Shafahi et al. , 2018 ) , which seeks to cause a target test image to be misclassified by perturbing training data to collide with the target image in feature space . Modifications surround the target image in feature space with a convex polytope ( Zhu et al. , 2019 ) or collection of poisons ( Aghakhani et al. , 2020 ) and consider model ensembles ( Zhu et al. , 2019 ) . These methods are efficient , but designed to attack fine-tuning scenarios where the feature extractor is nearly fixed and not influenced by poisoned data . When applied to deep networks trained from scratch , their performance drops significantly . 3 EFFICIENT POISON BREWING . In this section , we will discuss an intriguing weakness of neural network training based on first-order optimization and derive an attack against it . This attack modifies training images that so they produce a malicious gradient signal during training , even while appearing inconspicuous . This is done by matching the gradient of the target images within ` ∞ bounds . Because neural networks are trained by gradient descent , even minor modifications of the gradients can be incorporated into the final model . This attack compounds the strengths of previous schemes , allowing for data poisoning as efficiently as in Poison Frogs ( Shafahi et al. , 2018 ) , requiring only a single pretrained model and a time budget on the order of one epoch of training for optimization - but still capable of poisoning the from-scratch setting considered in Huang et al . ( 2020 ) . This combination allow an attacker to `` brew '' poisons that successfully attack realistic models on ImageNet . 3.1 THREAT MODEL . These discussed components of a clean-label targeted data poisoning attack fit together into the following exemplary threat scenario : Assume a security system that classifies luggage images . An attacker wants this system to classify their particular piece of luggage , the target as safe , but can modify only a small part of the training set . The attacker modifies this subset to be clean-label poisoned . Although the entire training set is validated by a human observer , the small subset of minorly modified images pass cursory inspection and receive their correct label . The security system is trained on secretly compromised data , evaluated on validation data as normal and deployed . Until the target is evaluated and mis-classified as safe , the system appears to be working fine . Formally , we define two parties , the attacker , which has limited control over the training data , and the victim , which trains a model based on this data . We first consider a gray-box setting , where the attacker has knowledge of the model architecture used by their victim . The attacker is permitted to poison a fraction of the training dataset ( usually less than 1 % ) by changing images within an ` ∞-norm ε-bound ( e.g . with ε ≤ 16 ) . This constraint enforces clean-label attacks , meaning that the semantic label of a poisoned image is still unchanged . The attacker has no knowledge of the training procedure - neither about the initialization of the victim ’ s model , nor about the ( randomized ) mini-batching and data augmentation that is standard in the training of deep learning models . We formalize this threat model as bilevel problem for a machine learning model F ( x , θ ) with inputs x ∈ Rn and parameters θ ∈ Rp , and loss function L. We denote the N training samples by ( xi , yi ) N i=1 , from which a subset of P samples are poisoned . For notation simplicity we assume the first P training images are poisoned by adding a perturbation ∆i to the ith training image . The perturbation is constrained to be smaller than ε in the ` ∞-norm . The task is to optimize ∆ so that a set of T target samples ( xti , y t i ) T i=1 is reclassified with the new adversarial labels y adv i : min ∆∈C T∑ i=1 L ( F ( xti , θ ( ∆ ) ) , y adv i ) s.t . θ ( ∆ ) ∈ arg min θ 1 N N∑ i=1 L ( F ( xi + ∆i , θ ) , yi ) . ( 1 ) We subsume the constraints in the set C = { ∆ ∈ RN×n : ||∆||∞ ≤ ε , ∆i = 0 ∀i > P } . We call the main objective on the left the adversarial loss , and the objective that appears in the constraint on the right is the training loss . For the remainder , we consider a single target image ( T = 1 ) as in Shafahi et al . ( 2018 ) , but stress that this is not a general limitation as shown in the appendix .
This paper introduces a novel targeted clean-label poisoning attack, expected to be more efficient and scalable than current ones. The attack is formulated as a bilevel problem which is then solved with a (fast) heuristic approach based on aligning the gradients of the inner and outer objective functions. A theoretical analysis is also reported to show that this strategy consistently finds a descent direction for the outer objective, asymptotically converging to (a local) minimum.
SP:758e3d852e162f93a9984eac06c0b23cd67bc727
Witches' Brew: Industrial Scale Data Poisoning via Gradient Matching
1 INTRODUCTION . Machine learning models have quickly become the backbone of many applications from photo processing on mobile devices and ad placement to security and surveillance ( LeCun et al. , 2015 ) . These applications often rely on large training datasets that aggregate samples of unknown origins , and the security implications of this are not yet fully understood ( Papernot , 2018 ) . Data is often sourced in a way that lets malicious outsiders contribute to the dataset , such as scraping images from the web , farming data from website users , or using large academic datasets scraped from social media ( Taigman et al. , 2014 ) . Data Poisoning is a security threat in which an attacker makes imperceptible changes to data that can then be disseminated through social media , user devices , or public datasets without being caught by human supervision . The goal of a poisoning attack is to modify the final model to achieve a malicious goal . In this work we focus on targeted attacks ∗Authors contributed equally . †Authors contributed equally . that achieve mis-classification of some predetermined target data as in Suciu et al . ( 2018 ) ; Shafahi et al . ( 2018 ) , effectively implementing a backdoor that is only triggered for a specific image . Yet , other potential goals of the attacker can include denial-of-service ( Steinhardt et al. , 2017 ; Shen et al. , 2019 ) , concealment of users ( Shan et al. , 2020 ) , or introduction of fingerprint information ( Lukas et al. , 2020 ) . These attacks are applied in scenarios such as social recommendation ( Hu et al. , 2019 ) , content management ( Li et al. , 2016 ; Fang et al. , 2018 ) , algorithmic fairness ( Solans et al. , 2020 ) and biometric recognition ( Lovisotto et al. , 2019 ) . Accordingly , industry practitioners ranked data poisoning as the most serious attack on ML systems in a recent survey of corporations ( Kumar et al. , 2020 ) . We show that efficient poisoned data causing targeted misclassfication can be created even in the setting of deep neural networks trained on large image classification tasks , such as ImageNet ( Russakovsky et al. , 2015 ) . Previous work on targeted data poisoning has often focused on either linear classification tasks ( Biggio et al. , 2012 ; Xiao et al. , 2015 ; Koh et al. , 2018 ) or poisoning of transfer learning and fine tuning ( Shafahi et al. , 2018 ; Koh & Liang , 2017 ) rather than a full end-to-end training pipeline . Attacks on deep neural networks ( and especially on ones trained from scratch ) have proven difficult in Muñoz-González et al . ( 2017 ) and Shafahi et al . ( 2018 ) . Only recently were targeted attacks against neural networks retrained from scratch shown to be possible in Huang et al . ( 2020 ) for CIFAR-10 - however with costs that render scaling to larger datasets , like the ImageNet dataset , prohibitively expensive . We formulate targeted data poisoning as the problem of solving a gradient matching problem and analyze the resulting novel attack algorithm that scales to unprecedented dataset size and effectiveness . Crucially , the new poisoning objective is orders-of-magnitude more efficient than a previous formulation based on on meta-learning ( Huang et al. , 2020 ) and succeeds more often . We conduct an experimental evaluation , showing that poisoned datasets created by this method are robustly compromised and significantly outperform other attacks on CIFAR-10 on the benchmark of Schwarzschild et al . ( 2020 ) . We then demonstrate reliably successful attacks on common ImageNet models in realistic training scenarios . For example , the attack successfully compromises a ResNet-34 by manipulating only 0.1 % of the data points with perturbations less than 8 pixel values in ` ∞-norm . We close by discussing previous defense strategies and how strong differential privacy ( Abadi et al. , 2016 ) is the only existing defense that can partially mitigate the effects of the attack . 2 RELATED WORK . The task of data poisoning is closely related to the problem of adversarial attacks at test time , also referred to as evasion attacks ( Szegedy et al. , 2013 ; Madry et al. , 2017 ) , where the attacker alters a target test image to fool an already-trained model . This attack is applicable in scenarios where the attacker has control over the target image , but not over the training data . In this work we are specifically interested in targeted data poisoning attacks – attacks which aim to cause a specific target test image ( or set of target test images ) to be mis-classified . For example , an attack may cause a certain target image of a otter not part of the training set to be classified as a dog by victim models at test time . This attack is difficult to detect , because it does not noticeably degrade either training or validation accuracy ( Shafahi et al. , 2018 ; Huang et al. , 2020 ) and is effectively invisible until it is triggered . From a security standpoint , these attacks break the integrity of a machine learning model and are as such also called poison integrity attacks in Barreno et al . ( 2010 ) - in contrast to poison availability attacks which reduce validation accuracy in general and are not a focus of this work . In comparison to evasion attacks , targeted data poisoning attacks generally consider a setting where the attacker can modify training data within limits , but can not modify test data and chooses specific target data a-priori . A related intermediary between data poisoning attacks we consider and evasion attacks are backdoor trigger attacks ( Turner et al. , 2018 ; Saha et al. , 2019 ) . These attacks involve inserting a trigger – often an image patch – into training data , which is later activated by also applying the trigger to test images . Backdoor attacks require perturbations to both training and test-time data – the more permissive threat model is a trade-off that allows for unknown target images . Two basic schemes for targeted poisoning are label flipping ( Barreno et al. , 2010 ; Paudice et al. , 2019 ) , and watermarking ( Suciu et al. , 2018 ; Shafahi et al. , 2018 ) . In label flipping attacks , an attacker is allowed to change the label of examples , whereas in a watermarking attack , the attacker perturbs the training image , not label , by superimposing a target image onto training images . These attacks can be successful , yet they are easily detected by supervision such as Papernot & McDaniel ( 2018 ) . This is in contrast to clean-label attacks which maintain the semantic labels of data . Mathematically speaking , data poisoning is a bilevel optimization problem ( Bard & Falk , 1982 ; Biggio et al. , 2012 ) ; the attacker optimizes image pixels to enforce ( malicious ) criteria on the resulting network parameters , which are themselves the solution to an “ inner ” optimization problem that minimizes the training objective . Direct solutions to the bilevel problem of data poisoning have been proposed where feasible , for example , SVMs in Biggio et al . ( 2012 ) or logistic regression in Demontis et al . ( 2019 ) . However , direct optimization of the poisoning objective is intractable for deep neural networks because it requires backpropagating through the entire SGD training procedure , see Muñoz-González et al . ( 2017 ) . As such , the bilevel objective has to be approximated . Recently , MetaPoison ( Huang et al. , 2020 ) proposed to approximately solve the bi-level problem based on methods from the meta-learning community ( Finn et al. , 2017 ) . The bilevel gradient is approximated by backpropagation through several unrolled gradient descent steps . This is the first attack to succeed against deep networks trained from scratch on CIFAR-10 as well as providing transferability to other models . Yet , Huang et al . ( 2020 ) uses a complex loss function averaged over a wide range of models trained to different epochs and a single unrolling step necessarily involves both clean and poisoned data , making it roughly as costly as one epoch of standard training . With an ensemble of 24 models , Huang et al . ( 2020 ) requires 3 ( 2 unrolling steps + 1 clean update step ) x 2 ( backpropagation through unrolled steps ) x 60 ( first-order optimization steps ) x 24 ( ensemble of models ) equivalent epochs of normal training to attack , as well as ( ∑23 k=0 k = 253 ) epochs of pretraining . All in all , this equates to 8893 training epochs . While this can be mitigated by smart caching and parallelization strategies , unrolled ensembles remain costly . In contrast to bilevel approaches stand heuristics for data poisoning of neural networks . The most prominent heuristic is feature collision , as in Poison Frogs ( Shafahi et al. , 2018 ) , which seeks to cause a target test image to be misclassified by perturbing training data to collide with the target image in feature space . Modifications surround the target image in feature space with a convex polytope ( Zhu et al. , 2019 ) or collection of poisons ( Aghakhani et al. , 2020 ) and consider model ensembles ( Zhu et al. , 2019 ) . These methods are efficient , but designed to attack fine-tuning scenarios where the feature extractor is nearly fixed and not influenced by poisoned data . When applied to deep networks trained from scratch , their performance drops significantly . 3 EFFICIENT POISON BREWING . In this section , we will discuss an intriguing weakness of neural network training based on first-order optimization and derive an attack against it . This attack modifies training images that so they produce a malicious gradient signal during training , even while appearing inconspicuous . This is done by matching the gradient of the target images within ` ∞ bounds . Because neural networks are trained by gradient descent , even minor modifications of the gradients can be incorporated into the final model . This attack compounds the strengths of previous schemes , allowing for data poisoning as efficiently as in Poison Frogs ( Shafahi et al. , 2018 ) , requiring only a single pretrained model and a time budget on the order of one epoch of training for optimization - but still capable of poisoning the from-scratch setting considered in Huang et al . ( 2020 ) . This combination allow an attacker to `` brew '' poisons that successfully attack realistic models on ImageNet . 3.1 THREAT MODEL . These discussed components of a clean-label targeted data poisoning attack fit together into the following exemplary threat scenario : Assume a security system that classifies luggage images . An attacker wants this system to classify their particular piece of luggage , the target as safe , but can modify only a small part of the training set . The attacker modifies this subset to be clean-label poisoned . Although the entire training set is validated by a human observer , the small subset of minorly modified images pass cursory inspection and receive their correct label . The security system is trained on secretly compromised data , evaluated on validation data as normal and deployed . Until the target is evaluated and mis-classified as safe , the system appears to be working fine . Formally , we define two parties , the attacker , which has limited control over the training data , and the victim , which trains a model based on this data . We first consider a gray-box setting , where the attacker has knowledge of the model architecture used by their victim . The attacker is permitted to poison a fraction of the training dataset ( usually less than 1 % ) by changing images within an ` ∞-norm ε-bound ( e.g . with ε ≤ 16 ) . This constraint enforces clean-label attacks , meaning that the semantic label of a poisoned image is still unchanged . The attacker has no knowledge of the training procedure - neither about the initialization of the victim ’ s model , nor about the ( randomized ) mini-batching and data augmentation that is standard in the training of deep learning models . We formalize this threat model as bilevel problem for a machine learning model F ( x , θ ) with inputs x ∈ Rn and parameters θ ∈ Rp , and loss function L. We denote the N training samples by ( xi , yi ) N i=1 , from which a subset of P samples are poisoned . For notation simplicity we assume the first P training images are poisoned by adding a perturbation ∆i to the ith training image . The perturbation is constrained to be smaller than ε in the ` ∞-norm . The task is to optimize ∆ so that a set of T target samples ( xti , y t i ) T i=1 is reclassified with the new adversarial labels y adv i : min ∆∈C T∑ i=1 L ( F ( xti , θ ( ∆ ) ) , y adv i ) s.t . θ ( ∆ ) ∈ arg min θ 1 N N∑ i=1 L ( F ( xi + ∆i , θ ) , yi ) . ( 1 ) We subsume the constraints in the set C = { ∆ ∈ RN×n : ||∆||∞ ≤ ε , ∆i = 0 ∀i > P } . We call the main objective on the left the adversarial loss , and the objective that appears in the constraint on the right is the training loss . For the remainder , we consider a single target image ( T = 1 ) as in Shafahi et al . ( 2018 ) , but stress that this is not a general limitation as shown in the appendix .
This paper proposed a simple yet effective approach for data poisoning attack targeting a few "clean-label" victim images, using the idea of gradient matching (cosine similarity maximization) between the gradients of adversarial and clean losses. Although the attack model still requires knowing the network architecture (gray-box setting), the resulting poisoned datasets are more effective against different initializations, and some techniques (e.g. model ensemble, multiple restarts) are proposed to further boost the attack performance. The attack results are significantly better than the compared poisoning attacks, and the authors show effective attacks on the ImageNet dataset as well as Google Cloud AutoML with the poisoned data. The authors also discussed the proposed attack on some defenses, showing that the poison has limited change to feature distribution, and differential privacy can mitigate the attack but at the cost of reduced utility (clean accuracy).
SP:758e3d852e162f93a9984eac06c0b23cd67bc727
A Policy Gradient Algorithm for Learning to Learn in Multiagent Reinforcement Learning
1 INTRODUCTION . Learning in multiagent settings is inherently more difficult than single-agent learning because an agent interacts both with the environment and other agents ( Buşoniu et al. , 2010 ) . Specifically , the fundamental challenge in multiagent reinforcement learning ( MARL ) is the difficulty of learning optimal policies in the presence of other simultaneously learning agents because their changing behaviors jointly affect the environment ’ s transition and reward function . This dependence on nonstationary policies renders the Markov property invalid from the perspective of each agent , requiring agents to adapt their behaviors with respect to potentially large , unpredictable , and endless changes in the policies of fellow agents ( Papoudakis et al. , 2019 ) . In such environments , it is also critical that agents adapt to the changing behaviors of others in a very sample-efficient manner as it is likely that their policy could update again after a small number of interactions ( Al-Shedivat et al. , 2018 ) . Therefore , effective agents should consider the learning of other agents and adapt quickly to non-stationary behaviors . Otherwise , undesirable outcomes may arise when an agent is constantly lagging in its ability to deal with the current policies of other agents . In this paper , we propose a new framework based on meta-learning for addressing the inherent non-stationarity of MARL . Meta-learning ( also referred to as learning to learn ) was recently shown to be a promising methodology for fast adaptation in multiagent settings . The framework by Al-Shedivat et al . ( 2018 ) , for example , introduces a meta-optimization scheme by which a meta-agent can adapt more efficiently to changes in a new opponent ’ s policy after collecting only a handful of interactions . The key idea underlying their meta-optimization is to model the meta-agent ’ s learning process so that its updated policy performs better than an evolving opponent . However , their work does not directly consider the opponent ’ s learning process in the meta-optimization , treating the evolving opponent as an external factor and assuming the meta-agent can not influence the opponent ’ s future policy . As a result , their work fails to consider an important property of MARL : the opponent is also a learning agent changing its policy based on trajectories collected by interacting with the meta-agent . As such , the meta-agent has an opportunity to influence the opponent ’ s future policy by changing the distribution of trajectories , and the meta-agent can take advantage of this opportunity to improve its performance during learning . Our contribution . With this insight , we develop a new meta-multiagent policy gradient theorem ( Meta-MAPG ) that directly models the learning processes of all agents in the environment within a single objective function . We start by extending the meta-policy gradient theorem of Al-Shedivat et al . ( 2018 ) based on the multiagent stochastic policy gradient theorem ( Wei et al. , 2018 ) to derive a novel meta-policy gradient theorem . This is achieved by removing the unrealistic implicit assumption of Al-Shedivat et al . ( 2018 ) that the learning of other agents in the environment is not dependent on an agent ’ s own behavior . Interestingly , performing our derivation with this more general set of assumptions inherently results in an additional term that was not present in previous work by Al-Shedivat et al . ( 2018 ) . We observe that this added term is closely related to the process of shaping the learning dynamics of other agents in the framework of Foerster et al . ( 2018a ) . As such , our work can be seen as contributing a theoretically grounded framework that unifies the collective benefits of previous work by Al-Shedivat et al . ( 2018 ) and Foerster et al . ( 2018a ) . Meta-MAPG is evaluated on a diverse suite of multiagent domains , including the full spectrum of mixed incentive , competitive , and cooperative environments . Our experiments demonstrate that Meta-MAPG consistently results in superior adaption performance in the presence of novel evolving agents . 2 PRELIMINARIES . Interactions between multiple agents can be represented by stochastic games ( Shapley , 1953 ) . Specifically , an n-agent stochastic game is defined as a tupleMn=〈I , S , A , P , R , γ〉 ; I= { 1 , . . . , n } is the set of n agents , S is the set of states , A=×i∈IAi is the set of action spaces , P : S ×A 7→ S is the state transition probability function , R=×i∈IRi is the set of reward functions , and γ ∈ [ 0 , 1 ) is the discount factor . We typeset sets in bold for clarity . Each agent i executes an action at each timestep t according to its stochastic policy ait∼πi ( ait|st , φi ) parameterized by φi , where st ∈S . A joint action at= { ait , a−it } yields a transition from the current state st to the next state st+1∈S with probability P ( st+1|st , at ) , where the notation−i indicates all other agents with the exception of agent i . Agent i then obtains a reward according to its reward function rit = Ri ( st , at ) . At the end of an episode , the agents collect a trajectory τφ under the joint policy with parameters φ , where τφ : = ( s0 , a0 , r0 , . . . , rH ) , φ= { φi , φ−i } represents the joint parameters of all policies , rt= { rit , r−it } is the joint reward , and H is the horizon of the trajectory or episode . 2.1 A MARKOV CHAIN OF POLICIES . The perceived non-stationarity in multiagent settings results from a distribution of sequential joint policies , which can be represented by a Markov chain ( Al-Shedivat et al. , 2018 ) . Formally , a Markov chain of policies begins from a stochastic game between agents with an initial set of joint policies parameterized by φ0 . We assume that each agent updates its policy leveraging a Markovian update function that changes the policy after every K trajectories . After this time period , each agent i adapts its policy to maximize the expected return expressed as its value function : V iφ0 ( s0 ) = Eτφ0∼p ( τφ0 |φi0 , φ−i0 ) [ H∑ t=0 γtrit|s0 ] = E τφ0∼p ( τφ0 |φ i 0 , φ −i 0 ) [ Gi ( τφ0 ) ] , ( 1 ) where Gi denotes agent i ’ s discounted return from the beginning of an episode with initial state s0 . The joint policy update results in a transition from φ0 to the updated set of joint parameters φ1 . The Markov chain continues for a maximum chain length of L ( see Figure 1a ) . This Markov chain perspective highlights the following inherent aspects of the experienced non-stationarity : Sequential dependency . The future joint policy parameters φ1 : L = { φ1 , . . . , φL } sequentially depend on φ0 since a change in τφ0 results in a change in φ1 , which in turn affects τφ1 and all successive joint policy updates up to φL . Controllable levels of non-stationarity . As in Al-Shedivat et al . ( 2018 ) and Foerster et al . ( 2018a ) , we assume stationary policies during the collection of K trajectories , and that the joint policy update happens afterward . In such a setting , it is possible to control the non-stationarity by adjusting the K and H hyperparameters : smaller K and H increase the rate that agents change their policies , leading to a higher degree of non-stationarity in the environment . In the limit of K =H = 1 , all agents change their policy every step . 3 LEARNING TO LEARN IN MULTIAGENT REINFORCEMENT LEARNING . This section explores learning policies that can adapt quickly to non-stationarity in the policies of other agents in the environment . To achieve this , we leverage meta-learning and devise a new meta-multiagent policy gradient theorem that exploits the inherent sequential dependencies of MARL discussed in the previous section . Specifically , our meta-agent addresses this non-stationarity by considering its current policy ’ s impact on its own adapted policies while actively influencing the future policies of other agents as well by inducing changes to the distribution of trajectories . In this section , we first outline the meta-optimization process in MARL and then discuss how the meta-policy gradient theorem of Al-Shedivat et al . ( 2018 ) optimizes for this objective while ignoring the dependence of the future policy of other agents on our current policy . Finally , we derive a new extension of this policy gradient theorem that explicitly leverages this dependence and discuss how to interpret the impact of the resulting form of the gradient . 3.1 GRADIENT BASED META-OPTIMIZATION IN MULTIAGENT REINFORCEMENT LEARNING . We formalize the meta-objective of MARL as optimizing meta-agent i ’ s initial policy parameters φi0 so that it maximizes the expected adaptation performance over a Markov chain of policies drawn from a stationary initial distribution of policies for the other agents p ( φ−i0 ) : max φi0 E p ( φ −i 0 ) [ L−1∑̀ =0 V iφ0 : ` +1 ( s0 , φ i 0 ) ] , ( 2 ) s.t . V iφ0 : ` +1 ( s0 , φ i 0 ) = Eτφ0 : ` ∼p ( τφ0 : ` |φi0 : ` , φ−i0 : ` ) [ E τφ ` +1∼p ( τφ ` +1 |φ i ` +1 , φ −i ` +1 ) [ Gi ( τφ ` +1 ) ] ] ( 3 ) where τφ0 : ` = { τφ0 , . . . , τφ ` } , and V iφ0 : ` +1 ( s0 , φi0 ) denotes the meta-value function . This meta-value function generalizes the notion of each agent ’ s primitive value function for the current set of policies V iφ0 ( s0 ) over the length of the Markov chain of policies . In this work , as in Al-Shedivat et al . ( 2018 ) , we follow the MAML ( Finn et al. , 2017 ) meta-learning framework . As such , we assume that the Markov chain of policies is governed by a policy gradient update function that corresponds to what is generally referred to as the inner-loop optimization in the meta-learning literature : φi ` +1 : = φ i ` + α i∇φi ` Eτφ ` ∼p ( τφ ` |φi ` , φ−i ` ) [ Gi ( τφ ` ) ] , φ−i ` +1 : = φ −i ` +α −i∇ φ −i ` E τφ ` ∼p ( τφ ` |φ i ` , φ −i ` ) [ G−i ( τφ ` ) ] , ( 4 ) where αi and α−i denote the learning rates used by each agent in the environment . 3.2 THE META-POLICY GRADIENT THEOREM . Intuitively , if we optimize the meta-value function , we are searching for initial parameters φi0 such that successive inner-loop optimization steps with Equation ( 4 ) results in adapted parameters φi ` +1 that can perform better than the updated policies of other agents with policy parameters φ−i ` +1 ( see Figure 1b ) . Algorithm 1 Meta-Learning at Training Time Require : p ( φ−i0 ) : Distribution over other agents ’ initial policies ; α , β : Learning rates 1 : Randomly initialize φi0 2 : while φi0 has not converged do 3 : Sample a meta-train batch of φ−i0 ∼ p ( φ −i 0 ) 4 : for each φ−i0 do 5 : for ` = 0 , . . . , L do 6 : Sample and store trajectory τφ ` 7 : Compute φ ` +1 = f ( φ ` , τφ ` , α ) from inner-loop optimization ( Equation ( 4 ) ) 8 : end for 9 : end for 10 : Update φi0 ← φi0 + β ∑L−1 ` =0 ∇φi0V i φ0 : ` +1 ( s0 , φ i 0 ) based on Equation ( 6 ) 11 : end while Algorithm 2 Meta-Learning at Execution Time Require : p ( φ−i0 ) : Distribution over other agents ’ initial policies ; α : Learning rate ; Optimized φi∗0 1 : Initialize φi0 ← φi∗0 2 : Sample a meta-test batch of φ−i0 ∼ p ( φ −i 0 ) 3 : for each φ−i0 do 4 : for ` = 0 , . . . , L do 5 : Sample trajectory τφ ` 6 : Compute φ ` +1 = f ( φ ` , τφ ` , α ) from inner-loop optimization ( Equation ( 4 ) ) 7 : end for 8 : end for In Deep RL , a very practical way to optimize a value function is by following its gradient . The work of Al-Shedivat et al . ( 2018 ) derived the meta-policy gradient theorem ( Meta-PG ) for optimizing a setup like this . However , it is important to note that they derived this gradient while making the implicit assumption to ignore the dependence of the future parameters of other agents on φi0 : ∇φi0V i φ0 : ` +1 ( s0 , φ i 0 ) = Eτφ0 : ` ∼p ( τφ0 : ` |φi0 : ` , φ−i0 : ` ) [ E τφ ` +1∼p ( τφ ` +1 |φ i ` +1 , φ −i ` +1 ) [ ( ∇φi0 logπ ( τφ0 |φ i 0 ) ︸ ︷︷ ︸ Current Policy + ∑ ` ` ′=0∇φi0 logπ ( τφ ` ′+1 |φ i ` ′+1 ) ︸ ︷︷ ︸ Own Learning ) Gi ( τφ ` +1 ) ] ] . ( 5 ) In particular , Meta-PG has two primary terms . The first term corresponds to the standard policy gradient with respect to the current policy parameters used during the initial trajectory . Meanwhile , the second term∇φi0 log π ( τφ ` ′+1 |φ i ` ′+1 ) explicitly differentiates through log π ( τφ ` ′+1 |φi ` ′+1 ) with respect to φi0 . This enables a meta-agent i to model its own learning dynamics and account for the impact of φi0 on its eventual adapted parameters φ i ` ′+1 . As such , we can see how this term would be quite useful in improving adaptation across a Markov chain of policies . Indeed , it directly accounts for an agent ’ s own learning process during meta-optimization in order to improve future performance .
This paper studies meta-learning in multi-agent reinforcement learning. It proposes a meta multi-agent policy gradient method that considers the learning processes of other agents in the environment for fast adaptation. This method can be seen as a unified framework of previous methods (Al-Shedivat et al. (2018) and Foerster et al. (2018a)). The method outperforms previous methods in two matrix games and 2-agent HalfCheetah.
SP:90b93c165039046b77b5c3ee1df5b1090bfd0f42
A Policy Gradient Algorithm for Learning to Learn in Multiagent Reinforcement Learning
1 INTRODUCTION . Learning in multiagent settings is inherently more difficult than single-agent learning because an agent interacts both with the environment and other agents ( Buşoniu et al. , 2010 ) . Specifically , the fundamental challenge in multiagent reinforcement learning ( MARL ) is the difficulty of learning optimal policies in the presence of other simultaneously learning agents because their changing behaviors jointly affect the environment ’ s transition and reward function . This dependence on nonstationary policies renders the Markov property invalid from the perspective of each agent , requiring agents to adapt their behaviors with respect to potentially large , unpredictable , and endless changes in the policies of fellow agents ( Papoudakis et al. , 2019 ) . In such environments , it is also critical that agents adapt to the changing behaviors of others in a very sample-efficient manner as it is likely that their policy could update again after a small number of interactions ( Al-Shedivat et al. , 2018 ) . Therefore , effective agents should consider the learning of other agents and adapt quickly to non-stationary behaviors . Otherwise , undesirable outcomes may arise when an agent is constantly lagging in its ability to deal with the current policies of other agents . In this paper , we propose a new framework based on meta-learning for addressing the inherent non-stationarity of MARL . Meta-learning ( also referred to as learning to learn ) was recently shown to be a promising methodology for fast adaptation in multiagent settings . The framework by Al-Shedivat et al . ( 2018 ) , for example , introduces a meta-optimization scheme by which a meta-agent can adapt more efficiently to changes in a new opponent ’ s policy after collecting only a handful of interactions . The key idea underlying their meta-optimization is to model the meta-agent ’ s learning process so that its updated policy performs better than an evolving opponent . However , their work does not directly consider the opponent ’ s learning process in the meta-optimization , treating the evolving opponent as an external factor and assuming the meta-agent can not influence the opponent ’ s future policy . As a result , their work fails to consider an important property of MARL : the opponent is also a learning agent changing its policy based on trajectories collected by interacting with the meta-agent . As such , the meta-agent has an opportunity to influence the opponent ’ s future policy by changing the distribution of trajectories , and the meta-agent can take advantage of this opportunity to improve its performance during learning . Our contribution . With this insight , we develop a new meta-multiagent policy gradient theorem ( Meta-MAPG ) that directly models the learning processes of all agents in the environment within a single objective function . We start by extending the meta-policy gradient theorem of Al-Shedivat et al . ( 2018 ) based on the multiagent stochastic policy gradient theorem ( Wei et al. , 2018 ) to derive a novel meta-policy gradient theorem . This is achieved by removing the unrealistic implicit assumption of Al-Shedivat et al . ( 2018 ) that the learning of other agents in the environment is not dependent on an agent ’ s own behavior . Interestingly , performing our derivation with this more general set of assumptions inherently results in an additional term that was not present in previous work by Al-Shedivat et al . ( 2018 ) . We observe that this added term is closely related to the process of shaping the learning dynamics of other agents in the framework of Foerster et al . ( 2018a ) . As such , our work can be seen as contributing a theoretically grounded framework that unifies the collective benefits of previous work by Al-Shedivat et al . ( 2018 ) and Foerster et al . ( 2018a ) . Meta-MAPG is evaluated on a diverse suite of multiagent domains , including the full spectrum of mixed incentive , competitive , and cooperative environments . Our experiments demonstrate that Meta-MAPG consistently results in superior adaption performance in the presence of novel evolving agents . 2 PRELIMINARIES . Interactions between multiple agents can be represented by stochastic games ( Shapley , 1953 ) . Specifically , an n-agent stochastic game is defined as a tupleMn=〈I , S , A , P , R , γ〉 ; I= { 1 , . . . , n } is the set of n agents , S is the set of states , A=×i∈IAi is the set of action spaces , P : S ×A 7→ S is the state transition probability function , R=×i∈IRi is the set of reward functions , and γ ∈ [ 0 , 1 ) is the discount factor . We typeset sets in bold for clarity . Each agent i executes an action at each timestep t according to its stochastic policy ait∼πi ( ait|st , φi ) parameterized by φi , where st ∈S . A joint action at= { ait , a−it } yields a transition from the current state st to the next state st+1∈S with probability P ( st+1|st , at ) , where the notation−i indicates all other agents with the exception of agent i . Agent i then obtains a reward according to its reward function rit = Ri ( st , at ) . At the end of an episode , the agents collect a trajectory τφ under the joint policy with parameters φ , where τφ : = ( s0 , a0 , r0 , . . . , rH ) , φ= { φi , φ−i } represents the joint parameters of all policies , rt= { rit , r−it } is the joint reward , and H is the horizon of the trajectory or episode . 2.1 A MARKOV CHAIN OF POLICIES . The perceived non-stationarity in multiagent settings results from a distribution of sequential joint policies , which can be represented by a Markov chain ( Al-Shedivat et al. , 2018 ) . Formally , a Markov chain of policies begins from a stochastic game between agents with an initial set of joint policies parameterized by φ0 . We assume that each agent updates its policy leveraging a Markovian update function that changes the policy after every K trajectories . After this time period , each agent i adapts its policy to maximize the expected return expressed as its value function : V iφ0 ( s0 ) = Eτφ0∼p ( τφ0 |φi0 , φ−i0 ) [ H∑ t=0 γtrit|s0 ] = E τφ0∼p ( τφ0 |φ i 0 , φ −i 0 ) [ Gi ( τφ0 ) ] , ( 1 ) where Gi denotes agent i ’ s discounted return from the beginning of an episode with initial state s0 . The joint policy update results in a transition from φ0 to the updated set of joint parameters φ1 . The Markov chain continues for a maximum chain length of L ( see Figure 1a ) . This Markov chain perspective highlights the following inherent aspects of the experienced non-stationarity : Sequential dependency . The future joint policy parameters φ1 : L = { φ1 , . . . , φL } sequentially depend on φ0 since a change in τφ0 results in a change in φ1 , which in turn affects τφ1 and all successive joint policy updates up to φL . Controllable levels of non-stationarity . As in Al-Shedivat et al . ( 2018 ) and Foerster et al . ( 2018a ) , we assume stationary policies during the collection of K trajectories , and that the joint policy update happens afterward . In such a setting , it is possible to control the non-stationarity by adjusting the K and H hyperparameters : smaller K and H increase the rate that agents change their policies , leading to a higher degree of non-stationarity in the environment . In the limit of K =H = 1 , all agents change their policy every step . 3 LEARNING TO LEARN IN MULTIAGENT REINFORCEMENT LEARNING . This section explores learning policies that can adapt quickly to non-stationarity in the policies of other agents in the environment . To achieve this , we leverage meta-learning and devise a new meta-multiagent policy gradient theorem that exploits the inherent sequential dependencies of MARL discussed in the previous section . Specifically , our meta-agent addresses this non-stationarity by considering its current policy ’ s impact on its own adapted policies while actively influencing the future policies of other agents as well by inducing changes to the distribution of trajectories . In this section , we first outline the meta-optimization process in MARL and then discuss how the meta-policy gradient theorem of Al-Shedivat et al . ( 2018 ) optimizes for this objective while ignoring the dependence of the future policy of other agents on our current policy . Finally , we derive a new extension of this policy gradient theorem that explicitly leverages this dependence and discuss how to interpret the impact of the resulting form of the gradient . 3.1 GRADIENT BASED META-OPTIMIZATION IN MULTIAGENT REINFORCEMENT LEARNING . We formalize the meta-objective of MARL as optimizing meta-agent i ’ s initial policy parameters φi0 so that it maximizes the expected adaptation performance over a Markov chain of policies drawn from a stationary initial distribution of policies for the other agents p ( φ−i0 ) : max φi0 E p ( φ −i 0 ) [ L−1∑̀ =0 V iφ0 : ` +1 ( s0 , φ i 0 ) ] , ( 2 ) s.t . V iφ0 : ` +1 ( s0 , φ i 0 ) = Eτφ0 : ` ∼p ( τφ0 : ` |φi0 : ` , φ−i0 : ` ) [ E τφ ` +1∼p ( τφ ` +1 |φ i ` +1 , φ −i ` +1 ) [ Gi ( τφ ` +1 ) ] ] ( 3 ) where τφ0 : ` = { τφ0 , . . . , τφ ` } , and V iφ0 : ` +1 ( s0 , φi0 ) denotes the meta-value function . This meta-value function generalizes the notion of each agent ’ s primitive value function for the current set of policies V iφ0 ( s0 ) over the length of the Markov chain of policies . In this work , as in Al-Shedivat et al . ( 2018 ) , we follow the MAML ( Finn et al. , 2017 ) meta-learning framework . As such , we assume that the Markov chain of policies is governed by a policy gradient update function that corresponds to what is generally referred to as the inner-loop optimization in the meta-learning literature : φi ` +1 : = φ i ` + α i∇φi ` Eτφ ` ∼p ( τφ ` |φi ` , φ−i ` ) [ Gi ( τφ ` ) ] , φ−i ` +1 : = φ −i ` +α −i∇ φ −i ` E τφ ` ∼p ( τφ ` |φ i ` , φ −i ` ) [ G−i ( τφ ` ) ] , ( 4 ) where αi and α−i denote the learning rates used by each agent in the environment . 3.2 THE META-POLICY GRADIENT THEOREM . Intuitively , if we optimize the meta-value function , we are searching for initial parameters φi0 such that successive inner-loop optimization steps with Equation ( 4 ) results in adapted parameters φi ` +1 that can perform better than the updated policies of other agents with policy parameters φ−i ` +1 ( see Figure 1b ) . Algorithm 1 Meta-Learning at Training Time Require : p ( φ−i0 ) : Distribution over other agents ’ initial policies ; α , β : Learning rates 1 : Randomly initialize φi0 2 : while φi0 has not converged do 3 : Sample a meta-train batch of φ−i0 ∼ p ( φ −i 0 ) 4 : for each φ−i0 do 5 : for ` = 0 , . . . , L do 6 : Sample and store trajectory τφ ` 7 : Compute φ ` +1 = f ( φ ` , τφ ` , α ) from inner-loop optimization ( Equation ( 4 ) ) 8 : end for 9 : end for 10 : Update φi0 ← φi0 + β ∑L−1 ` =0 ∇φi0V i φ0 : ` +1 ( s0 , φ i 0 ) based on Equation ( 6 ) 11 : end while Algorithm 2 Meta-Learning at Execution Time Require : p ( φ−i0 ) : Distribution over other agents ’ initial policies ; α : Learning rate ; Optimized φi∗0 1 : Initialize φi0 ← φi∗0 2 : Sample a meta-test batch of φ−i0 ∼ p ( φ −i 0 ) 3 : for each φ−i0 do 4 : for ` = 0 , . . . , L do 5 : Sample trajectory τφ ` 6 : Compute φ ` +1 = f ( φ ` , τφ ` , α ) from inner-loop optimization ( Equation ( 4 ) ) 7 : end for 8 : end for In Deep RL , a very practical way to optimize a value function is by following its gradient . The work of Al-Shedivat et al . ( 2018 ) derived the meta-policy gradient theorem ( Meta-PG ) for optimizing a setup like this . However , it is important to note that they derived this gradient while making the implicit assumption to ignore the dependence of the future parameters of other agents on φi0 : ∇φi0V i φ0 : ` +1 ( s0 , φ i 0 ) = Eτφ0 : ` ∼p ( τφ0 : ` |φi0 : ` , φ−i0 : ` ) [ E τφ ` +1∼p ( τφ ` +1 |φ i ` +1 , φ −i ` +1 ) [ ( ∇φi0 logπ ( τφ0 |φ i 0 ) ︸ ︷︷ ︸ Current Policy + ∑ ` ` ′=0∇φi0 logπ ( τφ ` ′+1 |φ i ` ′+1 ) ︸ ︷︷ ︸ Own Learning ) Gi ( τφ ` +1 ) ] ] . ( 5 ) In particular , Meta-PG has two primary terms . The first term corresponds to the standard policy gradient with respect to the current policy parameters used during the initial trajectory . Meanwhile , the second term∇φi0 log π ( τφ ` ′+1 |φ i ` ′+1 ) explicitly differentiates through log π ( τφ ` ′+1 |φi ` ′+1 ) with respect to φi0 . This enables a meta-agent i to model its own learning dynamics and account for the impact of φi0 on its eventual adapted parameters φ i ` ′+1 . As such , we can see how this term would be quite useful in improving adaptation across a Markov chain of policies . Indeed , it directly accounts for an agent ’ s own learning process during meta-optimization in order to improve future performance .
This paper points out that a key challenge in MARL is the non-stationarity of other agents' policies, as opposed to previous papers which only account for non-stationarity of the environment. The paper extends (Al-Shedivat et al., 2018) by directly conditioning the meta-policy on a distribution of other agents' policies. In my opinion, the major contribution of this paper is a new multiagent meta learning theoretic framework that explicitly accounts for the dynamics of all agents.
SP:90b93c165039046b77b5c3ee1df5b1090bfd0f42
On Proximal Policy Optimization's Heavy-Tailed Gradients
1 INTRODUCTION . As Deep Reinforcement Learning ( DRL ) methods have made strides on such diverse tasks as game playing and continuous control ( Berner et al. , 2019 ; Silver et al. , 2017 ; Mnih et al. , 2015 ) , policy gradient methods ( Williams , 1992 ; Sutton et al. , 2000 ; Mnih et al. , 2016 ) have emerged as a popular alternative to dynamic programming approaches . Since the breakthrough results of Mnih et al . ( 2016 ) demonstrated the applicability of policy gradients in DRL , a number of popular variants have emerged ( Schulman et al. , 2017 ; Espeholt et al. , 2018 ) . Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2017 ) —one of the most popular policy gradient methods—introduced the clipped importance sampling update , an effective heuristic for off-policy learning . However , while their stated motivation for clipping draws upon trust-region enforcement , the behavior of these methods tends to deviate from its key algorithmic principle ( Ilyas et al. , 2018 ) , and exhibit sensitivity to implementation details ( Engstrom et al. , 2019 ) . More generally , policy gradient methods are brittle , sensitive to both the random seed and hyperparameter choices , and poorly understood ( Ilyas et al. , 2018 ; Engstrom et al. , 2019 ; Henderson et al. , 2017 ; 2018 ; Islam et al. , 2017 ) . The ubiquity of these issues raises a broader concern about our understanding of policy gradient methods . In this work , we take a step forward towards understanding the workings of PPO , the most prominent and widely used deep policy gradient method . Noting that the heuristics implemented in PPO are evocative of estimation techniques from robust statistics in outlier-rich settings , we conjecture that the heavy-tailed distribution of gradients is the main obstacle addressed by these heuristics . We perform a rigorous empirical study to understand the causes of heavy-tailedness in PPO gradients . Furthermore , we provide a novel perspective on the clipping heuristics implemented in PPO by showing that these heuristics primarily serve to alleviate heavy-tailedness in gradients . Our first contribution is to analyze the role played by each component of the PPO objective in the heavy-tailedness of the gradients . We observe that as the training proceeds , gradients of both the actor and the critic loss get more heavy-tailed . Our findings show that during on-policy gradient steps the advantage estimates are the primary contributors to the heavy-tailed nature of the gradients . Moreover , as off-policyness increases ( i.e . as the behavioral policy and actor policy diverge ) dur- ing training , the likelihood-ratios that appear in the surrogate objective exacerbates the heavy-tailed behavior . Subsequently , we demonstrate that the clipping heuristics present in standard PPO implementations ( i.e. , gradient clipping , actor objective clipping , and value loss clipping ) significantly counteract the heavy-tailedness induced by off-policy training . Finally , motivated by this analysis , we present an algorithm that uses Geometric Median-of-Means ( GMOM ) , a high-dimensional robust aggregation method adapted from the statistics literature . Without using any of the objective clipping and gradient clipping heuristics implemented in PPO , the GMOM algorithm nearly matches PPO ’ s performance on MuJoCo ( Todorov et al. , 2012 ) continuous control tasks . 2 PRELIMINARIES . We define a Markov Decision Process ( MDP ) as a tuple ( S , A , R , γ , P ) , where S represent the set of environments states , A represent the set of agent actions , R : S ×A → R is the reward function , γ is the discount factor , and P : S × A × S → R is the state transition probability distribution . The goal in reinforcement learning is to learn a policy πθ : S × A → R+ , parameterized by θ , such that the expected cumulative discounted reward ( known as returns ) is maximized . Formally , π∗ : = argmaxπ Eat∼π ( ·|st ) , st+1∼P ( ·|st , at ) [ ∑∞ t=0 γ tR ( st , at ) ] . Policy gradient methods directly parameterize the policy ( also known as actor network ) . Since directly optimizing the cumulative rewards can be challenging , modern policy gradient algorithms typically optimize a surrogate reward function . Often the surrogate objective includes a likelihood ratio to allow importance sampling from a behavior policy π0 while optimizing policy πθ . For example , Schulman et al . ( 2015a ) optimize : max θ E ( st , at ) ∼π0 [ πθ ( at , st ) π0 ( at , st ) Aπ0 ( st , at ) ] , ( 1 ) where Aπθ = Qπθ ( st , at ) − Vπθ ( st ) . Here , Q-function , i.e . Qπθ ( s , a ) , is the expected discounted reward after taking an action a at state s and following πθ afterwards and Vπθ ( s ) is the value estimate ( implemented with a critic network ) . However , the surrogate is indicative of the true reward function only when πθ and π0 are close in distribution . Different policy gradient methods ( Schulman et al. , 2015a ; 2017 ; Kakade , 2002 ) attempt to enforce the closeness in different ways . In Natural Policy Gradients ( Kakade , 2002 ) and Trust Region Policy Optimization ( TRPO ) ( Schulman et al. , 2015a ) , authors utilize a conservation policy iteration with an explicit divergence constraint which provides provable lower bounds guarantee on the improvements of the parameterized policy . On the other hand , PPO ( Schulman et al. , 2017 ) implements a clipping heuristic on the likelihood ratio of the surrogate reward function to avoid excessively large policy updates . Specifically , PPO optimizes the following objective : max θ E ( st , at ) ∼π0 [ min ( clip ( ρt , 1− , 1 + ) Âπ0 ( st , at ) , ρtÂπ0 ( st , at ) ) ] , ( 2 ) where ρt : = πθ ( at , st ) π0 ( at , st ) . We refer to ρt as likelihood-ratios . Due to a minimum with the unclipped surrogate reward , the PPO objective acts as a pessimistic bound on the true surrogate reward . As in standard PPO implementation , we use Generalized Advantage Estimation ( GAE ) ( Schulman et al. , 2015b ) . Moreover , instead of fitting the value network via regression to target values : LV = ( Vθt − Vtarg ) 2 , ( 3 ) standard implementations fit the value network with a PPO-like objective : LV = max { ( Vθt − Vtarg ) 2 , ( clip ( Vθt , Vθt−1 − ε , Vθt−1 + ε ) − Vtarg ) 2 } , , ( 4 ) where is the same value used to clip probability raitos in PPO ’ s loss function ( Eq . 9 ) . PPO uses the following training procedure : At any iteration t , the agent creates a clone of the current policy πθt which interacts with the environment to collect rollouts B ( i.e. , state-action pairs { ( si , ai ) } Ni=1 ) . Then the algorithm optimizes the policy πθ and value function Vθ for a fixed K gradient steps on the sampled data B . Since at every iteration the first gradient step is taken on the same policy from which the data was sampled , we refer to these gradient updates as on-policy steps . And as for the remaining K − 1 steps , the sampling policy differs from the current agent , we refer to these updates as off-policy steps . Throughout the paper , we consider a stripped-down variant of PPO ( denoted PPO-NOCLIP ) that consists of policy gradient with importance weighting ( Eq . 1 ) , but has been simplified as follows : i ) no likelihood-ratio clipping , i.e. , no objective function clipping ; ii ) value network optimized via regression to target values ( Eq . 3 ) without value function clipping ; and iii ) no gradient clipping . Overall PPO-NOCLIP uses the objective summarized in App . A . One may argue that since PPONOCLIP removes the clipping heuristic from PPO , the unconstrained maximization of Eq . 1 may lead to excessively large policy updates . In App . I , we empirically justify the use of Eq . 1 by showing that with the small learning rate used in our experiments ( tuned hyperparameters in Table 1 ) , PPONOCLIP maintains a KL based trust-region like PPO throughout the training . We elaborate this in App . I . 2.1 FRAMEWORK FOR ESTIMATING HEAVY-TAILEDNESS . We now formalize our setup for studying the distribution of gradients . Throughout the paper , we use the following definition of the heavy-tailed property : Definition 1 ( Resnick ( 2007 ) ) . A non-negative random variable w is called heavy-tailed if its tail probability Fw ( t ) : =P ( w ≥ t ) is asymptotically equivalent to t−α ∗ as t → ∞ for some positive number α∗ . Here α∗ determines the heavy-tailedness and α∗ is called tail index of w. For a heavy-tailed distribution with index α∗ , its α-th moment exists only if α < α∗ , i.e. , E [ wα ] < ∞ iff α < α∗ . A value of α∗ = 1.0 corresponds to a Cauchy distribution and α∗ = ∞ ( i.e. , all moments exist ) corresponds to a Gaussian distribution . Intuitively , as α∗ decreases , the central peak of the distribution gets higher , the valley before the central peak gets deeper , and the tails get heavier . In other words , the lower the tail-index , the more heavy-tailed the distribution . However , in the finite sample setting , estimating the tail index is notoriously challenging ( Simsekli et al. , 2019 ; Danielsson et al. , 2016 ; Hill , 1975 ) . In this study , we explore three estimators as heuristic measures to understand heavy tails and nonGaussianity of gradients ( refer to App . B for details ) . ( i ) Alpha-index estimator which measures alpha-index for symmeteric α-stable distributions . This estimator is derived under the ( strong ) assumption that the stochastic Gradient Noise ( GN ) vectors are coordinate-wise independent and follow a symmetric alpha-stable distribution . ( ii ) Anderson-Darling test ( Anderson & Darling , 1954 ) on random projections of GN to perform Gaussianity testing ( Panigrahi et al. , 2019 ) . To our knowledge , the deep learning literature has only explored these two estimators for analyzing the heavytailed nature of gradients . ( iii ) Finally , in our work , we propose using Kurtosis . To quantify the heavy-tailedness relative to a normal distribution , we measure kurtosis ( fourth standardized moment ) of the gradient norms . Given samples { Xi } Ni=1 , the kurtosis κ is given by : κ = ∑N i=1 ( Xi − X̄ ) 4/N ( ∑N i=1 ( Xi − X̄ ) 2/N ) 2 , where X̄ is the empirical mean of the samples . With a slight breach of notation , we use kurtosis to denote κ1/4 . It is well known that for a Pareto distribution with shape α ≥ 4 , the lower the tail-index ( shape parameter α ) the higher the kurtosis . For α < 4 , since the fourth moment is non-existent , kurtosis is infinity . While for Gaussian distribution , the kurtosis value is approximately 1.31 . In App . B , we show behavior of kurtosis on Gaussian and Pareto data with varying sample sizes and tail-indices for Pareto data .
This paper presents an intriguing analysis of the gradient distributions over the course of training for popular RL algorithms in common mujoco benchmarks. The observation that negative advantages are a bigger contributor to the kurtosis than positive advantages seems interesting and if true as a general phenomenon, deserving of more understanding. The authors also propose a new alternative (inspired by robust statistic) to the simple PPO clipping heuristic that does reasonably well even if it doesn't deliver any clear improvements over PPO.
SP:3fc873bd47448de58d54f7def16a1ddb7df613b8
On Proximal Policy Optimization's Heavy-Tailed Gradients
1 INTRODUCTION . As Deep Reinforcement Learning ( DRL ) methods have made strides on such diverse tasks as game playing and continuous control ( Berner et al. , 2019 ; Silver et al. , 2017 ; Mnih et al. , 2015 ) , policy gradient methods ( Williams , 1992 ; Sutton et al. , 2000 ; Mnih et al. , 2016 ) have emerged as a popular alternative to dynamic programming approaches . Since the breakthrough results of Mnih et al . ( 2016 ) demonstrated the applicability of policy gradients in DRL , a number of popular variants have emerged ( Schulman et al. , 2017 ; Espeholt et al. , 2018 ) . Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2017 ) —one of the most popular policy gradient methods—introduced the clipped importance sampling update , an effective heuristic for off-policy learning . However , while their stated motivation for clipping draws upon trust-region enforcement , the behavior of these methods tends to deviate from its key algorithmic principle ( Ilyas et al. , 2018 ) , and exhibit sensitivity to implementation details ( Engstrom et al. , 2019 ) . More generally , policy gradient methods are brittle , sensitive to both the random seed and hyperparameter choices , and poorly understood ( Ilyas et al. , 2018 ; Engstrom et al. , 2019 ; Henderson et al. , 2017 ; 2018 ; Islam et al. , 2017 ) . The ubiquity of these issues raises a broader concern about our understanding of policy gradient methods . In this work , we take a step forward towards understanding the workings of PPO , the most prominent and widely used deep policy gradient method . Noting that the heuristics implemented in PPO are evocative of estimation techniques from robust statistics in outlier-rich settings , we conjecture that the heavy-tailed distribution of gradients is the main obstacle addressed by these heuristics . We perform a rigorous empirical study to understand the causes of heavy-tailedness in PPO gradients . Furthermore , we provide a novel perspective on the clipping heuristics implemented in PPO by showing that these heuristics primarily serve to alleviate heavy-tailedness in gradients . Our first contribution is to analyze the role played by each component of the PPO objective in the heavy-tailedness of the gradients . We observe that as the training proceeds , gradients of both the actor and the critic loss get more heavy-tailed . Our findings show that during on-policy gradient steps the advantage estimates are the primary contributors to the heavy-tailed nature of the gradients . Moreover , as off-policyness increases ( i.e . as the behavioral policy and actor policy diverge ) dur- ing training , the likelihood-ratios that appear in the surrogate objective exacerbates the heavy-tailed behavior . Subsequently , we demonstrate that the clipping heuristics present in standard PPO implementations ( i.e. , gradient clipping , actor objective clipping , and value loss clipping ) significantly counteract the heavy-tailedness induced by off-policy training . Finally , motivated by this analysis , we present an algorithm that uses Geometric Median-of-Means ( GMOM ) , a high-dimensional robust aggregation method adapted from the statistics literature . Without using any of the objective clipping and gradient clipping heuristics implemented in PPO , the GMOM algorithm nearly matches PPO ’ s performance on MuJoCo ( Todorov et al. , 2012 ) continuous control tasks . 2 PRELIMINARIES . We define a Markov Decision Process ( MDP ) as a tuple ( S , A , R , γ , P ) , where S represent the set of environments states , A represent the set of agent actions , R : S ×A → R is the reward function , γ is the discount factor , and P : S × A × S → R is the state transition probability distribution . The goal in reinforcement learning is to learn a policy πθ : S × A → R+ , parameterized by θ , such that the expected cumulative discounted reward ( known as returns ) is maximized . Formally , π∗ : = argmaxπ Eat∼π ( ·|st ) , st+1∼P ( ·|st , at ) [ ∑∞ t=0 γ tR ( st , at ) ] . Policy gradient methods directly parameterize the policy ( also known as actor network ) . Since directly optimizing the cumulative rewards can be challenging , modern policy gradient algorithms typically optimize a surrogate reward function . Often the surrogate objective includes a likelihood ratio to allow importance sampling from a behavior policy π0 while optimizing policy πθ . For example , Schulman et al . ( 2015a ) optimize : max θ E ( st , at ) ∼π0 [ πθ ( at , st ) π0 ( at , st ) Aπ0 ( st , at ) ] , ( 1 ) where Aπθ = Qπθ ( st , at ) − Vπθ ( st ) . Here , Q-function , i.e . Qπθ ( s , a ) , is the expected discounted reward after taking an action a at state s and following πθ afterwards and Vπθ ( s ) is the value estimate ( implemented with a critic network ) . However , the surrogate is indicative of the true reward function only when πθ and π0 are close in distribution . Different policy gradient methods ( Schulman et al. , 2015a ; 2017 ; Kakade , 2002 ) attempt to enforce the closeness in different ways . In Natural Policy Gradients ( Kakade , 2002 ) and Trust Region Policy Optimization ( TRPO ) ( Schulman et al. , 2015a ) , authors utilize a conservation policy iteration with an explicit divergence constraint which provides provable lower bounds guarantee on the improvements of the parameterized policy . On the other hand , PPO ( Schulman et al. , 2017 ) implements a clipping heuristic on the likelihood ratio of the surrogate reward function to avoid excessively large policy updates . Specifically , PPO optimizes the following objective : max θ E ( st , at ) ∼π0 [ min ( clip ( ρt , 1− , 1 + ) Âπ0 ( st , at ) , ρtÂπ0 ( st , at ) ) ] , ( 2 ) where ρt : = πθ ( at , st ) π0 ( at , st ) . We refer to ρt as likelihood-ratios . Due to a minimum with the unclipped surrogate reward , the PPO objective acts as a pessimistic bound on the true surrogate reward . As in standard PPO implementation , we use Generalized Advantage Estimation ( GAE ) ( Schulman et al. , 2015b ) . Moreover , instead of fitting the value network via regression to target values : LV = ( Vθt − Vtarg ) 2 , ( 3 ) standard implementations fit the value network with a PPO-like objective : LV = max { ( Vθt − Vtarg ) 2 , ( clip ( Vθt , Vθt−1 − ε , Vθt−1 + ε ) − Vtarg ) 2 } , , ( 4 ) where is the same value used to clip probability raitos in PPO ’ s loss function ( Eq . 9 ) . PPO uses the following training procedure : At any iteration t , the agent creates a clone of the current policy πθt which interacts with the environment to collect rollouts B ( i.e. , state-action pairs { ( si , ai ) } Ni=1 ) . Then the algorithm optimizes the policy πθ and value function Vθ for a fixed K gradient steps on the sampled data B . Since at every iteration the first gradient step is taken on the same policy from which the data was sampled , we refer to these gradient updates as on-policy steps . And as for the remaining K − 1 steps , the sampling policy differs from the current agent , we refer to these updates as off-policy steps . Throughout the paper , we consider a stripped-down variant of PPO ( denoted PPO-NOCLIP ) that consists of policy gradient with importance weighting ( Eq . 1 ) , but has been simplified as follows : i ) no likelihood-ratio clipping , i.e. , no objective function clipping ; ii ) value network optimized via regression to target values ( Eq . 3 ) without value function clipping ; and iii ) no gradient clipping . Overall PPO-NOCLIP uses the objective summarized in App . A . One may argue that since PPONOCLIP removes the clipping heuristic from PPO , the unconstrained maximization of Eq . 1 may lead to excessively large policy updates . In App . I , we empirically justify the use of Eq . 1 by showing that with the small learning rate used in our experiments ( tuned hyperparameters in Table 1 ) , PPONOCLIP maintains a KL based trust-region like PPO throughout the training . We elaborate this in App . I . 2.1 FRAMEWORK FOR ESTIMATING HEAVY-TAILEDNESS . We now formalize our setup for studying the distribution of gradients . Throughout the paper , we use the following definition of the heavy-tailed property : Definition 1 ( Resnick ( 2007 ) ) . A non-negative random variable w is called heavy-tailed if its tail probability Fw ( t ) : =P ( w ≥ t ) is asymptotically equivalent to t−α ∗ as t → ∞ for some positive number α∗ . Here α∗ determines the heavy-tailedness and α∗ is called tail index of w. For a heavy-tailed distribution with index α∗ , its α-th moment exists only if α < α∗ , i.e. , E [ wα ] < ∞ iff α < α∗ . A value of α∗ = 1.0 corresponds to a Cauchy distribution and α∗ = ∞ ( i.e. , all moments exist ) corresponds to a Gaussian distribution . Intuitively , as α∗ decreases , the central peak of the distribution gets higher , the valley before the central peak gets deeper , and the tails get heavier . In other words , the lower the tail-index , the more heavy-tailed the distribution . However , in the finite sample setting , estimating the tail index is notoriously challenging ( Simsekli et al. , 2019 ; Danielsson et al. , 2016 ; Hill , 1975 ) . In this study , we explore three estimators as heuristic measures to understand heavy tails and nonGaussianity of gradients ( refer to App . B for details ) . ( i ) Alpha-index estimator which measures alpha-index for symmeteric α-stable distributions . This estimator is derived under the ( strong ) assumption that the stochastic Gradient Noise ( GN ) vectors are coordinate-wise independent and follow a symmetric alpha-stable distribution . ( ii ) Anderson-Darling test ( Anderson & Darling , 1954 ) on random projections of GN to perform Gaussianity testing ( Panigrahi et al. , 2019 ) . To our knowledge , the deep learning literature has only explored these two estimators for analyzing the heavytailed nature of gradients . ( iii ) Finally , in our work , we propose using Kurtosis . To quantify the heavy-tailedness relative to a normal distribution , we measure kurtosis ( fourth standardized moment ) of the gradient norms . Given samples { Xi } Ni=1 , the kurtosis κ is given by : κ = ∑N i=1 ( Xi − X̄ ) 4/N ( ∑N i=1 ( Xi − X̄ ) 2/N ) 2 , where X̄ is the empirical mean of the samples . With a slight breach of notation , we use kurtosis to denote κ1/4 . It is well known that for a Pareto distribution with shape α ≥ 4 , the lower the tail-index ( shape parameter α ) the higher the kurtosis . For α < 4 , since the fourth moment is non-existent , kurtosis is infinity . While for Gaussian distribution , the kurtosis value is approximately 1.31 . In App . B , we show behavior of kurtosis on Gaussian and Pareto data with varying sample sizes and tail-indices for Pareto data .
This paper performs an empirical analysis of the heavy-tailedness of the PPO gradients across MuJoCo environments. They find that PPO gradients are heavy-tailed, which means that they are sensitive to outliers, which means computing the expected gradient is hard. The paper studies two causes of this issue -- advantage estimation errors and the harm caused by optimizing density ratios in a sampled setting, and shows that removing either of them with the other issue controlled for helps PPO. They then propose to use a standard robust mean estimation technique to obtain a robust gradient mean estimator that is plugged into PPO, and performs sort of somewhat worse than vanilla PPO.
SP:3fc873bd47448de58d54f7def16a1ddb7df613b8
Suppressing Outlier Reconstruction in Autoencoders for Out-of-Distribution Detection
1 INTRODUCTION . An autoencoder ( Rumelhart et al. , 1986 ) is a neural network trained to reconstruct samples from a training data distribution . As the quality of reconstruction is expected to degrade for inputs that are significantly different from training data , autoencoders are widely used in outlier detection ( Japkowicz et al. , 1995 ) where an input with a large reconstruction error is classified as out-of-distribution ( OOD ) . Such autoencoders for outlier detection have been applied in domains ranging from video surveillance ( Zhao et al. , 2017 ) to medical diagnosis ( Lu & Xu , 2018 ) . Contrary to widely-held belief , autoencoders are in fact capable of accurately reconstructing outliers , casting doubt on their reliability as an outlier detector . Lyudchik ( 2016 ) showed that an autoencoder trained on MNIST with the digit seven excluded can reconstruct an image of the excluded digit , and Tong et al . ( 2019 ) reported that an autoencoder trained on MNIST can reconstruct an image with all zero pixels . The reconstruction of outliers is also observed for non-image data ( Zong et al. , 2018 ) . In this paper , we investigate this unexpected behavior of autoencoders more deeply , which we refer to as outlier reconstruction . In the course of our investigation , we reproduce the findings of Lyudchik ( 2016 ) and Tong et al . ( 2019 ) , and additionally discover other interesting cases ( Figure 1 ) . Our experiments suggest that outlier reconstruction is not a fortuitous artifact of stochastic training but is , in fact , a consequence of inductive biases inherent in an autoencoder . Outlier reconstruction should be suppressed for an autoencoder-based outlier detector , since a reconstructed outlier undermines the detector ’ s performance by being mistaken to be an inlier . Despite the long history of autoencoder research ( Rumelhart et al. , 1986 ; Bank et al. , 2020 ) , the outlier reconstruction phenomenon has only recently begun to receive attention ( Lyudchik , 2016 ; Tong et al. , 2019 ; Zong et al. , 2018 ) , with few works explicitly proposing solutions to the outlier reconstruction problem ( Gong et al. , 2019 ) . Previous works focused on regularization techniques that prevent an autoencoder from being an identity mapping ( and thus reconstructing all inputs ) . However , outlier reconstruction still occurs in popular regularized autoencoders , including denoising autoencoders ( DAE , Vincent et al . ( 2008 ) ) , variational autoencoders ( VAE , Kingma & Welling ( 2014 ) ) , and Wasserstein autoencoders ( WAE , Tolstikhin et al . ( 2017 ) ) , as we shall show in our experiments ( Table 1 ) . In this paper , we propose the Energy-based Autoencoder ( EBAE ) , an autoencoder in which the reconstruction of outliers is explicitly suppressed during training . In each training step of EBAE , “ fake ” samples with small reconstruction error are generated . These well-reconstructed fake samples serve as probes for potential reconstructed outliers . Then , EBAE maximizes the reconstruction errors of the generated samples , while minimizing the reconstruction errors of “ real ” training samples . When the generated samples become indistinguishable to training data , the gradients from the fake samples and real samples balance , and thus the training converges . The training scheme naturally arises from defining a probability density for EBAE using its reconstruction error . The density of EBAE is given as pθ ( x ) = exp ( −E ( x ) ) /Ω , where E ( x ) is the reconstruction error of x and Ω is a normalization constant . This formulation of defining a density using a scalar function is often called an energy-based model in the literature ( Mnih & Hinton , 2005 ; Hinton et al. , 2006 ) , and E ( x ) is called the energy of the density . Maximizing likelihood in this formulation results in contrastive divergence learning ( Hinton , 2002 ) , which minimizes the energy of the training data while maximizing the energy of the samples from the model . When generating samples with small reconstruction error during training , we use a novel sampling scheme specifically designed for EBAE . Our sampling scheme is based on Langevin Monte Carlo but leverages the latent space of an autoencoder to generate diverse samples which facilitates the training of EBAE . Setting the reconstruction error as the energy , EBAE incorporates two major outlier detection criteria , large reconstruction error ( Japkowicz et al. , 1995 ) and low likelihood ( Bishop , 1994 ) , since the two are equivalent in EBAE . Generally , the two criteria do not necessarily overlap in other methods , e.g. , VAE or energy-based models ( Zhai et al. , 2016 ) . Recent studies show that a likelihood-based outlier detector using a deep generative model , such as an auto-regressive model or flow-based model , fails to correctly classify certain obvious outliers ( Nalisnick et al. , 2019 ; Hendrycks et al. , 2019 ) . However , EBAE is able to detect such outliers successfully while still using likelihood as the decision criterion . The contributions of our paper can be summarized as follows : • We report and investigate various cases of outlier reconstruction in autoencoders ; • We propose EBAE , an autoencoder significantly less prone to outlier reconstruction ; • We present a sampling method tailored for EBAE which efficiently generates diverse samples ; • We empirically show that EBAE is highly effective for outlier detection . Section 2 provides a brief introduction on autoencoder-based outlier detection . In Section 3 , we investigate outlier reconstruction in depth with illustrative examples . Section 4 describes EBAE . Related works are reviewed in Section 5 . Section 6 presents experimental results . Section 7 concludes the paper . 2 BACKGROUND . 2.1 PROBLEM SETTING . In this paper , we consider the outlier detection problem , which is also referred to as novelty detection , open set recognition , or OOD detection in literature . The goal is to classify outliers from in-distribution samples , while no information regarding the outliers to be detected is provided during training . Formally , we are given a set of inliers x ∈ X ⊂ RDx from the underlying data density function p ( x ) for training . Dx is the dimensionality of x and X is the support of p ( x ) . An outlier is typically defined as a sample from the ρ-sublevel set of data density { x|p ( x ) ≤ ρ } ( Steinwart et al. , 2005 ) . Note that a sample located outside of the support X belongs to the 0-sublevel set and hence is an outlier for all ρ ≥ 0 . An outlier detection system typically produces a scalar decision function c ( x ) , and x is predicted as an outlier if c ( x ) > η for the threshold η . Setting the threshold controls the trade-off between false positive rate and false negative rate . In our experiments , we shall use area under receiver operating characteristic curve ( AUC ) as a threshold-independent performance metric when evaluating outlier detection algorithms . 2.2 AUTOENCODER-BASED OOD DETECTION . An autoencoder consists of an encoder fe ( x ) : RDx → RDz and a decoder fd ( z ) : RDz → RDx , where Dz is the dimensionality of the latent vector z . An input x is sequentially processed through the encoder and the decoder , producing its reconstruction x̃ = fd ( fe ( x ) ) . The reconstruction error is the discrepancy between x and x̃ . L2 distance ||x− x̃||2 is a popular choice of discrepancy measure , but other error metrics are also applicable . A encoder and a decoder are deep neural networks and are jointly trained to minimize the mean reconstruction error of training data through stochastic gradient descent . In an autoencoder-based outlier detection system ( Japkowicz et al. , 1995 ) , the reconstruction error of an autoencoder trained on in-distribution samples is used as the decision function c ( x ) = ||x− x̃||2 , and an input with large reconstruction error is classified as OOD . However , in the next section , we shall show that an autoencoder could unexpectedly produce very small reconstruction error for inputs not drawn from the training distribution . Thus an autoencoder-based outlier detection system may fail to detect such outliers . 3 OUTLIER RECONSTRUCTION The outlier reconstruction is a phenomenon that an autoencoder unexpectedly succeeds in reconstructing an input even though it is located outside of the training distribution . In this section , we provide illustrative examples that show that outlier reconstruction is a consequence from the inductive biases of an autoencoder . Smoothness of mappings When the training data distribution consists of multiple clusters , the outliers from the region between the clusters are likely to be reconstructed . Figure 2 depicts 2D synthetic data generated from a mixture of two disconnected uniform distributions and their reconstruction from autoencoders with one-dimensional latent space . The outliers ( red crosses ) from the middle of two clusters show reconstruction errors ( the length of thin black lines ) smaller than some inliers ( blue dots ) . Tong et al . ( 2019 ) noted this type of outlier reconstruction and mentioned that outliers “ close to the mean ” of data or “ in the convex hull ” of data are likely to be reconstructed . This phenomenon arises from the inductive bias of an autoencoder that its encoder and decoder are smooth mappings . The extreme case of this inductive bias can be found in linear principal component analysis ( PCA ) . PCA , a linear counterpart of an autoencoder ( Bourlard & Kamp , 1988 ) , would reconstruct any outliers which reside on the principal axis . Note that this phenomenon is consistent with the objective function of an autoencoder and PCA , as the objective does not penalize the reconstruction of outliers . Compositionality When there is a compositional structure in data , we can still observe a reconstructed outlier even if it lies outside of the convex hull of training data . The data are compositional if each datum can be broken down into smaller reusable components ; For example , MNIST can be considered highly compositional , since a digit image can be decomposed into smaller sub-patterns , such as straight lines and curves . An outlier can be successfully reconstructed when composed of a subset of components existing in the training data . To demonstrate the effect of compositionality in outlier reconstruction , we make two synthetic datasets both of which are clearly out-of-distribution with respect to MNIST . The first dataset is HalfMNIST ( the seventh column in Figure 1 ) , consisting of MNIST images with a randomly chosen upper or lower half replaced by zero pixels . ChimeraMNIST ( the last column in Figure 1 ) , the second dataset , is a set of images generated by concatenating upper and lower halves of two randomly chosen digits . Although these images are not in the convex hull of MNIST digits , they share components found in MNIST . As shown in Figure 1 , an autoencoder trained on MNIST have no problem reconstructing them . The classification AUCs from the reconstruction error are 0.482 for HalfMNIST and 0.69 for ChimeraMNIST , indicating poor classification . It seems that an autoencoder learns to reconstruct each part of an image separately but is not able to judge whether the combination of the parts is valid as a whole . This compositional way of processing facilitates generalization of a model ( Keysers et al. , 2019 ) , but the generalization of reconstruction in OOD inputs is not desirable for an autoencoder-based outlier detector . Distributed representation We suspect the outlier reconstruction due to compositional processing may be attributed to the distributed representation ( Mikolov et al. , 2013 ) used in an autoencoder . To show the effect of the distributed representation , we train autoencoders on MNIST with the digit 9 excluded ( MNISTnot9 ) and measure the reconstruction error of the digit 9 ( MNIST9 ) under multiple values of latent dimensionality Dz . Figure 3 shows the result . We observe the outlier reconstruction of MNIST9 possibly due to the compositional processing mentioned above . However , the outlier reconstruction occurs only when Dz is large . The latent representation is more distribution for large Dz , as a larger number of hidden neurons are used to represent an input . This observation suggests that the distributed representation used in an autoencoder enables the compositional processing and thus facilitates outlier reconstruction . Meanwhile , the model we propose shortly is not vulnerable to outlier reconstruction in all cases we examined above , as shown in Figure 1 , Figure 2 , and Table 1 , even though it is based on the same autoencoder architecture .
The paper describes a new method for detecting outliers with deep autoencoders by suppressing the reconstruction of out-of-distribution data. The article first investigates the reasons why standard autoencoders (AEs) reconstruct outlier datapoints fairly well, and are therefore problematic when used to detect anomalies via the reconstruction loss. The main novel contribution is the Energy-based Autoencoder (EBAE), a variant of an autoencoder in which the reconstruction loss is directly used as an energy function, and therefore outliers should have high energy. This is done with a new gradient formulation that enforces normalization of the probability distribution by sampling from the learned model via a variant of Langevin Monte-Carlo sampling. This second term is supposed to punish the reconstruction of outliers. Results are shown on a MNIST holdout task (leave one class out), and for OOD detection in CIFAR-10 and a downsampled version of ImageNet, showing that EBAE learns to reconstruct samples from different datasets, as well as constant and noise inputs, with significantly higher reconstruction error than competing methods.
SP:ce02279c05b6c1d89e80f8d2ce16403aa2586ad6
Suppressing Outlier Reconstruction in Autoencoders for Out-of-Distribution Detection
1 INTRODUCTION . An autoencoder ( Rumelhart et al. , 1986 ) is a neural network trained to reconstruct samples from a training data distribution . As the quality of reconstruction is expected to degrade for inputs that are significantly different from training data , autoencoders are widely used in outlier detection ( Japkowicz et al. , 1995 ) where an input with a large reconstruction error is classified as out-of-distribution ( OOD ) . Such autoencoders for outlier detection have been applied in domains ranging from video surveillance ( Zhao et al. , 2017 ) to medical diagnosis ( Lu & Xu , 2018 ) . Contrary to widely-held belief , autoencoders are in fact capable of accurately reconstructing outliers , casting doubt on their reliability as an outlier detector . Lyudchik ( 2016 ) showed that an autoencoder trained on MNIST with the digit seven excluded can reconstruct an image of the excluded digit , and Tong et al . ( 2019 ) reported that an autoencoder trained on MNIST can reconstruct an image with all zero pixels . The reconstruction of outliers is also observed for non-image data ( Zong et al. , 2018 ) . In this paper , we investigate this unexpected behavior of autoencoders more deeply , which we refer to as outlier reconstruction . In the course of our investigation , we reproduce the findings of Lyudchik ( 2016 ) and Tong et al . ( 2019 ) , and additionally discover other interesting cases ( Figure 1 ) . Our experiments suggest that outlier reconstruction is not a fortuitous artifact of stochastic training but is , in fact , a consequence of inductive biases inherent in an autoencoder . Outlier reconstruction should be suppressed for an autoencoder-based outlier detector , since a reconstructed outlier undermines the detector ’ s performance by being mistaken to be an inlier . Despite the long history of autoencoder research ( Rumelhart et al. , 1986 ; Bank et al. , 2020 ) , the outlier reconstruction phenomenon has only recently begun to receive attention ( Lyudchik , 2016 ; Tong et al. , 2019 ; Zong et al. , 2018 ) , with few works explicitly proposing solutions to the outlier reconstruction problem ( Gong et al. , 2019 ) . Previous works focused on regularization techniques that prevent an autoencoder from being an identity mapping ( and thus reconstructing all inputs ) . However , outlier reconstruction still occurs in popular regularized autoencoders , including denoising autoencoders ( DAE , Vincent et al . ( 2008 ) ) , variational autoencoders ( VAE , Kingma & Welling ( 2014 ) ) , and Wasserstein autoencoders ( WAE , Tolstikhin et al . ( 2017 ) ) , as we shall show in our experiments ( Table 1 ) . In this paper , we propose the Energy-based Autoencoder ( EBAE ) , an autoencoder in which the reconstruction of outliers is explicitly suppressed during training . In each training step of EBAE , “ fake ” samples with small reconstruction error are generated . These well-reconstructed fake samples serve as probes for potential reconstructed outliers . Then , EBAE maximizes the reconstruction errors of the generated samples , while minimizing the reconstruction errors of “ real ” training samples . When the generated samples become indistinguishable to training data , the gradients from the fake samples and real samples balance , and thus the training converges . The training scheme naturally arises from defining a probability density for EBAE using its reconstruction error . The density of EBAE is given as pθ ( x ) = exp ( −E ( x ) ) /Ω , where E ( x ) is the reconstruction error of x and Ω is a normalization constant . This formulation of defining a density using a scalar function is often called an energy-based model in the literature ( Mnih & Hinton , 2005 ; Hinton et al. , 2006 ) , and E ( x ) is called the energy of the density . Maximizing likelihood in this formulation results in contrastive divergence learning ( Hinton , 2002 ) , which minimizes the energy of the training data while maximizing the energy of the samples from the model . When generating samples with small reconstruction error during training , we use a novel sampling scheme specifically designed for EBAE . Our sampling scheme is based on Langevin Monte Carlo but leverages the latent space of an autoencoder to generate diverse samples which facilitates the training of EBAE . Setting the reconstruction error as the energy , EBAE incorporates two major outlier detection criteria , large reconstruction error ( Japkowicz et al. , 1995 ) and low likelihood ( Bishop , 1994 ) , since the two are equivalent in EBAE . Generally , the two criteria do not necessarily overlap in other methods , e.g. , VAE or energy-based models ( Zhai et al. , 2016 ) . Recent studies show that a likelihood-based outlier detector using a deep generative model , such as an auto-regressive model or flow-based model , fails to correctly classify certain obvious outliers ( Nalisnick et al. , 2019 ; Hendrycks et al. , 2019 ) . However , EBAE is able to detect such outliers successfully while still using likelihood as the decision criterion . The contributions of our paper can be summarized as follows : • We report and investigate various cases of outlier reconstruction in autoencoders ; • We propose EBAE , an autoencoder significantly less prone to outlier reconstruction ; • We present a sampling method tailored for EBAE which efficiently generates diverse samples ; • We empirically show that EBAE is highly effective for outlier detection . Section 2 provides a brief introduction on autoencoder-based outlier detection . In Section 3 , we investigate outlier reconstruction in depth with illustrative examples . Section 4 describes EBAE . Related works are reviewed in Section 5 . Section 6 presents experimental results . Section 7 concludes the paper . 2 BACKGROUND . 2.1 PROBLEM SETTING . In this paper , we consider the outlier detection problem , which is also referred to as novelty detection , open set recognition , or OOD detection in literature . The goal is to classify outliers from in-distribution samples , while no information regarding the outliers to be detected is provided during training . Formally , we are given a set of inliers x ∈ X ⊂ RDx from the underlying data density function p ( x ) for training . Dx is the dimensionality of x and X is the support of p ( x ) . An outlier is typically defined as a sample from the ρ-sublevel set of data density { x|p ( x ) ≤ ρ } ( Steinwart et al. , 2005 ) . Note that a sample located outside of the support X belongs to the 0-sublevel set and hence is an outlier for all ρ ≥ 0 . An outlier detection system typically produces a scalar decision function c ( x ) , and x is predicted as an outlier if c ( x ) > η for the threshold η . Setting the threshold controls the trade-off between false positive rate and false negative rate . In our experiments , we shall use area under receiver operating characteristic curve ( AUC ) as a threshold-independent performance metric when evaluating outlier detection algorithms . 2.2 AUTOENCODER-BASED OOD DETECTION . An autoencoder consists of an encoder fe ( x ) : RDx → RDz and a decoder fd ( z ) : RDz → RDx , where Dz is the dimensionality of the latent vector z . An input x is sequentially processed through the encoder and the decoder , producing its reconstruction x̃ = fd ( fe ( x ) ) . The reconstruction error is the discrepancy between x and x̃ . L2 distance ||x− x̃||2 is a popular choice of discrepancy measure , but other error metrics are also applicable . A encoder and a decoder are deep neural networks and are jointly trained to minimize the mean reconstruction error of training data through stochastic gradient descent . In an autoencoder-based outlier detection system ( Japkowicz et al. , 1995 ) , the reconstruction error of an autoencoder trained on in-distribution samples is used as the decision function c ( x ) = ||x− x̃||2 , and an input with large reconstruction error is classified as OOD . However , in the next section , we shall show that an autoencoder could unexpectedly produce very small reconstruction error for inputs not drawn from the training distribution . Thus an autoencoder-based outlier detection system may fail to detect such outliers . 3 OUTLIER RECONSTRUCTION The outlier reconstruction is a phenomenon that an autoencoder unexpectedly succeeds in reconstructing an input even though it is located outside of the training distribution . In this section , we provide illustrative examples that show that outlier reconstruction is a consequence from the inductive biases of an autoencoder . Smoothness of mappings When the training data distribution consists of multiple clusters , the outliers from the region between the clusters are likely to be reconstructed . Figure 2 depicts 2D synthetic data generated from a mixture of two disconnected uniform distributions and their reconstruction from autoencoders with one-dimensional latent space . The outliers ( red crosses ) from the middle of two clusters show reconstruction errors ( the length of thin black lines ) smaller than some inliers ( blue dots ) . Tong et al . ( 2019 ) noted this type of outlier reconstruction and mentioned that outliers “ close to the mean ” of data or “ in the convex hull ” of data are likely to be reconstructed . This phenomenon arises from the inductive bias of an autoencoder that its encoder and decoder are smooth mappings . The extreme case of this inductive bias can be found in linear principal component analysis ( PCA ) . PCA , a linear counterpart of an autoencoder ( Bourlard & Kamp , 1988 ) , would reconstruct any outliers which reside on the principal axis . Note that this phenomenon is consistent with the objective function of an autoencoder and PCA , as the objective does not penalize the reconstruction of outliers . Compositionality When there is a compositional structure in data , we can still observe a reconstructed outlier even if it lies outside of the convex hull of training data . The data are compositional if each datum can be broken down into smaller reusable components ; For example , MNIST can be considered highly compositional , since a digit image can be decomposed into smaller sub-patterns , such as straight lines and curves . An outlier can be successfully reconstructed when composed of a subset of components existing in the training data . To demonstrate the effect of compositionality in outlier reconstruction , we make two synthetic datasets both of which are clearly out-of-distribution with respect to MNIST . The first dataset is HalfMNIST ( the seventh column in Figure 1 ) , consisting of MNIST images with a randomly chosen upper or lower half replaced by zero pixels . ChimeraMNIST ( the last column in Figure 1 ) , the second dataset , is a set of images generated by concatenating upper and lower halves of two randomly chosen digits . Although these images are not in the convex hull of MNIST digits , they share components found in MNIST . As shown in Figure 1 , an autoencoder trained on MNIST have no problem reconstructing them . The classification AUCs from the reconstruction error are 0.482 for HalfMNIST and 0.69 for ChimeraMNIST , indicating poor classification . It seems that an autoencoder learns to reconstruct each part of an image separately but is not able to judge whether the combination of the parts is valid as a whole . This compositional way of processing facilitates generalization of a model ( Keysers et al. , 2019 ) , but the generalization of reconstruction in OOD inputs is not desirable for an autoencoder-based outlier detector . Distributed representation We suspect the outlier reconstruction due to compositional processing may be attributed to the distributed representation ( Mikolov et al. , 2013 ) used in an autoencoder . To show the effect of the distributed representation , we train autoencoders on MNIST with the digit 9 excluded ( MNISTnot9 ) and measure the reconstruction error of the digit 9 ( MNIST9 ) under multiple values of latent dimensionality Dz . Figure 3 shows the result . We observe the outlier reconstruction of MNIST9 possibly due to the compositional processing mentioned above . However , the outlier reconstruction occurs only when Dz is large . The latent representation is more distribution for large Dz , as a larger number of hidden neurons are used to represent an input . This observation suggests that the distributed representation used in an autoencoder enables the compositional processing and thus facilitates outlier reconstruction . Meanwhile , the model we propose shortly is not vulnerable to outlier reconstruction in all cases we examined above , as shown in Figure 1 , Figure 2 , and Table 1 , even though it is based on the same autoencoder architecture .
The authors address an important problem of autoencoders having low reconstruction error for OOD instances. They use the regular inlier reconstruction loss minimization with an additional term to maximize reconstruction loss for fake sampled OOD instances. A two stage Langevin Monte Carlo sampling technique is used for sampling in the proposed EBAE framework to generate diverse samples. Empirical analysis reveals that the proposed method outperforms existing autoencoder baselines. Some of my concerns with this paper are the following
SP:ce02279c05b6c1d89e80f8d2ce16403aa2586ad6
C-Learning: Learning to Achieve Goals via Recursive Classification
1 INTRODUCTION . In this paper , we aim to reframe the goal-conditioned reinforcement learning ( RL ) problem as one of predicting and controlling the future state of the world . This reframing is useful not only because it suggests a new algorithm for goal-conditioned RL , but also because it explains a commonly used heuristic in prior methods , and suggests how to automatically choose an important hyperparameter . The problem of predicting the future amounts to learning a probability density function over future states , agnostic of the time that a future state is reached . The future depends on the actions taken by the policy , so our predictions should depend on the agent ’ s policy . While we could simply witness the future , and fit a density model to the observed states , we will be primarily interested in the following prediction question : Given experience collected from one policy , can we predict what states a different policy will visit ? Once we can predict the future states of a different policy , we can control the future by choosing a policy that effects a desired future . While conceptually similar to Q-learning , our perspective is different in that we make no reliance on reward functions . Instead , an agent can solve the prediction problem before being given a reward function , similar to models in model-based RL . Reward functions can require human supervision to construct and evaluate , so a fully autonomous agent can learn to solve this prediction problem before being provided any human supervision , and reuse its predictions to solve many different downstream tasks . Nonetheless , when a reward function is provided , the agent can estimate its expected reward under the predicted future state distribution . This perspective is different from prior approaches . For example , directly fitting a density model to future states only solves the prediction problem in the on-policy setting , precluding us from predicting where a different policy will go . Model-based approaches , which learn an explicit dynamics model , do allow us to predict the future state distribution of different policies , but require a reward function or distance metric to learn goal-reaching policies for controlling the future . Methods based on temporal difference ( TD ) learning ( Sutton , 1988 ) have been used to predict the future state distribution ( Dayan , 1993 ; 1Project website with videos and code : https : //ben-eysenbach.github.io/c_learning/ Szepesvari et al. , 2014 ; Barreto et al. , 2017 ) and to learn goal-reaching policies ( Kaelbling , 1993 ; Schaul et al. , 2015 ) . Section 3 will explain why these approaches do not learn a true Q function in continuous environments with sparse rewards , and it remains unclear what the learned Q function corresponds to . In contrast , our method will estimate a well defined classifier . Since it is unclear how to use Q-learning to estimate such a density , we instead adopt a contrastive approach , learning a classifier to distinguish “ future states ” from random states , akin to Gutmann & Hyvärinen ( 2010 ) . After learning this binary classifier , we apply Bayes ’ rule to obtain a probability density function for the future state distribution , thus solving our prediction problem . While this initial approach requires on-policy data , we then develop a bootstrapping variant for estimating the future state distribution for different policies . This bootstrapping procedure is the core of our goalconditioned RL algorithm . The main contribution of our paper is a reframing of goal-conditioned RL as estimating the probability density over future states . We derive a method for solving this problem , C-learning , which we use to construct a complete algorithm for goal-conditioned RL . Our reframing lends insight into goalconditioned Q-learning , leading to a hypothesis for the optimal ratio for sampling goals , which we demonstrate empirically . Experiments demonstrate that C-learning more accurately estimates the density over future states , while remaining competitive with recent goal-conditioned RL methods across a suite of simulated robotic tasks . 2 RELATED WORK . Common goal-conditioned RL algorithms are based on behavior cloning ( Ghosh et al. , 2019 ; Ding et al. , 2019 ; Gupta et al. , 2019 ; Eysenbach et al. , 2020 ; Lynch et al. , 2020 ; Oh et al. , 2018 ; Sun et al. , 2019 ) , model-based approaches ( Nair et al. , 2020 ; Ebert et al. , 2018 ) , Q-learning ( Kaelbling , 1993 ; Schaul et al. , 2015 ; Pong et al. , 2018 ) , and semi-parametric planning ( Savinov et al. , 2018 ; Eysenbach et al. , 2019 ; Nasiriany et al. , 2019 ; Chaplot et al. , 2020 ) . Most prior work on goalconditioned RL relies on manually-specified reward functions or distance metric , limiting the applicability to high-dimensional tasks . Our method will be most similar to the Q-learning methods , which are applicable to off-policy data . These Q-learning methods often employ hindsight relabeling ( Kaelbling , 1993 ; Andrychowicz et al. , 2017 ) , whereby experience is modified by changing the commanded goal . New goals are often taken to be a future state or a random state , with the precise ratio being a sensitive hyperparameter . We emphasize that our discussion of goal sampling concerns relabeling previously-collected experience , not on the orthogonal problem of sampling goals for exploration ( Pong et al. , 2018 ; Fang et al. , 2019 ; Pitis et al. , 2020 ) . Our work is closely related to prior methods that use TD-learning to predict the future state distribution , such as successor features ( Dayan , 1993 ; Barreto et al. , 2017 ; 2019 ; Szepesvari et al. , 2014 ) and generalized value functions ( Sutton & Tanner , 2005 ; Schaul et al. , 2015 ; Schroecker & Isbell , 2020 ) . Our approach bears a resemblance to these prior TD-learning methods , offering insight into why they work and how hyperparameters such as the goal-sampling ratio should be selected . Our approach differs in that it does not require a reward function or manually designed relabeling strategies , with the corresponding components being derived from first principles . While prior work on off-policy evaluation ( Liu et al. , 2018 ; Nachum et al. , 2019 ) also aims to predict the future state distribution , our work differs is that we describe how to control the future state distribution , leading to goal-conditioned RL algorithm . Our approach is similar to prior work on noise contrastive estimation ( Gutmann & Hyvärinen , 2010 ) , mutual-information based representation learning ( Oord et al. , 2018 ; Nachum et al. , 2018 ) , and variational inference methods ( Bickel et al. , 2007 ; Uehara et al. , 2016 ; Dumoulin et al. , 2016 ; Huszár , 2017 ; Sønderby et al. , 2016 ) . Like prior work on the probabilistic perspective on RL ( Kappen , 2005 ; Todorov , 2008 ; Theodorou et al. , 2010 ; Ziebart , 2010 ; Rawlik et al. , 2013 ; Ortega & Braun , 2013 ; Levine , 2018 ) , we treat control as a density estimation problem , but our main contribution is orthogonal : we propose a method for estimating the future state distribution , which can be used as a subroutine in both standard RL and these probabilistic RL methods . 3 PRELIMINARIES . We start by introducing notation and prior approaches to goal-conditioned RL . We define a controlled Markov process by an initial state distribution p1 ( s1 ) and dynamics function p ( st+1 | st , at ) . We control this process by a Markovian policy πθ ( at | st ) with parameters θ . We use πθ ( at | st , g ) to denote a goal-oriented policy , which is additionally conditioned on a goal g ∈ S . We use st+ to denote the random variable representing a future observation , defined by the following distribution : Definition 1 . The future γ−discounted state density function is pπ+ ( st+ | st , at ) , ( 1− γ ) ∞∑ ∆=1 γ∆pπ∆ ( st+∆ = st+ | st , at ) , where st+∆ denotes the state exactly ∆ in the future , and constant ( 1− γ ) ensures that this density function integrates to 1 . This density reflects the states that an agent would visit if we collected many infinite-length trajectories and weighted states in the near-term future more highly . Equivalently , p ( st+ ) can be seen as the distribution over terminal states we would obtain if we ( hypothetically ) terminated episodes at a random time step , sampled from a geometric distribution . We need not introduce a reward function to define the problems of predicting and controlling the future . In discrete state spaces , we can convert the problem of estimating the future state distribution into a RL problem by defining a reward function rst+ ( st , at ) = 1 ( st = st+ ) , and terminating the episode when the agent arrives at the goal . The Q-function , which typically represents the expected discounted sum of future rewards , can then be interpreted as a ( scaled ) probability mass function : Qπ ( st , at , st+ ) = Eπ [ ∑ t γtrst+ ( st , at ) ] = ∑ t γtPπ ( st = st+ ) = 1 1− γ pπ+ ( st+ | st , at ) . However , in continuous state spaces with some stochasticity in the policy or dynamics , the probability that any state exactly matches the goal state is zero . Remark 1 . In a stochastic , continuous environment , for any policy π the Q-function for the reward function rst+ = 1 ( st = st+ ) is always zero : Q π ( st , at , st+ ) = 0 . This Q-function is not useful for predicting or controlling the future state distribution . Fundamentally , this problem arises because the relationship between the reward function , the Q function , and the future state distribution in prior work remains unclear . Prior work avoids this issue by manually defining reward functions ( Andrychowicz et al. , 2017 ) or distance metrics ( Schaul et al. , 2015 ; Pong et al. , 2018 ; Zhao et al. , 2019 ; Schroecker & Isbell , 2020 ) . An alternative is to use hindsight relabeling , changing the commanded goal to be the goal actually reached . This form of hindsight relabeling does not require a reward function , and indeed learns Q-functions that are not zero ( Lin et al. , 2019 ) . However , taken literally , Q-functions learned in this way must be incorrect : they do not reflect the expected discounted reward . An alternative hypothesis is that these Q-functions reflect probability density functions over future states . However , this also can not be true : Remark 2 . For any MDP with the sparse reward function 1 ( st = st+ ) where the episode terminates upon reaching the goal , Q-learning with hindsight relabeling acquires a Q-function in the range Qπ ( st , at , st+ ) ∈ [ 0 , 1 ] , but the probability density function pπ+ ( st+ | st , at ) has a range [ 0 , ∞ ) . For example , if the state space is S = [ 0 , 12 ] , then there must exist some state st+ such that Qπ ( st , at , st+1 ) ≤ 1 < pπ+ ( st+ = st+ | st , at ) . See Appendix H for two worked examples . Thus , Q-learning with hindsight relabeling also fails to learn the future state distribution . In fact , it is unclear what quantity Q-learning with hindsight relabeling optimizes . In the rest of this paper , we will define goal reaching in continuous state spaces in a way that is consistent and admits well-defined solutions ( Sec . 4 ) , and then present a practical algorithm for finding these solutions ( Sec . 5 ) .
The authors propose a new algorithm, called C-learning, which tackles goal-conditioned reinforcement learning problems. Specifically, the algorithm converts the future density estimation problem, which goal-conditioned Q learning is inherently performing, to a classification problem. The experiments showed that the modification allows a more precise density estimation than Q-learning, and in turn, a good final policy.
SP:14f7771d7e9c3d3f728ae24720d22847b08ac7a1
C-Learning: Learning to Achieve Goals via Recursive Classification
1 INTRODUCTION . In this paper , we aim to reframe the goal-conditioned reinforcement learning ( RL ) problem as one of predicting and controlling the future state of the world . This reframing is useful not only because it suggests a new algorithm for goal-conditioned RL , but also because it explains a commonly used heuristic in prior methods , and suggests how to automatically choose an important hyperparameter . The problem of predicting the future amounts to learning a probability density function over future states , agnostic of the time that a future state is reached . The future depends on the actions taken by the policy , so our predictions should depend on the agent ’ s policy . While we could simply witness the future , and fit a density model to the observed states , we will be primarily interested in the following prediction question : Given experience collected from one policy , can we predict what states a different policy will visit ? Once we can predict the future states of a different policy , we can control the future by choosing a policy that effects a desired future . While conceptually similar to Q-learning , our perspective is different in that we make no reliance on reward functions . Instead , an agent can solve the prediction problem before being given a reward function , similar to models in model-based RL . Reward functions can require human supervision to construct and evaluate , so a fully autonomous agent can learn to solve this prediction problem before being provided any human supervision , and reuse its predictions to solve many different downstream tasks . Nonetheless , when a reward function is provided , the agent can estimate its expected reward under the predicted future state distribution . This perspective is different from prior approaches . For example , directly fitting a density model to future states only solves the prediction problem in the on-policy setting , precluding us from predicting where a different policy will go . Model-based approaches , which learn an explicit dynamics model , do allow us to predict the future state distribution of different policies , but require a reward function or distance metric to learn goal-reaching policies for controlling the future . Methods based on temporal difference ( TD ) learning ( Sutton , 1988 ) have been used to predict the future state distribution ( Dayan , 1993 ; 1Project website with videos and code : https : //ben-eysenbach.github.io/c_learning/ Szepesvari et al. , 2014 ; Barreto et al. , 2017 ) and to learn goal-reaching policies ( Kaelbling , 1993 ; Schaul et al. , 2015 ) . Section 3 will explain why these approaches do not learn a true Q function in continuous environments with sparse rewards , and it remains unclear what the learned Q function corresponds to . In contrast , our method will estimate a well defined classifier . Since it is unclear how to use Q-learning to estimate such a density , we instead adopt a contrastive approach , learning a classifier to distinguish “ future states ” from random states , akin to Gutmann & Hyvärinen ( 2010 ) . After learning this binary classifier , we apply Bayes ’ rule to obtain a probability density function for the future state distribution , thus solving our prediction problem . While this initial approach requires on-policy data , we then develop a bootstrapping variant for estimating the future state distribution for different policies . This bootstrapping procedure is the core of our goalconditioned RL algorithm . The main contribution of our paper is a reframing of goal-conditioned RL as estimating the probability density over future states . We derive a method for solving this problem , C-learning , which we use to construct a complete algorithm for goal-conditioned RL . Our reframing lends insight into goalconditioned Q-learning , leading to a hypothesis for the optimal ratio for sampling goals , which we demonstrate empirically . Experiments demonstrate that C-learning more accurately estimates the density over future states , while remaining competitive with recent goal-conditioned RL methods across a suite of simulated robotic tasks . 2 RELATED WORK . Common goal-conditioned RL algorithms are based on behavior cloning ( Ghosh et al. , 2019 ; Ding et al. , 2019 ; Gupta et al. , 2019 ; Eysenbach et al. , 2020 ; Lynch et al. , 2020 ; Oh et al. , 2018 ; Sun et al. , 2019 ) , model-based approaches ( Nair et al. , 2020 ; Ebert et al. , 2018 ) , Q-learning ( Kaelbling , 1993 ; Schaul et al. , 2015 ; Pong et al. , 2018 ) , and semi-parametric planning ( Savinov et al. , 2018 ; Eysenbach et al. , 2019 ; Nasiriany et al. , 2019 ; Chaplot et al. , 2020 ) . Most prior work on goalconditioned RL relies on manually-specified reward functions or distance metric , limiting the applicability to high-dimensional tasks . Our method will be most similar to the Q-learning methods , which are applicable to off-policy data . These Q-learning methods often employ hindsight relabeling ( Kaelbling , 1993 ; Andrychowicz et al. , 2017 ) , whereby experience is modified by changing the commanded goal . New goals are often taken to be a future state or a random state , with the precise ratio being a sensitive hyperparameter . We emphasize that our discussion of goal sampling concerns relabeling previously-collected experience , not on the orthogonal problem of sampling goals for exploration ( Pong et al. , 2018 ; Fang et al. , 2019 ; Pitis et al. , 2020 ) . Our work is closely related to prior methods that use TD-learning to predict the future state distribution , such as successor features ( Dayan , 1993 ; Barreto et al. , 2017 ; 2019 ; Szepesvari et al. , 2014 ) and generalized value functions ( Sutton & Tanner , 2005 ; Schaul et al. , 2015 ; Schroecker & Isbell , 2020 ) . Our approach bears a resemblance to these prior TD-learning methods , offering insight into why they work and how hyperparameters such as the goal-sampling ratio should be selected . Our approach differs in that it does not require a reward function or manually designed relabeling strategies , with the corresponding components being derived from first principles . While prior work on off-policy evaluation ( Liu et al. , 2018 ; Nachum et al. , 2019 ) also aims to predict the future state distribution , our work differs is that we describe how to control the future state distribution , leading to goal-conditioned RL algorithm . Our approach is similar to prior work on noise contrastive estimation ( Gutmann & Hyvärinen , 2010 ) , mutual-information based representation learning ( Oord et al. , 2018 ; Nachum et al. , 2018 ) , and variational inference methods ( Bickel et al. , 2007 ; Uehara et al. , 2016 ; Dumoulin et al. , 2016 ; Huszár , 2017 ; Sønderby et al. , 2016 ) . Like prior work on the probabilistic perspective on RL ( Kappen , 2005 ; Todorov , 2008 ; Theodorou et al. , 2010 ; Ziebart , 2010 ; Rawlik et al. , 2013 ; Ortega & Braun , 2013 ; Levine , 2018 ) , we treat control as a density estimation problem , but our main contribution is orthogonal : we propose a method for estimating the future state distribution , which can be used as a subroutine in both standard RL and these probabilistic RL methods . 3 PRELIMINARIES . We start by introducing notation and prior approaches to goal-conditioned RL . We define a controlled Markov process by an initial state distribution p1 ( s1 ) and dynamics function p ( st+1 | st , at ) . We control this process by a Markovian policy πθ ( at | st ) with parameters θ . We use πθ ( at | st , g ) to denote a goal-oriented policy , which is additionally conditioned on a goal g ∈ S . We use st+ to denote the random variable representing a future observation , defined by the following distribution : Definition 1 . The future γ−discounted state density function is pπ+ ( st+ | st , at ) , ( 1− γ ) ∞∑ ∆=1 γ∆pπ∆ ( st+∆ = st+ | st , at ) , where st+∆ denotes the state exactly ∆ in the future , and constant ( 1− γ ) ensures that this density function integrates to 1 . This density reflects the states that an agent would visit if we collected many infinite-length trajectories and weighted states in the near-term future more highly . Equivalently , p ( st+ ) can be seen as the distribution over terminal states we would obtain if we ( hypothetically ) terminated episodes at a random time step , sampled from a geometric distribution . We need not introduce a reward function to define the problems of predicting and controlling the future . In discrete state spaces , we can convert the problem of estimating the future state distribution into a RL problem by defining a reward function rst+ ( st , at ) = 1 ( st = st+ ) , and terminating the episode when the agent arrives at the goal . The Q-function , which typically represents the expected discounted sum of future rewards , can then be interpreted as a ( scaled ) probability mass function : Qπ ( st , at , st+ ) = Eπ [ ∑ t γtrst+ ( st , at ) ] = ∑ t γtPπ ( st = st+ ) = 1 1− γ pπ+ ( st+ | st , at ) . However , in continuous state spaces with some stochasticity in the policy or dynamics , the probability that any state exactly matches the goal state is zero . Remark 1 . In a stochastic , continuous environment , for any policy π the Q-function for the reward function rst+ = 1 ( st = st+ ) is always zero : Q π ( st , at , st+ ) = 0 . This Q-function is not useful for predicting or controlling the future state distribution . Fundamentally , this problem arises because the relationship between the reward function , the Q function , and the future state distribution in prior work remains unclear . Prior work avoids this issue by manually defining reward functions ( Andrychowicz et al. , 2017 ) or distance metrics ( Schaul et al. , 2015 ; Pong et al. , 2018 ; Zhao et al. , 2019 ; Schroecker & Isbell , 2020 ) . An alternative is to use hindsight relabeling , changing the commanded goal to be the goal actually reached . This form of hindsight relabeling does not require a reward function , and indeed learns Q-functions that are not zero ( Lin et al. , 2019 ) . However , taken literally , Q-functions learned in this way must be incorrect : they do not reflect the expected discounted reward . An alternative hypothesis is that these Q-functions reflect probability density functions over future states . However , this also can not be true : Remark 2 . For any MDP with the sparse reward function 1 ( st = st+ ) where the episode terminates upon reaching the goal , Q-learning with hindsight relabeling acquires a Q-function in the range Qπ ( st , at , st+ ) ∈ [ 0 , 1 ] , but the probability density function pπ+ ( st+ | st , at ) has a range [ 0 , ∞ ) . For example , if the state space is S = [ 0 , 12 ] , then there must exist some state st+ such that Qπ ( st , at , st+1 ) ≤ 1 < pπ+ ( st+ = st+ | st , at ) . See Appendix H for two worked examples . Thus , Q-learning with hindsight relabeling also fails to learn the future state distribution . In fact , it is unclear what quantity Q-learning with hindsight relabeling optimizes . In the rest of this paper , we will define goal reaching in continuous state spaces in a way that is consistent and admits well-defined solutions ( Sec . 4 ) , and then present a practical algorithm for finding these solutions ( Sec . 5 ) .
This paper studies to predict future state density function by using an indirectly method via classification. The main idea is to sample the future state from two sources: 1) from replay buffer, 2) the actual next state in the trajectory (in off policy setting we only need the next state) and then use a classifier to distinguish them. By Bayesian rule we can recalculate the conditional density function by the ratio of the classifier. The paper compare this method with several baseline and find that they can predict the conditional density function very close to reality.
SP:14f7771d7e9c3d3f728ae24720d22847b08ac7a1
Gradient Projection Memory for Continual Learning
1 INTRODUCTION . Humans exhibit remarkable ability in continual adaptation and learning new tasks throughout their lifetime while maintaining the knowledge gained from past experiences . In stark contrast , Artificial Neural Networks ( ANNs ) under such Continual Learning ( CL ) paradigm ( Ring , 1998 ; Thrun & Mitchell , 1995 ; Lange et al. , 2021 ) forget the information learned in the past tasks upon learning new ones . This phenomenon is known as ‘ Catastrophic Forgetting ’ or ‘ Catastrophic Interference ’ ( Mccloskey & Cohen , 1989 ; Ratcliff , 1990 ) . The problem is rooted in the general optimization methods ( Goodfellow et al. , 2016 ) that are being used to encode input data distribution into the parametric representation of the network during training . Upon exposure to a new task , gradient-based optimization methods , without any constraint , change the learned encoding to minimize the objective function with respect to the current data distribution . Such parametric updates lead to forgetting . Given a fixed capacity network , one way to address this problem is to put constraints on the gradient updates so that task specific knowledge can be preserved . To this end , Kirkpatrick et al . ( 2017 ) , Zenke et al . ( 2017 ) , Aljundi et al . ( 2018 ) , Serrà et al . ( 2018 ) add a penalty term to the objective function while optimizing for new task . Such term acts as a structural regularizer and dictates the degree of stability-plasticity of individual weights . Though these methods provide resource efficient solution to the catastrophic forgetting problem , their performance suffer while learning longer task sequence and when task identity is unavailable during inference . Approaches ( Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ) that store episodic memories of old data essentially solve an optimization problem with ‘ explicit ’ constraints on the new gradient directions so that losses for the old task do not increase . In Chaudhry et al . ( 2019b ) the performance of old task is retained by taking gradient steps in the average gradient direction obtained from the new data and memory samples . To minimize interference , Farajtabar et al . ( 2020 ) store gradient directions ( instead of data ) of the old tasks and optimize the network in the orthogonal directions to these gradients for the new task , whereas Zeng et al . ( 2018 ) update gradients orthogonal to the old input directions using projector matrices calculated iteratively during training . However , these methods either compromise data privacy by storing raw data or utilize resources poorly , which limits their scalability . 1Our code is available at https : //github.com/sahagobinda/GPM In this paper , we address the problem of catastrophic forgetting in a fixed capacity network when data from the old tasks are not available . To mitigate forgetting , our approach puts explicit constraints on the gradient directions that the optimizer can take . However , unlike contemporary methods , we neither store old gradient directions nor store old examples for generating reference directions . Instead we propose an approach that , after learning each task , partitions the entire gradient space of the weights into two orthogonal subspaces : Core Gradient Space ( CGS ) and Residual Gradient Space ( RGS ) ( Saha et al. , 2020 ) . Leveraging the relationship between the input and the gradient spaces , we show how learned representations ( activations ) form the bases of these gradient subspaces in both fully-connected and convolutional networks . Using Singular Value Decomposition ( SVD ) on these activations , we show how to obtain the minimum set of bases of the CGS by which past knowledge is preserved and learnability for the new tasks is ensured . We store these bases in the memory which we define as Gradient Projection Memory ( GPM ) . In our method , we propose to learn any new task by taking gradient steps in the orthogonal direction to the space ( CGS ) spanned by the GPM . Our analysis shows that such orthogonal gradient descent induces minimum to no interference with the old learning , and thus effective in alleviating catastrophic forgetting . We evaluate our approach in the context of image classification with miniImageNet , CIFAR-100 , PMNIST and sequence of 5-Datasets on a variety of network architectures including ResNet . We compare our method with related state-of-the-art approaches and report comparable or better classification performance . Overall , we show that our method is memory efficient and scalable to complex dataset with longer task sequence while preserving data privacy . 2 RELATED WORKS . Approaches to continual learning for ANNs can be broadly divided into three categories . In this section we present a detailed discussion on the representative works from each category , highlighting their contributions and differences with our approach . Expansion-based methods : Methods in this category overcome catastrophic forgetting by dedicating different subsets of network parameters to each task . With no constraint on network architecture , Progressive Neural Network ( PGN ) ( Rusu et al. , 2016 ) preserves old knowledge by freezing the base model and adding new sub-networks with lateral connections for each new task . Dynamically Expandable Networks ( DEN ) ( Yoon et al. , 2018 ) either retrains or expands the network by splitting/duplicating important units on new tasks , whereas Sarwar et al . ( 2020 ) grow the network to learn new tasks while sharing part of the base network . Li et al . ( 2019 ) with neural architecture search ( NAS ) find optimal network structures for each sequential task . RCL ( Xu & Zhu , 2018 ) adaptively expands the network at each layer using reinforcement learning , whereas APD ( Yoon et al. , 2020 ) additively decomposes the parameters into shared and task specific parameters to minimize the increase in the network complexity . In contrast , our method avoids network growth or expensive NAS operations and performs sequential learning within a fixed network architecture . Regularization-based methods : These methods attempt to overcome forgetting in fixed capacity model through structural regularization which penalizes major changes in the parameters that were important for the previous tasks . Elastic Weight Consolidation ( EWC ) ( Kirkpatrick et al. , 2017 ) computes such importance from diagonal of Fisher information matrix after training , whereas Zenke et al . ( 2017 ) compute them during training based on loss sensitivity with respect to the parameters . Additionally , Aljundi et al . ( 2018 ) compute importance from sensitivity of model outputs to the inputs . Other methods , such as PackNet ( Mallya & Lazebnik , 2018 ) uses iterative pruning to fully restrict gradient updates on important weights via binary mask , whereas HAT ( Serrà et al. , 2018 ) identifies important neurons by learning attention masks that control gradient propagation in the individual parameters . Saha et al . ( 2020 ) using a PCA based pruning on activations ( Garg et al. , 2020 ) partition the parametric space of the weights ( filters ) into core and residual ( filter ) spaces after learning each task . The past knowledge is preserved in the frozen core space , whereas the residual space is updated when learning the next task . In contrast to these methods , we do not ascribe importance to or restrict the gradients of any individual parameters or filters . Rather we put constraints on the ‘ direction ’ of gradient descent . Memory-based methods : Methods under this class mitigate forgetting by either storing a subset of ( raw ) examples from the past tasks in the memory for rehearsal ( Robins , 1995 ; Rebuffi et al. , 2017 ; Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ; b ; Riemer et al. , 2019 ) or synthesizing old data from generative models to perform pseudo-rehearsal ( Shin et al. , 2017 ) . For instance , Gradient Episodic Memory ( GEM ) ( Lopez-Paz & Ranzato , 2017 ) avoids interference with previous task by projecting the new gradients in the feasible region outlined by previous task gradients calculated from the samples of episodic memory . Averaged-GEM ( A-GEM ) ( Chaudhry et al. , 2019a ) simplified this optimization problem to projection in one direction estimated by randomly selected samples from the memory . Guo et al . ( 2020 ) propose a unified view of episodic memory-based CL methods , that include GEM and A-GEM and improves performance over these methods utilizing loss-balancing update rule . Additionally , Experience Replay ( ER ) ( Chaudhry et al. , 2019b ) and Meta-Experience Replay ( MER ) ( Riemer et al. , 2019 ) mitigate forgetting in online CL setup by jointly training on the samples from new tasks and episodic memory . All these methods , however , rely on the access to old data which might not be possible when users have concern over data privacy . Like all the memory-based methods we also use a storage unit which we call GPM . However , we do not save any raw data in GPM , thus satisfy data privacy criterion . Our method is closely related to recently proposed Orthogonal Gradient Descent ( OGD ) ( Farajtabar et al. , 2020 ) and Orthogonal Weight Modulation ( OWM ) ( Zeng et al. , 2018 ) . OGD stores a set of gradient directions in the memory for each task and minimizes catastrophic forgetting by taking gradient steps in the orthogonal directions for new tasks . In contrast to OGD , we compute and store the bases of core gradient space from network representations ( activations ) which reduces the memory requirement by orders of magnitude . Moreover , OGD is shown to work under locality assumption for small learning rates which limits its scalability in learning longer task sequences with complex dataset . Since our method does not use gradient directions ( like OGD ) to describe the core gradient spaces , we do not need to obey such assumptions , thus can use higher learning rates . On the other hand , OWM reduces forgetting by modifying the weights of the network in the orthogonal to the input directions of the past tasks . This is achieved by multiplying new gradients with projector matrices . These matrices are computed from the stored past projectors and the inputs with recursive least square ( RLS ) method at each training step . However , such an iterative method not only slows down the training process but also shows limited scalability in end-to-end task learning with modern network architectures . Like OWM , we aim to encode new learning in the orthogonal to the old input directions . In contrast to iterative projector computation in OWM , we identify a low-dimensional subspace in the gradient space analyzing the learned representations with SVD in one-shot manner at the end of each task . We store the bases of these subspaces in GPM and learn new tasks in the orthogonal to these spaces to protect old knowledge . We quantitatively show that our method is memory efficient , fast and scalable to deeper networks for complex long sequence of tasks . 3 NOTATIONS AND BACKGROUND . In this section , we introduce the notations used throughout the paper and give a brief overview of SVD for matrix approximation . In section 4 , we establish the relationship between input and gradient spaces . In section 5 we show the steps of our algorithm that leverage such relationship . Continual Learning : We consider supervised learning setup where T tasks are learned sequentially . Each task has a task descriptor , τ ∈ { 1 , 2 .... , T } with a corresponding dataset , Dτ = { ( xi , τ , yi , τ ) nτi=1 } having nτ example pairs . Let ’ s consider an L layer neural network where at each layer network computes the following function for task τ : xl+1i , τ = σ ( f ( W l τ , x l i , τ ) ) . ( 1 ) Here , l = 1 , ... L , σ ( . ) is a non-linear function and f ( . , . ) is a linear function . We will use vector notation for input ( xi , τ ) in fully connected layers and matrix notation for input ( Xi , τ ) in convolutional layers . At the first layer , x1i , τ = xi , τ represents the raw input data from task τ , whereas in the subsequent layers we define xli , τ as the representation of input xi , τ at layer l. Set of parameters of the network is defined by , Wτ = { ( W lτ ) Ll=1 } , where W0 denotes set of parameters at initialization . Matrix approximation with SVD : SVD can be used to factorize a rectangular matrix , A = UΣV T ∈ Rm×n into the product of three matrices , where U ∈ Rm×m and V ∈ Rn×n are orthogonal , and Σ contains the sorted singular values along its main diagonal ( Deisenroth et al. , 2020 ) . If the rank of the matrix is r ( r ≤ min ( m , n ) ) , A can be expressed as A = ∑r i=1 σiuiv T i , where ui ∈ U and vi ∈ V are left and right singular vectors and σi ∈ diag ( Σ ) are singular values . Also , k-rank approximation to this matrix can be expressed as , Ak = ∑k i=1 σiuiv T i , where k ≤ r and its value can be chosen by the smallest k that satisfies ||Ak||2F ≥ th||A||2F . Here , ||.||F is the Frobenius norm of the matrix and th ( 0 < th ≤ 1 ) is the threshold hyperparameter .
This work targets learning multi-class classifiers in the continual learning setting. The key idea is to learn new tasks by taking gradient steps in directions orthogonal to the gradient subspaces marked as crucial for previous past tasks. The method employs SVD after learning each task to find the crucial subspaces (which it calls as Core Gradient Subspaces) and stores them in a memory. Reasonable quantitative and qualitative evaluation has been performed to compare the method against existing SOTA baselines.
SP:4df83f99f68580ffe805e3826ea01f4a0c5dc523
Gradient Projection Memory for Continual Learning
1 INTRODUCTION . Humans exhibit remarkable ability in continual adaptation and learning new tasks throughout their lifetime while maintaining the knowledge gained from past experiences . In stark contrast , Artificial Neural Networks ( ANNs ) under such Continual Learning ( CL ) paradigm ( Ring , 1998 ; Thrun & Mitchell , 1995 ; Lange et al. , 2021 ) forget the information learned in the past tasks upon learning new ones . This phenomenon is known as ‘ Catastrophic Forgetting ’ or ‘ Catastrophic Interference ’ ( Mccloskey & Cohen , 1989 ; Ratcliff , 1990 ) . The problem is rooted in the general optimization methods ( Goodfellow et al. , 2016 ) that are being used to encode input data distribution into the parametric representation of the network during training . Upon exposure to a new task , gradient-based optimization methods , without any constraint , change the learned encoding to minimize the objective function with respect to the current data distribution . Such parametric updates lead to forgetting . Given a fixed capacity network , one way to address this problem is to put constraints on the gradient updates so that task specific knowledge can be preserved . To this end , Kirkpatrick et al . ( 2017 ) , Zenke et al . ( 2017 ) , Aljundi et al . ( 2018 ) , Serrà et al . ( 2018 ) add a penalty term to the objective function while optimizing for new task . Such term acts as a structural regularizer and dictates the degree of stability-plasticity of individual weights . Though these methods provide resource efficient solution to the catastrophic forgetting problem , their performance suffer while learning longer task sequence and when task identity is unavailable during inference . Approaches ( Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ) that store episodic memories of old data essentially solve an optimization problem with ‘ explicit ’ constraints on the new gradient directions so that losses for the old task do not increase . In Chaudhry et al . ( 2019b ) the performance of old task is retained by taking gradient steps in the average gradient direction obtained from the new data and memory samples . To minimize interference , Farajtabar et al . ( 2020 ) store gradient directions ( instead of data ) of the old tasks and optimize the network in the orthogonal directions to these gradients for the new task , whereas Zeng et al . ( 2018 ) update gradients orthogonal to the old input directions using projector matrices calculated iteratively during training . However , these methods either compromise data privacy by storing raw data or utilize resources poorly , which limits their scalability . 1Our code is available at https : //github.com/sahagobinda/GPM In this paper , we address the problem of catastrophic forgetting in a fixed capacity network when data from the old tasks are not available . To mitigate forgetting , our approach puts explicit constraints on the gradient directions that the optimizer can take . However , unlike contemporary methods , we neither store old gradient directions nor store old examples for generating reference directions . Instead we propose an approach that , after learning each task , partitions the entire gradient space of the weights into two orthogonal subspaces : Core Gradient Space ( CGS ) and Residual Gradient Space ( RGS ) ( Saha et al. , 2020 ) . Leveraging the relationship between the input and the gradient spaces , we show how learned representations ( activations ) form the bases of these gradient subspaces in both fully-connected and convolutional networks . Using Singular Value Decomposition ( SVD ) on these activations , we show how to obtain the minimum set of bases of the CGS by which past knowledge is preserved and learnability for the new tasks is ensured . We store these bases in the memory which we define as Gradient Projection Memory ( GPM ) . In our method , we propose to learn any new task by taking gradient steps in the orthogonal direction to the space ( CGS ) spanned by the GPM . Our analysis shows that such orthogonal gradient descent induces minimum to no interference with the old learning , and thus effective in alleviating catastrophic forgetting . We evaluate our approach in the context of image classification with miniImageNet , CIFAR-100 , PMNIST and sequence of 5-Datasets on a variety of network architectures including ResNet . We compare our method with related state-of-the-art approaches and report comparable or better classification performance . Overall , we show that our method is memory efficient and scalable to complex dataset with longer task sequence while preserving data privacy . 2 RELATED WORKS . Approaches to continual learning for ANNs can be broadly divided into three categories . In this section we present a detailed discussion on the representative works from each category , highlighting their contributions and differences with our approach . Expansion-based methods : Methods in this category overcome catastrophic forgetting by dedicating different subsets of network parameters to each task . With no constraint on network architecture , Progressive Neural Network ( PGN ) ( Rusu et al. , 2016 ) preserves old knowledge by freezing the base model and adding new sub-networks with lateral connections for each new task . Dynamically Expandable Networks ( DEN ) ( Yoon et al. , 2018 ) either retrains or expands the network by splitting/duplicating important units on new tasks , whereas Sarwar et al . ( 2020 ) grow the network to learn new tasks while sharing part of the base network . Li et al . ( 2019 ) with neural architecture search ( NAS ) find optimal network structures for each sequential task . RCL ( Xu & Zhu , 2018 ) adaptively expands the network at each layer using reinforcement learning , whereas APD ( Yoon et al. , 2020 ) additively decomposes the parameters into shared and task specific parameters to minimize the increase in the network complexity . In contrast , our method avoids network growth or expensive NAS operations and performs sequential learning within a fixed network architecture . Regularization-based methods : These methods attempt to overcome forgetting in fixed capacity model through structural regularization which penalizes major changes in the parameters that were important for the previous tasks . Elastic Weight Consolidation ( EWC ) ( Kirkpatrick et al. , 2017 ) computes such importance from diagonal of Fisher information matrix after training , whereas Zenke et al . ( 2017 ) compute them during training based on loss sensitivity with respect to the parameters . Additionally , Aljundi et al . ( 2018 ) compute importance from sensitivity of model outputs to the inputs . Other methods , such as PackNet ( Mallya & Lazebnik , 2018 ) uses iterative pruning to fully restrict gradient updates on important weights via binary mask , whereas HAT ( Serrà et al. , 2018 ) identifies important neurons by learning attention masks that control gradient propagation in the individual parameters . Saha et al . ( 2020 ) using a PCA based pruning on activations ( Garg et al. , 2020 ) partition the parametric space of the weights ( filters ) into core and residual ( filter ) spaces after learning each task . The past knowledge is preserved in the frozen core space , whereas the residual space is updated when learning the next task . In contrast to these methods , we do not ascribe importance to or restrict the gradients of any individual parameters or filters . Rather we put constraints on the ‘ direction ’ of gradient descent . Memory-based methods : Methods under this class mitigate forgetting by either storing a subset of ( raw ) examples from the past tasks in the memory for rehearsal ( Robins , 1995 ; Rebuffi et al. , 2017 ; Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ; b ; Riemer et al. , 2019 ) or synthesizing old data from generative models to perform pseudo-rehearsal ( Shin et al. , 2017 ) . For instance , Gradient Episodic Memory ( GEM ) ( Lopez-Paz & Ranzato , 2017 ) avoids interference with previous task by projecting the new gradients in the feasible region outlined by previous task gradients calculated from the samples of episodic memory . Averaged-GEM ( A-GEM ) ( Chaudhry et al. , 2019a ) simplified this optimization problem to projection in one direction estimated by randomly selected samples from the memory . Guo et al . ( 2020 ) propose a unified view of episodic memory-based CL methods , that include GEM and A-GEM and improves performance over these methods utilizing loss-balancing update rule . Additionally , Experience Replay ( ER ) ( Chaudhry et al. , 2019b ) and Meta-Experience Replay ( MER ) ( Riemer et al. , 2019 ) mitigate forgetting in online CL setup by jointly training on the samples from new tasks and episodic memory . All these methods , however , rely on the access to old data which might not be possible when users have concern over data privacy . Like all the memory-based methods we also use a storage unit which we call GPM . However , we do not save any raw data in GPM , thus satisfy data privacy criterion . Our method is closely related to recently proposed Orthogonal Gradient Descent ( OGD ) ( Farajtabar et al. , 2020 ) and Orthogonal Weight Modulation ( OWM ) ( Zeng et al. , 2018 ) . OGD stores a set of gradient directions in the memory for each task and minimizes catastrophic forgetting by taking gradient steps in the orthogonal directions for new tasks . In contrast to OGD , we compute and store the bases of core gradient space from network representations ( activations ) which reduces the memory requirement by orders of magnitude . Moreover , OGD is shown to work under locality assumption for small learning rates which limits its scalability in learning longer task sequences with complex dataset . Since our method does not use gradient directions ( like OGD ) to describe the core gradient spaces , we do not need to obey such assumptions , thus can use higher learning rates . On the other hand , OWM reduces forgetting by modifying the weights of the network in the orthogonal to the input directions of the past tasks . This is achieved by multiplying new gradients with projector matrices . These matrices are computed from the stored past projectors and the inputs with recursive least square ( RLS ) method at each training step . However , such an iterative method not only slows down the training process but also shows limited scalability in end-to-end task learning with modern network architectures . Like OWM , we aim to encode new learning in the orthogonal to the old input directions . In contrast to iterative projector computation in OWM , we identify a low-dimensional subspace in the gradient space analyzing the learned representations with SVD in one-shot manner at the end of each task . We store the bases of these subspaces in GPM and learn new tasks in the orthogonal to these spaces to protect old knowledge . We quantitatively show that our method is memory efficient , fast and scalable to deeper networks for complex long sequence of tasks . 3 NOTATIONS AND BACKGROUND . In this section , we introduce the notations used throughout the paper and give a brief overview of SVD for matrix approximation . In section 4 , we establish the relationship between input and gradient spaces . In section 5 we show the steps of our algorithm that leverage such relationship . Continual Learning : We consider supervised learning setup where T tasks are learned sequentially . Each task has a task descriptor , τ ∈ { 1 , 2 .... , T } with a corresponding dataset , Dτ = { ( xi , τ , yi , τ ) nτi=1 } having nτ example pairs . Let ’ s consider an L layer neural network where at each layer network computes the following function for task τ : xl+1i , τ = σ ( f ( W l τ , x l i , τ ) ) . ( 1 ) Here , l = 1 , ... L , σ ( . ) is a non-linear function and f ( . , . ) is a linear function . We will use vector notation for input ( xi , τ ) in fully connected layers and matrix notation for input ( Xi , τ ) in convolutional layers . At the first layer , x1i , τ = xi , τ represents the raw input data from task τ , whereas in the subsequent layers we define xli , τ as the representation of input xi , τ at layer l. Set of parameters of the network is defined by , Wτ = { ( W lτ ) Ll=1 } , where W0 denotes set of parameters at initialization . Matrix approximation with SVD : SVD can be used to factorize a rectangular matrix , A = UΣV T ∈ Rm×n into the product of three matrices , where U ∈ Rm×m and V ∈ Rn×n are orthogonal , and Σ contains the sorted singular values along its main diagonal ( Deisenroth et al. , 2020 ) . If the rank of the matrix is r ( r ≤ min ( m , n ) ) , A can be expressed as A = ∑r i=1 σiuiv T i , where ui ∈ U and vi ∈ V are left and right singular vectors and σi ∈ diag ( Σ ) are singular values . Also , k-rank approximation to this matrix can be expressed as , Ak = ∑k i=1 σiuiv T i , where k ≤ r and its value can be chosen by the smallest k that satisfies ||Ak||2F ≥ th||A||2F . Here , ||.||F is the Frobenius norm of the matrix and th ( 0 < th ≤ 1 ) is the threshold hyperparameter .
The paper proposes one of the most scalable approaches to sequential continual learning with known task boundaries and related tasks, while taking steps towards enforcing data privacy and removing some of the task label constraints. At all levels in expressive deep models, SVD is used on learned representations to identify important bases of task gradient spaces and a memory is populated with such directions. Learning progresses only in directions orthogonal to gradient memory. Several recent evaluation methodologies are used to empirically validate the approach with significant success.
SP:4df83f99f68580ffe805e3826ea01f4a0c5dc523
Intrinsically Guided Exploration in Meta Reinforcement Learning
1 INTRODUCTION . Human intelligence is able to transfer knowledge across tasks and acquire new skills within limited experiences . However , most reinforcement learning ( RL ) agents still require large amounts of data to achieve human-level performance ( Silver et al. , 2017 ; Hessel et al. , 2018 ; Vinyals et al. , 2019 ) . Meta reinforcement learning ( meta-RL ) makes a step toward such efficient learning by extracting prior knowledge from a set of tasks to quickly adapt to new tasks . However , efficient exploration of meta-RL needs to consider both training and adaptation phases simultaneously ( Ishii et al. , 2002 ) , which becomes a key challenge for meta-RL . One branch of meta-RL algorithms ( Finn et al. , 2017 ; Stadie et al. , 2018 ; Rothfuss et al. , 2019 ; Gurumurthy et al. , 2019 ) utilizes policies injected with time-irrelevant random noise for meta-training exploration , while another branch of methods ( Duan et al. , 2016 ; Mishra et al. , 2017 ; Gupta et al. , 2018 ; Zintgraf et al. , 2019 ; Rakelly et al. , 2019 ) introduces memories or latent variables that enable temporally-extended exploration behaviors . EPI ( Zhou et al. , 2018 ) introduces intrinsic rewards based on the improvement of dynamics prediction . However , these exploration mechanisms are still inefficient in either meta-training or adaptation and underperform in complex sparse-reward tasks . To address this challenge of meta-RL , we introduce information-theoretic intrinsic motivations for learning to collect informative trajectories and enable efficient exploration in both meta-training and adaptation . Inspired by the common task-inference component in context-based meta-RL algorithms ( such as PEARL ( Rakelly et al. , 2019 ) and VariBAD ( Zintgraf et al. , 2019 ) ) , we leverage an insight that exploration behaviors should collect trajectories that contain rich information gain about the current task , and design an exploration objective to maximize the information gain for inferring taskss . Based this objective , we derive an intrinsic reward for learning an effective exploration policy . To reduce variance from estimating information-gain intrinsic rewards in complex domains , we simplify and derive an intrinsic reward based on prediction errors to achieve superior stability and scalability . We develop a novel off-policy meta-RL algorithm , Meta-RL with effiCient Uncertainty Reduction Exploration ( MetaCURE ) , that incorporates our intrinsic rewards and separates exploration and exploitation policies . MetaCURE learns to perform sequential exploration behaviors to reduce task uncertainty across adaptation episodes and maximizes the expected extrinsic return in the last episode of the adaptation phase . During meta-training , MetaCURE collects training data from both exploration and exploitation policies . As for adaptation , the exploration policy collects informative trajectories , and then the exploitation policy utilizes gained experiences to maximize final performance . We evaluate our algorithm on various sparse-reward MuJoCo locomotion tasks as well as sparse-reward Meta-World tasks . Empirical results show that it outperforms baseline algorithms by a large margin . We also visualize how our algorithm explores in novel tasks and discuss the pros and cons of the two proposed intrinsic rewards . 2 BACKGROUND . In meta-RL , we consider a distribution of tasks p ( T ) , with each task T modelled as a Markov Decision Process ( MDP ) , which consists of a state space , an action space , a transition function and a reward function . In common meta-RL settings ( Duan et al. , 2016 ; Finn et al. , 2017 ; Zintgraf et al. , 2019 ; Rakelly et al. , 2019 ) , tasks differ in the transition and/or reward function , and we can describe a task T with a tuple 〈pT0 ( s0 ) , pT ( s′|s , a ) , rT ( s , a ) 〉 , with pT0 ( s0 ) the initial state distribution , pT ( s′|s , a ) the transition probability and rT ( s , a ) the reward function . We denote context cTn = ( an , rn , sn+1 ) as the experience tuple collected at the n-th step of adaptation in task T , and we use cT−1 : T−1 = 〈cT−1 , cT0 , ... , cTT−1〉1 to denote all trajectories collected in the T timesteps A common objective for meta-RL is to optimize final performance after few-shot adaptation ( Finn et al. , 2017 ; Gupta et al. , 2018 ; Stadie et al. , 2018 ; Rothfuss et al. , 2019 ) . During adaptation , an agent first utilizes some exploration policy πe to explore for a few episodes , and then updates an exploitation policy π to maximize expected return . Such a meta-RL objective can be formulated as : max π , πe ET [ R ( T , π ( cTπe ) ) ] ( 1 ) where cTπe is a set of experiences collected by π e , and R is the last episode ’ s expected return with π . The exploitation policy π is adapted with cTπe for optimizing final performance . 3 METACURE . To support efficient exploration in both meta-training and adaptation , we propose MetaCURE , a novel off-policy meta-RL algorithm , that learns separate exploration and exploitation policies . The exploration policy aims to collect trajectories that maximize the agent ’ s information gain to reduce uncertainty of task inference . The exploitation policy maximizes the expected extrinsic return in the last episode of adaptation . In this section , we first present the MetaCURE framework and then discuss its intrinsic reward design for learning an efficient exploration policy for both meta-training and adaptation . 3.1 THE METACURE FRAMEWORK . As shown in Figure 1 , MetaCURE is composed of three main components : ( i ) a task encoder qφ ( z|c ) that extracts information from context c and estimates the posterior of the task belief z , ( ii ) an Explorer to learn an behavior or exploration policy , and ( iii ) an Exploiter to learn the target or exploitation policy . We utilize variational inference methods ( Kingma & Welling , 2013 ; Alemi et al. , 2016 ; Rakelly et al. , 2019 ) to train the task encoder qφ . In order to learn effective task encodings , its decoder is designed to recover the action value function of the exploiter , which captures rich and temporally-extended information about the current task . The algorithm utilizes two separate replay buffers , B and Benc . Buffer B is used to train both the Explorer and the Exploiter , while bufferBenc is used to train the task encoder . During meta-training , MetaCURE iteratively infers the posterior task belief with contexts and performs both exploration and exploitation policies to collect data . B stores experiences from both policies , while Benc only stores exploration trajectories . During the adaptation phase , only the explorer is used to collect informative trajectories for inferring the posterior task belief , and the exploiter utilizes this posterior belief to maximize final performance . 1for n = −1 , we define cT−1 = ( ~0 , ~0 , s0 ) . In following derivations , we may drop T for brevity . To learn efficient exploration in sparse-reward tasks , the reward signal for the explorer is defined as follows : rexplorer ( c−1 : i−1 , ai ) = γ nr ( si , ai ) + λr ′ intr ( c−1 : i−1 , ai ) ( 2 ) where r is the extrinsic reward , r′intr is an intrinsic reward , λ > 0 is a hyper-parameter and γ ∈ [ 0 , 1 ] is a discount factor , and n is the number of training iterations . The intrinsic reward is conditioned on past trajectories c , which direct the explorer to collect relevant information for task inference . Empirically , we utilize the task belief qφ ( z|c ) instead of context c as explorer ’ s input , because it extracts useful task-specific information . This modification reuses learned knowledge from raw experiences and accelerates learning . We will discuss in detail the design of intrinsic reward r′intr in the next section . As training proceeds , the extrinsic reward gradually diminishes , and the explorer converges to behaviors that collects useful experiences for adaptation . The exploiter π is expected to utilize collected experiences and optimize exploitation behavior . We design it to take state s and the latent code z as input , and maximize the expected extrinsic return . Finally , we utilize SAC ( Haarnoja et al. , 2018 ) , an off-policy RL algorithm to train the policies . Algorithm pseudo-codes are available in Appendix A.3 . 3.2 INTRINSIC REWARDS FOR METACURE . As shown in Figure 1 , to support efficient exploration in both meta-training and adaptation , we maximize agent ’ s information gain during exploration , and introduce an information-theoretic intrinsic reward in the following form : r′IG ( c−1 : i−1 , ai ) = E ( ri , si+1 ) | ( c−1 : i−1 , ai ) [ DKL [ p ( z|c−1 : i−1 ) ||p ( z|c−1 : i ) ] ] ( 3 ) The left-hand term p ( z|c−1 : i−1 ) in the KL distance is the agent ’ s task belief before observing ci , while the right-hand term is the posterior task belief . This term reflects how much the agent ’ s belief has changed after collecting an experience . We also observe similar intrinsic rewards proposed in VIME ( Houthooft et al. , 2016 ) , in which they explain the rewards as compression improvement . Further derivation ( see Appendix A.1 for details ) shows that this intrinsic reward can be estimated by the difference of two prediction errors : r′IG ( c−1 : i−1 , ai ) = E ( ri , si+1 ) | ( c−1 : i−1 , ai ) [ DKL [ p ( z|c−1 : i−1 ) ||p ( z|c−1 : i ) ] ] = E ( z , ri , si+1 ) | ( c−1 : i−1 , ai ) [ log p ( ri , si+1|c−1 : i−1 , ai ) − log p ( ri , si+1|c−1 : i−1 , ai , z ) ] ( 4 ) Although sharing some similarities with EPI ( Zhou et al. , 2018 ) , our intrinsic reward possesses several key differences : first , it maximizes both information gains in reward and dynamics prediction , while EPI ignores reward signals that are often critical for task inference in meta-RL ; secondly , our intrinsic reward supports end-to-end learning and collect online data for effective task inference , while EPI requires a fixed dataset to compute its intrinsic reward and lacks an effective mechanism for adaptive exploration . Empirically , we find that this intrinsic reward suffers form high variance , sometimes causing instability in training . Inspired by curiosity-driven exploration in traditional RL ( Still & Precup , 2012 ; Pathak et al. , 2017 ; Burda et al. , 2018 ) , we remove the first term in r′IG and use prediction errors as the intrinsic reward to reduce the estimation variance : r′PE ( c−1 : i−1 , ai ) = E ( z , ri , si+1 ) | ( c−1 : i−1 , ai ) [ − log p ( ri , si+1|c−1 : i−1 , ai , z ) ] ( 5 ) Unlike the prediction-based curiosity in traditional RL , this intrinsic reward is estimated on multiple tasks , and does not diminish during meta-training . 4 EXPERIMENTS . In this section , we aim at answering the following questions : 1 . Can MetaCURE achieve good final adaptation performance in sparse-reward tasks that require efficient exploration in both metatraining and adaptation ? 2 . Do the explorer and exploiter obtain desirable behaviors ? 3 . What ’ s the pros and cons of the two proposed intrinsic rewards ? 4 . Is MetaCURE ’ s components vital for efficient exploration ? Besides , we are also interested in its sample efficiency in meta-training and adaptation .
The paper presents a method for efficient task identification to improve adaptation in a meta RL setting. The approach is based on learning an exploration policy to quickly discriminate the task at hand, so that to leverage a task-specific policy for exploitation. To do so, it employs an intrinsic reward proportional to the information gain (or prediction error) over both the transition and reward models. Finally, the algorithm is evaluated over a set of continuous control domains with sparse rewards.
SP:ec463ec2a5bde3efb2f9daa1fd29dd71c7472341
Intrinsically Guided Exploration in Meta Reinforcement Learning
1 INTRODUCTION . Human intelligence is able to transfer knowledge across tasks and acquire new skills within limited experiences . However , most reinforcement learning ( RL ) agents still require large amounts of data to achieve human-level performance ( Silver et al. , 2017 ; Hessel et al. , 2018 ; Vinyals et al. , 2019 ) . Meta reinforcement learning ( meta-RL ) makes a step toward such efficient learning by extracting prior knowledge from a set of tasks to quickly adapt to new tasks . However , efficient exploration of meta-RL needs to consider both training and adaptation phases simultaneously ( Ishii et al. , 2002 ) , which becomes a key challenge for meta-RL . One branch of meta-RL algorithms ( Finn et al. , 2017 ; Stadie et al. , 2018 ; Rothfuss et al. , 2019 ; Gurumurthy et al. , 2019 ) utilizes policies injected with time-irrelevant random noise for meta-training exploration , while another branch of methods ( Duan et al. , 2016 ; Mishra et al. , 2017 ; Gupta et al. , 2018 ; Zintgraf et al. , 2019 ; Rakelly et al. , 2019 ) introduces memories or latent variables that enable temporally-extended exploration behaviors . EPI ( Zhou et al. , 2018 ) introduces intrinsic rewards based on the improvement of dynamics prediction . However , these exploration mechanisms are still inefficient in either meta-training or adaptation and underperform in complex sparse-reward tasks . To address this challenge of meta-RL , we introduce information-theoretic intrinsic motivations for learning to collect informative trajectories and enable efficient exploration in both meta-training and adaptation . Inspired by the common task-inference component in context-based meta-RL algorithms ( such as PEARL ( Rakelly et al. , 2019 ) and VariBAD ( Zintgraf et al. , 2019 ) ) , we leverage an insight that exploration behaviors should collect trajectories that contain rich information gain about the current task , and design an exploration objective to maximize the information gain for inferring taskss . Based this objective , we derive an intrinsic reward for learning an effective exploration policy . To reduce variance from estimating information-gain intrinsic rewards in complex domains , we simplify and derive an intrinsic reward based on prediction errors to achieve superior stability and scalability . We develop a novel off-policy meta-RL algorithm , Meta-RL with effiCient Uncertainty Reduction Exploration ( MetaCURE ) , that incorporates our intrinsic rewards and separates exploration and exploitation policies . MetaCURE learns to perform sequential exploration behaviors to reduce task uncertainty across adaptation episodes and maximizes the expected extrinsic return in the last episode of the adaptation phase . During meta-training , MetaCURE collects training data from both exploration and exploitation policies . As for adaptation , the exploration policy collects informative trajectories , and then the exploitation policy utilizes gained experiences to maximize final performance . We evaluate our algorithm on various sparse-reward MuJoCo locomotion tasks as well as sparse-reward Meta-World tasks . Empirical results show that it outperforms baseline algorithms by a large margin . We also visualize how our algorithm explores in novel tasks and discuss the pros and cons of the two proposed intrinsic rewards . 2 BACKGROUND . In meta-RL , we consider a distribution of tasks p ( T ) , with each task T modelled as a Markov Decision Process ( MDP ) , which consists of a state space , an action space , a transition function and a reward function . In common meta-RL settings ( Duan et al. , 2016 ; Finn et al. , 2017 ; Zintgraf et al. , 2019 ; Rakelly et al. , 2019 ) , tasks differ in the transition and/or reward function , and we can describe a task T with a tuple 〈pT0 ( s0 ) , pT ( s′|s , a ) , rT ( s , a ) 〉 , with pT0 ( s0 ) the initial state distribution , pT ( s′|s , a ) the transition probability and rT ( s , a ) the reward function . We denote context cTn = ( an , rn , sn+1 ) as the experience tuple collected at the n-th step of adaptation in task T , and we use cT−1 : T−1 = 〈cT−1 , cT0 , ... , cTT−1〉1 to denote all trajectories collected in the T timesteps A common objective for meta-RL is to optimize final performance after few-shot adaptation ( Finn et al. , 2017 ; Gupta et al. , 2018 ; Stadie et al. , 2018 ; Rothfuss et al. , 2019 ) . During adaptation , an agent first utilizes some exploration policy πe to explore for a few episodes , and then updates an exploitation policy π to maximize expected return . Such a meta-RL objective can be formulated as : max π , πe ET [ R ( T , π ( cTπe ) ) ] ( 1 ) where cTπe is a set of experiences collected by π e , and R is the last episode ’ s expected return with π . The exploitation policy π is adapted with cTπe for optimizing final performance . 3 METACURE . To support efficient exploration in both meta-training and adaptation , we propose MetaCURE , a novel off-policy meta-RL algorithm , that learns separate exploration and exploitation policies . The exploration policy aims to collect trajectories that maximize the agent ’ s information gain to reduce uncertainty of task inference . The exploitation policy maximizes the expected extrinsic return in the last episode of adaptation . In this section , we first present the MetaCURE framework and then discuss its intrinsic reward design for learning an efficient exploration policy for both meta-training and adaptation . 3.1 THE METACURE FRAMEWORK . As shown in Figure 1 , MetaCURE is composed of three main components : ( i ) a task encoder qφ ( z|c ) that extracts information from context c and estimates the posterior of the task belief z , ( ii ) an Explorer to learn an behavior or exploration policy , and ( iii ) an Exploiter to learn the target or exploitation policy . We utilize variational inference methods ( Kingma & Welling , 2013 ; Alemi et al. , 2016 ; Rakelly et al. , 2019 ) to train the task encoder qφ . In order to learn effective task encodings , its decoder is designed to recover the action value function of the exploiter , which captures rich and temporally-extended information about the current task . The algorithm utilizes two separate replay buffers , B and Benc . Buffer B is used to train both the Explorer and the Exploiter , while bufferBenc is used to train the task encoder . During meta-training , MetaCURE iteratively infers the posterior task belief with contexts and performs both exploration and exploitation policies to collect data . B stores experiences from both policies , while Benc only stores exploration trajectories . During the adaptation phase , only the explorer is used to collect informative trajectories for inferring the posterior task belief , and the exploiter utilizes this posterior belief to maximize final performance . 1for n = −1 , we define cT−1 = ( ~0 , ~0 , s0 ) . In following derivations , we may drop T for brevity . To learn efficient exploration in sparse-reward tasks , the reward signal for the explorer is defined as follows : rexplorer ( c−1 : i−1 , ai ) = γ nr ( si , ai ) + λr ′ intr ( c−1 : i−1 , ai ) ( 2 ) where r is the extrinsic reward , r′intr is an intrinsic reward , λ > 0 is a hyper-parameter and γ ∈ [ 0 , 1 ] is a discount factor , and n is the number of training iterations . The intrinsic reward is conditioned on past trajectories c , which direct the explorer to collect relevant information for task inference . Empirically , we utilize the task belief qφ ( z|c ) instead of context c as explorer ’ s input , because it extracts useful task-specific information . This modification reuses learned knowledge from raw experiences and accelerates learning . We will discuss in detail the design of intrinsic reward r′intr in the next section . As training proceeds , the extrinsic reward gradually diminishes , and the explorer converges to behaviors that collects useful experiences for adaptation . The exploiter π is expected to utilize collected experiences and optimize exploitation behavior . We design it to take state s and the latent code z as input , and maximize the expected extrinsic return . Finally , we utilize SAC ( Haarnoja et al. , 2018 ) , an off-policy RL algorithm to train the policies . Algorithm pseudo-codes are available in Appendix A.3 . 3.2 INTRINSIC REWARDS FOR METACURE . As shown in Figure 1 , to support efficient exploration in both meta-training and adaptation , we maximize agent ’ s information gain during exploration , and introduce an information-theoretic intrinsic reward in the following form : r′IG ( c−1 : i−1 , ai ) = E ( ri , si+1 ) | ( c−1 : i−1 , ai ) [ DKL [ p ( z|c−1 : i−1 ) ||p ( z|c−1 : i ) ] ] ( 3 ) The left-hand term p ( z|c−1 : i−1 ) in the KL distance is the agent ’ s task belief before observing ci , while the right-hand term is the posterior task belief . This term reflects how much the agent ’ s belief has changed after collecting an experience . We also observe similar intrinsic rewards proposed in VIME ( Houthooft et al. , 2016 ) , in which they explain the rewards as compression improvement . Further derivation ( see Appendix A.1 for details ) shows that this intrinsic reward can be estimated by the difference of two prediction errors : r′IG ( c−1 : i−1 , ai ) = E ( ri , si+1 ) | ( c−1 : i−1 , ai ) [ DKL [ p ( z|c−1 : i−1 ) ||p ( z|c−1 : i ) ] ] = E ( z , ri , si+1 ) | ( c−1 : i−1 , ai ) [ log p ( ri , si+1|c−1 : i−1 , ai ) − log p ( ri , si+1|c−1 : i−1 , ai , z ) ] ( 4 ) Although sharing some similarities with EPI ( Zhou et al. , 2018 ) , our intrinsic reward possesses several key differences : first , it maximizes both information gains in reward and dynamics prediction , while EPI ignores reward signals that are often critical for task inference in meta-RL ; secondly , our intrinsic reward supports end-to-end learning and collect online data for effective task inference , while EPI requires a fixed dataset to compute its intrinsic reward and lacks an effective mechanism for adaptive exploration . Empirically , we find that this intrinsic reward suffers form high variance , sometimes causing instability in training . Inspired by curiosity-driven exploration in traditional RL ( Still & Precup , 2012 ; Pathak et al. , 2017 ; Burda et al. , 2018 ) , we remove the first term in r′IG and use prediction errors as the intrinsic reward to reduce the estimation variance : r′PE ( c−1 : i−1 , ai ) = E ( z , ri , si+1 ) | ( c−1 : i−1 , ai ) [ − log p ( ri , si+1|c−1 : i−1 , ai , z ) ] ( 5 ) Unlike the prediction-based curiosity in traditional RL , this intrinsic reward is estimated on multiple tasks , and does not diminish during meta-training . 4 EXPERIMENTS . In this section , we aim at answering the following questions : 1 . Can MetaCURE achieve good final adaptation performance in sparse-reward tasks that require efficient exploration in both metatraining and adaptation ? 2 . Do the explorer and exploiter obtain desirable behaviors ? 3 . What ’ s the pros and cons of the two proposed intrinsic rewards ? 4 . Is MetaCURE ’ s components vital for efficient exploration ? Besides , we are also interested in its sample efficiency in meta-training and adaptation .
This paper proposes a novel meta-learning method, aimed at solving the following problem: at test time, the agent has N episodes to gather information [exploration phase], and we care about its return in the N+1th episode [exploitation phase]. To this end, the authors propose to learn a separate exploration and exploitation policy. The core of the algorithm is to use an exploration bonus for the exploration policy that rewards finding novel trajectories. This should help it to collect valuable information during meta training and meta testing. The exploration policy is only used in the N+1th episode, and is conditioned on a context vector which is computed from the exploration trajectories.
SP:ec463ec2a5bde3efb2f9daa1fd29dd71c7472341
Feature Integration and Group Transformers for Action Proposal Generation
1 INTRODUCTION . Owing to the fast development of digital cameras and online video services , the rapid growth of video sequences encourages the research of video content analysis . The applications of interest include video summarization ( Yao et al. , 2015 ; 2016 ) , captioning ( Chen et al. , 2019a ; Chen & Jiang , 2019 ) , grounding ( Chen et al. , 2019b ) , and temporal action detection ( Gao et al. , 2019 ; Zhang et al. , 2019 ) . The temporal action detection task is an important topic related to several video content analysis methods , and it aims to detect the human-action instances within the untrimmed long video sequences . Like the image object detection task , the temporal action detection can be separated into a temporal action proposal generation ( TAPG ) stage and an action classification stage . Recent studies ( Escorcia et al. , 2016 ; Buch et al. , 2017b ; Lin et al. , 2018 ; Liu et al. , 2019 ; Lin et al. , 2019 ; 2020 ) demonstrate that the way to pursue the proposal quality clearly improves the performance of two-stage temporal action detectors . To this end , a temporal action proposal generator is demanded to use a limited number of proposals for capturing the ground-truth action instances in a high recall rate , hence reducing the burden of the succeeding action classification stage . One popular way to tackle the TAPG task is to generate the proposals via the estimations of boundary and actioness probabilities . The boundary probability is usually factorized as the starting and ending for an action instance . Rather than directly estimating the actioness boundary as the existing methods , we leverage the actioness estimation and the additional background estimation in a bi-directional temporal manner to co-estimate the action boundaries . The background means existing no actions . This sort of boundary estimation derived from the observation that the features for describing the long-time actioness/background are more consistent along the temporal dimension than the short-time starting/ending . Therefore , estimating the boundary with the actioness and background features allows us to estimate the proposal boundaries of much less false-positive , hence obtaining the high-quality proposal candidates for further scoring . In practice , we estimate an action starting boundary as the time of descending background with simultaneous ascending actioness . In contrast , an action ending boundary occurs with the ascending background with descending actioness . Figure 1 illustrates our action-boundary co-estimation mechanism . This paper introduces an effective temporal action proposal generator , i.e. , FITS , which aims to provide the action proposals , that precisely and exhaustively cover the human-action instances . By considering the two essential TAPG issues , namely the feature representation and the scoring mechanism , and the above-mentioned action-boundary co-estimation , our attention-based FITS model comprises Feature Integration ( FI ) module and Transformer-driven Scorers ( TS ) module for dealing with these considerations . Precisely , our FI module enhances the common TAPG two-stream features ( Simonyan & Zisserman , 2014 ; Wang et al. , 2016 ; Xiong et al. , 2016 ) by concerning the feature interaction . The previous TAPG methods usually directly concatenate the appearance stream and motion stream features for usage . In contrast , we were inspired by the non-local attention mechanisms ( Wang et al. , 2018 ; Hsieh et al. , 2019 ) to extend such a long-range attention mechanism for integrating the two-stream features . As a result , our experiments show the robustness of the integrated features by reducing their mutual feature discrepancies . More importantly , to score the temporal action proposals for discriminating high-quality ones , we devise a novel transformer-driven scoring mechanism . The TS mechanism leverages the temporal contextual supports over the feature representations to obtain the self-attended representations and then associates these self-attended representations to co-estimate the action boundaries . The experiments show the retrieved action proposals containing much less false-positive ones . Figure 2 overviews our temporal action proposal model , termed as FITS network . To sum up , our main contributions include i ) We introduce the novel feature integration module to integrate the two-stream features by reducing their feature discrepancies via non-local-style attention and obtaining robust representation . ii ) We devise the novel transformer-driven scorers module to co-estimate the transformer-driven self-attended representations , which leverage long-range temporal contextual supports . Hence , we are able to retrieve high-quality temporal action proposals . iii ) The extensive experiments demonstrate that the proposed FITS model achieves significantly better performance than current state-of-the-art TAPG methods . 2 RELATED WORK . Feature Representation . As a de facto trend , instead of using the handcrafted features , the neuralnetwork-based features are widely employed for addressing the action classification task . These popular neural network approaches include the two-stream networks ( Simonyan & Zisserman , 2014 ; Feichtenhofer et al. , 2016 ; Wang et al. , 2016 ) , which separately represent the appearance feature and the motion feature , and 3D networks ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ; Qiu et al. , 2017 ; Xu et al. , 2017 ) , which directly represent a video sequence as the spatio-temporal feature . In this paper , we use the action recognition model ( Wang et al. , 2016 ; Xiong et al. , 2016 ) to extract two-stream features for representing each untrimmed video sequence . Attention Mechanism . The attention mechanism is the process of selectively focusing on a few relevant things in comparison with everything . Fields like natural language processing and computer vision , broadly leverage such an attention mechanism . For instances , Bahdanau et al . ( 2015 ) enable their model to focus on searching a group of related words from the input sentences for predicting the target words , Xu et al . ( 2015 ) introduce the soft and hard attention to generate image captions , and LFB ( Wu et al. , 2019 ) introduces long-term feature banks to analyze videos , Hsieh et al . ( 2019 ) employ non-local attention ( Wang et al. , 2018 ) to capture long-range dependencies and channel attention ( Hu et al. , 2018 ) to re-weight the channel-level feature maps . Since Vaswani et al . ( 2017 ) introduce a self-attention mechanism , called Transformer , for exploring the intra-attention and interattention to address the machine translation task , the Transformer-based models show their advantages to tackle various tasks , such as object detection ( Carion et al. , 2020 ) , action recognition ( Girdhar et al. , 2019 ) , image generation ( Parmar et al. , 2018 ) , and image captioning ( Cornia et al. , 2020 ) . We notice that the work of Girdhar et al . ( 2019 ) that classifies the human actions by first use the RPN ( Ren et al. , 2015 ) to localize the human body parts as several frame crops , and then encodes these crops via Transformers for the subsequent classification . In contrast , a TAPG task discriminates whether a given video segment , composed of several video frames , covering any action event . Our model extends the merits of these attention efforts for constructing a robust action proposal generator . Temporal Action Proposal Generation . We categorize the TAPG methods into Anchor-based ( Gao et al. , 2017 ; Heilbron et al. , 2016 ; Shou et al. , 2016 ) and Probability-based ( Lin et al. , 2020 ; 2019 ; 2018 ; Zhao et al. , 2017 ) . The former focuses on designing several multi-scale anchor boxes to cover action instances , while the latter estimates the temporal location probabilities of the action instances . Besides , some methods ( Gao et al. , 2018 ; Liu et al. , 2019 ; Gao et al. , 2020 ) also explore the way to integrate the above-mentioned two categories for precisely localizing the temporal boundaries . In anchor-based methods , the S-CNN ( Shou et al. , 2016 ) and Heilbron et al . ( 2016 ) respectively evaluate anchors via C3D network and sparse learning , and TURN ( Gao et al. , 2017 ) suggests regressing the temporal boundaries of action instances . The probability-based work , TAG ( Zhao et al. , 2017 ) , generates action proposals via a temporal watershed algorithm to merge contiguous temporal locations of high actioness probabilities . BSN ( Lin et al. , 2018 ) generates proposals as well as their confidence by formulating the probabilities of boundaries and actioness . BMN ( Lin et al. , 2019 ) proposes a boundary-matching mechanism to evaluate the confidence among densely distributed proposals . DBG ( Lin et al. , 2020 ) uses the maps of dense boundary confidence and completeness to further score boundaries for all action proposals . BC-GNN ( Bai et al. , 2020 ) employs a Graph Neural Network to model the relationship between the actioness and boundaries . Zhao et al . ( 2020 ) propose loss terms to regularize the feature consistency between the actioness and boundaries . In sum , the anchor-based methods focus on the anchor-box design and usually lack the flexible temporal boundaries for various action instances . The existing probability-based methods may generate the action proposals , but merely rely on the actioness ( Zhao et al. , 2017 ) or the boundary information ( Lin et al. , 2019 ) , or lack the association between the actioness and the boundaries of action instances ( Lin et al. , 2020 ; 2018 ) . By contrast , we introduce the Transformer-driven scorers module to score proposals by explicitly associating the self-attended representations during scorers training . Combining with our feature integration module for retrieving the robust feature representation , the experiments show that our model outperforms the existing leading TAPG methods . 3 METHOD . TAPG Formulation . Given a video sequence X = { xn } Nn=1 of N frames , we assume it includes I action instances . The TAPG task aims at generating a proper set of action proposals that can be used to detect the underlying human actions in X . We denote an action proposal as p = ( s , e ) to indicate that the proposal p starts at the sth frame and ends at the eth frame of X . Analogous to the object proposals for detection , action proposals are generic and class agnostic . Let the I ground-truth actions of X be Y = { ( s∗ , e∗ ) i = ( s∗i , e∗i ) } Ii=1 . An action proposal ( s , e ) is said to be matched to some ground-truth action ( s∗ , e∗ ) if their time-interval IoU ( in terms of frames ) is greater than a specified threshold τ . Considering a set P of proposals , its goodness to X can be explicitly measured by the number of matched action proposals . 3.1 FEATURE INTEGRATION . We decompose each video sequence X into a set of , say , T consecutive video segments , denoted as V = { vt } Tt=1 , where v is called a snippet . Each snippet v is then represented with two-stream features . To account for videos of various lengths , we adopt the setting in BSN ( Lin et al. , 2018 ) to sample single-stream features over the temporal ( frame ) dimension to consistently obtain T snippets per video sequence . Precisely , each video sequence X is represented by an appearance feature tensor A ∈ RC×T and a motion feature tensor M ∈ RC×T . To enhance the representation power of each snippet , we enrich the representation by three-step operations : co-attention , mutual-excitation , and aggregation . Before we describe the steps , we first define a basic convolutional layer φ by φ ( X ; f , o ) = ReLU ( W ∗X + b ) , ( 1 ) where X , f , o respectively denotes the input feature , the filter size , and the number of the output filters . ReLU , ∗ , W , b means the activation , convolution operation , the weights and bias of φ. Co-attention . We consider the non-local function ( Hsieh et al. , 2019 ; Wang et al. , 2018 ) to explore the snippet-level correlations between the two-stream cues . Hence we enable our model to learn to emphasize the temporal correlations of human-action descriptions between the two-stream cues . Given a video sequence X , its appearance tensor A ∈ RC×T and motion tensor M ∈ RC×T , the proposed two-stream co-attention is achieved by carrying out the following feature re-adjustment :  = Φ ( A ; M ) ⊕A , M̂ = Φ ( M ; A ) ⊕M , ( 2 ) where  , M̂ ∈ RC×T , the non-local function Φ ( · ) yields T × T snippet-level feature correlations for feature adjustment that conditioning on the other feature , and ⊕ denotes the element-wise addition . Mutual-excitation . We further enhance the two-stream features by re-weighting over the channel dimension C. To this end , we introduce a mutual-excitation mechanism to re-weight each singlestream feature concerning the channel-attention from the other stream . A convolution layer φ of filter size 1× 1 over the channel dimension is applied to re-organize the two-stream features . With the adjusted features , we construct a two-stream mutual-excitation function Ψ to extract the channel attention vector from one stream to excite the feature of the other stream . That is , we have à = Ψ ( φ ( M̂ ; 1× 1 , C ) ) φ (  ; 1× 1 , C ) , M̃ = Ψ ( φ (  ; 1× 1 , C ) ) φ ( M̂ ; 1× 1 , C ) , ( 3 ) where à , M̃ ∈ RC×T , the mutual-excitation function Ψ ( · ) is generalized from squeeze-and-excitation ( Hu et al. , 2018 ) for describing channel-attention , and symbolizes the element-wise multiplication . Aggregation . Inspired by the inception block ( Szegedy et al. , 2015 ; 2016 ) , we further enrich the feature representation concerning the multi-scale temporal contexts before integrating the two-stream features . Given the two-stream features à and M̃ , we employ the convolution layer and max-pooling layer to respectively map each of the two-stream features in two different temporal contexts by Ā1 = φ ( à ; 1×3 , C′ ) , Ā2 = φ ( ρ ( à ) ; 1×3 , C′ ) , M̄1 = φ ( M̃ ; 1×3 , C′ ) , M̄2 = φ ( ρ ( M̃ ) ; 1×3 , C′ ) , ( 4 ) where Ā1 , Ā2 , M̄1 , M̄2 ∈ RC ′×T , the max-pooling function ρ ( · ) using the filter of size 1× 3 . We then concatenate all features followed by another convolution layer to unify them . Formally , the aggregated feature , say F , is generated by F = φ ( Ā1 ‖ Ā2 ‖ M̄1 ‖ M̄2 ; 1× 3× 4 , C ′′ ) , ( 5 ) where the notation ‖ symbolizes the concatenation over an augmented last dimension , namely , ( Ā1 ‖ Ā2 ‖ M̄1 ‖ M̄2 ) ∈ RC ′×T×4 , and F ∈ RC′′×T is squeezed over the augmented last dimension .
This paper tackles the problem of temporal action proposal generation (TAPG). The authors address the problem from two perspectives: features wise and score fusion wise. They use non-local blocks to integrate appearance features and motion features together. For score fusion, they propose transformer based module to incorporate long range temporal information. The proposed method is evaluated on two benchmark datasets and achieved state-of-the art performance.
SP:aebc7fd9042d95e9ee3d1baf909b5267e0a10775
Feature Integration and Group Transformers for Action Proposal Generation
1 INTRODUCTION . Owing to the fast development of digital cameras and online video services , the rapid growth of video sequences encourages the research of video content analysis . The applications of interest include video summarization ( Yao et al. , 2015 ; 2016 ) , captioning ( Chen et al. , 2019a ; Chen & Jiang , 2019 ) , grounding ( Chen et al. , 2019b ) , and temporal action detection ( Gao et al. , 2019 ; Zhang et al. , 2019 ) . The temporal action detection task is an important topic related to several video content analysis methods , and it aims to detect the human-action instances within the untrimmed long video sequences . Like the image object detection task , the temporal action detection can be separated into a temporal action proposal generation ( TAPG ) stage and an action classification stage . Recent studies ( Escorcia et al. , 2016 ; Buch et al. , 2017b ; Lin et al. , 2018 ; Liu et al. , 2019 ; Lin et al. , 2019 ; 2020 ) demonstrate that the way to pursue the proposal quality clearly improves the performance of two-stage temporal action detectors . To this end , a temporal action proposal generator is demanded to use a limited number of proposals for capturing the ground-truth action instances in a high recall rate , hence reducing the burden of the succeeding action classification stage . One popular way to tackle the TAPG task is to generate the proposals via the estimations of boundary and actioness probabilities . The boundary probability is usually factorized as the starting and ending for an action instance . Rather than directly estimating the actioness boundary as the existing methods , we leverage the actioness estimation and the additional background estimation in a bi-directional temporal manner to co-estimate the action boundaries . The background means existing no actions . This sort of boundary estimation derived from the observation that the features for describing the long-time actioness/background are more consistent along the temporal dimension than the short-time starting/ending . Therefore , estimating the boundary with the actioness and background features allows us to estimate the proposal boundaries of much less false-positive , hence obtaining the high-quality proposal candidates for further scoring . In practice , we estimate an action starting boundary as the time of descending background with simultaneous ascending actioness . In contrast , an action ending boundary occurs with the ascending background with descending actioness . Figure 1 illustrates our action-boundary co-estimation mechanism . This paper introduces an effective temporal action proposal generator , i.e. , FITS , which aims to provide the action proposals , that precisely and exhaustively cover the human-action instances . By considering the two essential TAPG issues , namely the feature representation and the scoring mechanism , and the above-mentioned action-boundary co-estimation , our attention-based FITS model comprises Feature Integration ( FI ) module and Transformer-driven Scorers ( TS ) module for dealing with these considerations . Precisely , our FI module enhances the common TAPG two-stream features ( Simonyan & Zisserman , 2014 ; Wang et al. , 2016 ; Xiong et al. , 2016 ) by concerning the feature interaction . The previous TAPG methods usually directly concatenate the appearance stream and motion stream features for usage . In contrast , we were inspired by the non-local attention mechanisms ( Wang et al. , 2018 ; Hsieh et al. , 2019 ) to extend such a long-range attention mechanism for integrating the two-stream features . As a result , our experiments show the robustness of the integrated features by reducing their mutual feature discrepancies . More importantly , to score the temporal action proposals for discriminating high-quality ones , we devise a novel transformer-driven scoring mechanism . The TS mechanism leverages the temporal contextual supports over the feature representations to obtain the self-attended representations and then associates these self-attended representations to co-estimate the action boundaries . The experiments show the retrieved action proposals containing much less false-positive ones . Figure 2 overviews our temporal action proposal model , termed as FITS network . To sum up , our main contributions include i ) We introduce the novel feature integration module to integrate the two-stream features by reducing their feature discrepancies via non-local-style attention and obtaining robust representation . ii ) We devise the novel transformer-driven scorers module to co-estimate the transformer-driven self-attended representations , which leverage long-range temporal contextual supports . Hence , we are able to retrieve high-quality temporal action proposals . iii ) The extensive experiments demonstrate that the proposed FITS model achieves significantly better performance than current state-of-the-art TAPG methods . 2 RELATED WORK . Feature Representation . As a de facto trend , instead of using the handcrafted features , the neuralnetwork-based features are widely employed for addressing the action classification task . These popular neural network approaches include the two-stream networks ( Simonyan & Zisserman , 2014 ; Feichtenhofer et al. , 2016 ; Wang et al. , 2016 ) , which separately represent the appearance feature and the motion feature , and 3D networks ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ; Qiu et al. , 2017 ; Xu et al. , 2017 ) , which directly represent a video sequence as the spatio-temporal feature . In this paper , we use the action recognition model ( Wang et al. , 2016 ; Xiong et al. , 2016 ) to extract two-stream features for representing each untrimmed video sequence . Attention Mechanism . The attention mechanism is the process of selectively focusing on a few relevant things in comparison with everything . Fields like natural language processing and computer vision , broadly leverage such an attention mechanism . For instances , Bahdanau et al . ( 2015 ) enable their model to focus on searching a group of related words from the input sentences for predicting the target words , Xu et al . ( 2015 ) introduce the soft and hard attention to generate image captions , and LFB ( Wu et al. , 2019 ) introduces long-term feature banks to analyze videos , Hsieh et al . ( 2019 ) employ non-local attention ( Wang et al. , 2018 ) to capture long-range dependencies and channel attention ( Hu et al. , 2018 ) to re-weight the channel-level feature maps . Since Vaswani et al . ( 2017 ) introduce a self-attention mechanism , called Transformer , for exploring the intra-attention and interattention to address the machine translation task , the Transformer-based models show their advantages to tackle various tasks , such as object detection ( Carion et al. , 2020 ) , action recognition ( Girdhar et al. , 2019 ) , image generation ( Parmar et al. , 2018 ) , and image captioning ( Cornia et al. , 2020 ) . We notice that the work of Girdhar et al . ( 2019 ) that classifies the human actions by first use the RPN ( Ren et al. , 2015 ) to localize the human body parts as several frame crops , and then encodes these crops via Transformers for the subsequent classification . In contrast , a TAPG task discriminates whether a given video segment , composed of several video frames , covering any action event . Our model extends the merits of these attention efforts for constructing a robust action proposal generator . Temporal Action Proposal Generation . We categorize the TAPG methods into Anchor-based ( Gao et al. , 2017 ; Heilbron et al. , 2016 ; Shou et al. , 2016 ) and Probability-based ( Lin et al. , 2020 ; 2019 ; 2018 ; Zhao et al. , 2017 ) . The former focuses on designing several multi-scale anchor boxes to cover action instances , while the latter estimates the temporal location probabilities of the action instances . Besides , some methods ( Gao et al. , 2018 ; Liu et al. , 2019 ; Gao et al. , 2020 ) also explore the way to integrate the above-mentioned two categories for precisely localizing the temporal boundaries . In anchor-based methods , the S-CNN ( Shou et al. , 2016 ) and Heilbron et al . ( 2016 ) respectively evaluate anchors via C3D network and sparse learning , and TURN ( Gao et al. , 2017 ) suggests regressing the temporal boundaries of action instances . The probability-based work , TAG ( Zhao et al. , 2017 ) , generates action proposals via a temporal watershed algorithm to merge contiguous temporal locations of high actioness probabilities . BSN ( Lin et al. , 2018 ) generates proposals as well as their confidence by formulating the probabilities of boundaries and actioness . BMN ( Lin et al. , 2019 ) proposes a boundary-matching mechanism to evaluate the confidence among densely distributed proposals . DBG ( Lin et al. , 2020 ) uses the maps of dense boundary confidence and completeness to further score boundaries for all action proposals . BC-GNN ( Bai et al. , 2020 ) employs a Graph Neural Network to model the relationship between the actioness and boundaries . Zhao et al . ( 2020 ) propose loss terms to regularize the feature consistency between the actioness and boundaries . In sum , the anchor-based methods focus on the anchor-box design and usually lack the flexible temporal boundaries for various action instances . The existing probability-based methods may generate the action proposals , but merely rely on the actioness ( Zhao et al. , 2017 ) or the boundary information ( Lin et al. , 2019 ) , or lack the association between the actioness and the boundaries of action instances ( Lin et al. , 2020 ; 2018 ) . By contrast , we introduce the Transformer-driven scorers module to score proposals by explicitly associating the self-attended representations during scorers training . Combining with our feature integration module for retrieving the robust feature representation , the experiments show that our model outperforms the existing leading TAPG methods . 3 METHOD . TAPG Formulation . Given a video sequence X = { xn } Nn=1 of N frames , we assume it includes I action instances . The TAPG task aims at generating a proper set of action proposals that can be used to detect the underlying human actions in X . We denote an action proposal as p = ( s , e ) to indicate that the proposal p starts at the sth frame and ends at the eth frame of X . Analogous to the object proposals for detection , action proposals are generic and class agnostic . Let the I ground-truth actions of X be Y = { ( s∗ , e∗ ) i = ( s∗i , e∗i ) } Ii=1 . An action proposal ( s , e ) is said to be matched to some ground-truth action ( s∗ , e∗ ) if their time-interval IoU ( in terms of frames ) is greater than a specified threshold τ . Considering a set P of proposals , its goodness to X can be explicitly measured by the number of matched action proposals . 3.1 FEATURE INTEGRATION . We decompose each video sequence X into a set of , say , T consecutive video segments , denoted as V = { vt } Tt=1 , where v is called a snippet . Each snippet v is then represented with two-stream features . To account for videos of various lengths , we adopt the setting in BSN ( Lin et al. , 2018 ) to sample single-stream features over the temporal ( frame ) dimension to consistently obtain T snippets per video sequence . Precisely , each video sequence X is represented by an appearance feature tensor A ∈ RC×T and a motion feature tensor M ∈ RC×T . To enhance the representation power of each snippet , we enrich the representation by three-step operations : co-attention , mutual-excitation , and aggregation . Before we describe the steps , we first define a basic convolutional layer φ by φ ( X ; f , o ) = ReLU ( W ∗X + b ) , ( 1 ) where X , f , o respectively denotes the input feature , the filter size , and the number of the output filters . ReLU , ∗ , W , b means the activation , convolution operation , the weights and bias of φ. Co-attention . We consider the non-local function ( Hsieh et al. , 2019 ; Wang et al. , 2018 ) to explore the snippet-level correlations between the two-stream cues . Hence we enable our model to learn to emphasize the temporal correlations of human-action descriptions between the two-stream cues . Given a video sequence X , its appearance tensor A ∈ RC×T and motion tensor M ∈ RC×T , the proposed two-stream co-attention is achieved by carrying out the following feature re-adjustment :  = Φ ( A ; M ) ⊕A , M̂ = Φ ( M ; A ) ⊕M , ( 2 ) where  , M̂ ∈ RC×T , the non-local function Φ ( · ) yields T × T snippet-level feature correlations for feature adjustment that conditioning on the other feature , and ⊕ denotes the element-wise addition . Mutual-excitation . We further enhance the two-stream features by re-weighting over the channel dimension C. To this end , we introduce a mutual-excitation mechanism to re-weight each singlestream feature concerning the channel-attention from the other stream . A convolution layer φ of filter size 1× 1 over the channel dimension is applied to re-organize the two-stream features . With the adjusted features , we construct a two-stream mutual-excitation function Ψ to extract the channel attention vector from one stream to excite the feature of the other stream . That is , we have à = Ψ ( φ ( M̂ ; 1× 1 , C ) ) φ (  ; 1× 1 , C ) , M̃ = Ψ ( φ (  ; 1× 1 , C ) ) φ ( M̂ ; 1× 1 , C ) , ( 3 ) where à , M̃ ∈ RC×T , the mutual-excitation function Ψ ( · ) is generalized from squeeze-and-excitation ( Hu et al. , 2018 ) for describing channel-attention , and symbolizes the element-wise multiplication . Aggregation . Inspired by the inception block ( Szegedy et al. , 2015 ; 2016 ) , we further enrich the feature representation concerning the multi-scale temporal contexts before integrating the two-stream features . Given the two-stream features à and M̃ , we employ the convolution layer and max-pooling layer to respectively map each of the two-stream features in two different temporal contexts by Ā1 = φ ( à ; 1×3 , C′ ) , Ā2 = φ ( ρ ( à ) ; 1×3 , C′ ) , M̄1 = φ ( M̃ ; 1×3 , C′ ) , M̄2 = φ ( ρ ( M̃ ) ; 1×3 , C′ ) , ( 4 ) where Ā1 , Ā2 , M̄1 , M̄2 ∈ RC ′×T , the max-pooling function ρ ( · ) using the filter of size 1× 3 . We then concatenate all features followed by another convolution layer to unify them . Formally , the aggregated feature , say F , is generated by F = φ ( Ā1 ‖ Ā2 ‖ M̄1 ‖ M̄2 ; 1× 3× 4 , C ′′ ) , ( 5 ) where the notation ‖ symbolizes the concatenation over an augmented last dimension , namely , ( Ā1 ‖ Ā2 ‖ M̄1 ‖ M̄2 ) ∈ RC ′×T×4 , and F ∈ RC′′×T is squeezed over the augmented last dimension .
In general, it is an interesting paper to utilize multiple techniques to enhance two-stream features and transformer to improve proposal scores, though all the techniques are not first proposed in this paper. But some technical details are not clearly presented, so the solidarity cannot be evaluated. Furturemore, more ablation study is needed to verify the contribution of the paper. If all the the concerns are properly addressed in the rebuttal, this paper can be accepted.
SP:aebc7fd9042d95e9ee3d1baf909b5267e0a10775
Revealing the Structure of Deep Neural Networks via Convex Duality
1 INTRODUCTION . Deep neural networks ( DNNs ) have become extremely popular due to their success in machine learning applications . Even though DNNs are highly over-parameterized and non-convex , simple first-order algorithms , e.g. , Stochastic Gradient Descent ( SGD ) , can be used to successfully train them . Moreover , recent work has shown that highly over-parameterized networks trained with SGD obtain simple solutions that generalize well ( Savarese et al. , 2019 ; Parhi & Nowak , 2019 ; Ergen & Pilanci , 2020a ; b ) , where two-layer ReLU networks with the minimum Euclidean norm solution and zero training error are proven to fit a linear spline model in 1D regression . Therefore , regularizing the solution towards smaller norm weights might be the key to understand the generalization properties of DNNs . However , analyzing DNNs is still theoretically elusive even in the absence of nonlinear activations . Therefore , we study norm regularized DNNs and develop a framework based on convex duality such that a set of optimal solutions to the training problem can be analytically characterized . Deep linear networks have been the subject of extensive theoretical analysis due to their tractability . A line of research ( Saxe et al. , 2013 ; Arora et al. , 2018a ; Laurent & Brecht , 2018 ; Du & Hu , 2019 ; Shamir , 2018 ) focused on GD training dynamics , however , they lack the analysis of generalization properties of deep networks . Another line of research ( Gunasekar et al. , 2017 ; Arora et al. , 2019 ; Bhojanapalli et al. , 2016 ) studied the generalization properties via matrix factorization and showed that linear networks trained with GD converge to minimum nuclear norm solutions . Later on , Arora et al . ( 2018b ) ; Du et al . ( 2018 ) showed that gradient flow enforces the layer weights to align . Ji & Telgarsky ( 2019 ) further proved that each layer weight matrix is asymptotically rank-one . These results provide insights to characterize the structure of the optimal layer weights , however , they require multiple strong assumptions , e.g. , linearly separable training data and strictly decreasing loss function , which makes the results impractical . Furthermore , Zhang et al . ( 2019 ) provided some characterizations for nonstandard networks , which are valid for hinge loss and specific regularizations where the data matrix is included . Unlike these studies , we introduce a complete characterization for the regularized deep network training problem without requiring such assumptions . Our contributions : 1 ) We introduce a convex analytic framework that characterizes a set of optimal solutions to regularized training problems as the extreme points of a convex set , which is valid for vector outputs and popular loss functions including squared , cross entropy and hinge loss1 ; 2 ) For deep linear networks with K outputs , we prove that each optimal layer weight matrix aligns 1Extensions to other loss functions , e.g. , cross entropy and hinge loss , are presented Appendix A.1 with the previous layers and becomes rank-K via convex duality ; 3 ) For deep ReLU networks , we obtain the same weight alignment result for whitened or rank-one data matrices . As a corollary , we achieve closed-form solutions for the optimal hidden layer weights when data is whitened or rank-one ( see Theorem 4.1 and 4.3 ) . As another corollary , we prove that the optimal networks are linear spline interpolators for one-dimensional , i.e. , rank-one , data which generalizes the two-layer results for one-dimensional data in Savarese et al . ( 2019 ) ; Parhi & Nowak ( 2019 ) ; Ergen & Pilanci ( 2020a ; b ) to arbitrary depth . We note that the analysis of ReLU networks for the one dimensional data considered in these works is non-trivial , which is a special case of our rank-one/whitened data assumption . Notation : We denote matrices/vectors as uppercase/lowercase bold letters . We use 0k ( or 1k ) and Ik to denote a vector of zeros ( or ones ) and the identity matrix of size k , respectively . We denote the set of integers from 1 to n as [ n ] . To denote Frobenius , operator , and nuclear norms , we use ‖ · ‖F , ‖ · ‖2 , and ‖ · ‖∗ , respectively . Furthermore , σmax ( · ) and σmin ( · ) represent the maximum and minimum singular values , respectively and B2 is defined as B2 : = { u ∈ Rd | ‖u‖2 ≤ 1 } . 1.1 OVERVIEW OF OUR RESULTS . We consider an L-layer network with layer weights Wl ∈ Rml−1×ml , ∀l ∈ [ L ] , where m0 = d and mL = 1 , respectively . Then , given a data matrix X ∈ Rn×d , the output is fθ , L ( X ) = AL−1wL , Al = g ( Al−1Wl ) ∀l ∈ [ L − 1 ] , where A0 = X and g ( · ) is the activation function . Given a label vector y ∈ Rn , training problem can be formulated as follows min { θl } Ll=1 L ( fθ , L ( X ) , y ) + βR ( θ ) , ( 1 ) where L ( · , · ) is an arbitrary loss function , R ( θ ) is regularization for the layer weights , β > 0 is a regularization parameter , θl = { Wl , ml } , and θ : = { θl } Ll=1 . In the paper , for the sake of presentation simplicity , we illustrate the conventional training setup with squared loss and ` 2-norm regularization , i.e. , L ( fθ , L ( X ) , y ) = ‖fθ , L ( X ) − y‖22 and R ( θ ) = ∑L l=1 ‖Wl‖2F . However , our analysis is valid for arbitrary loss functions and different regularization terms as proven in Appendix . Thus , we consider the following optimization problem P ∗ = min { θl } Ll=1 L ( fθ , L ( X ) , y ) + β L∑ l=1 ‖Wl‖2F . ( 2 ) Next , we show that the minimum ` 22 norm is equivalent to minimum ` 1 norm after a rescaling . Lemma 1.1 . The following problems are equivalent : min { θl } Ll=1 L ( fθ , L ( X ) , y ) + β L∑ l=1 ‖Wl‖2F = min { θl } Ll=1 , t L ( fθ , L ( X ) , y ) + 2β‖wL‖1 + β ( L− 2 ) t2 s.t . wL−1 , j ∈ B2 , ‖Wl‖F ≤ t , ∀l ∈ [ L− 2 ] , where wL−1 , j denotes the jth column of WL−1 . Using Lemma 1.12 , we first take the dual with respect to the output layer weights wL and then change the order of min-max to achieve the following dual deep network training problem , which provides a lower bound 3 P ∗ ≥D∗ = min t max λ min wL−1 , j∈B2 , ∀j ‖Wl‖F≤t , ∀l∈ [ L−2 ] −L∗ ( λ ) + β ( L− 2 ) t2 s.t . ‖ATL−1λ‖∞ ≤ 2β . 2The proof is presented in Appendix A.3 . 3For the definitions and details see Appendix A.1 . To the best of our knowledge , the above dual deep network characterization is novel . Using this result , we first characterize a set of weights that minimize the objective via the optimality conditions and active constraints in the dual objective . We then prove the optimality of these weights by proving strong duality , i.e. , P ∗ = D∗ , for deep networks . We then show that , for deep linear networks with K outputs , optimal weight matrices are rank-K and align with the previous layers . More importantly , the same analysis and conclusions also apply to deep ReLU networks with K outputs when the input is whitened and/or rank-one . To the best of our knowledge , this is the first work providing a complete characterization for deep ReLU networks via convex duality . Based on this analysis , we even obtain closed-form solutions for the optimal layer weights . As a corollary , we show that deep ReLU networks fit a linear spline interpolation when the input is a one-dimensional dataset . We also provide an experiment in Figure 1 to verify this claim . We emphasize that this result was previously known only for two-layer networks ( Savarese et al. , 2019 ; Parhi & Nowak , 2019 ; Ergen & Pilanci , 2020a ; b ) and here we extend it to arbitrary depth L ( see Table 1 for details ) . 2 WARMUP : TWO-LAYER LINEAR NETWORKS . To illustrate an application of the convex dual D∗ , we consider the simple case of two-layer linear networks with the output fθ,2 ( X ) = XW1w2 and define the parameter space as θ ∈ Θ = { ( W1 , w2 , m ) |W1 ∈ Rd×m , w2 ∈ Rm , m ∈ Z+ } . Motivated by recent results ( Neyshabur et al. , 2014 ; Chizat & Bach , 2018 ; Savarese et al. , 2019 ; Parhi & Nowak , 2019 ; Ergen & Pilanci , 2020a ; b ) , we first focus on a minimum norm4 variant of equation 1 when L ( fθ , L ( X ) , y ) = ‖fθ , L ( X ) − y‖22 and then extend it to equation 1 . The minimum norm primal training problem can be written as min θ∈Θ ‖W1‖2F + ‖w2‖22 s.t . fθ,2 ( X ) = y . ( 3 ) Using Lemma A.15 , we equivalently have P ∗ = min θ∈Θ ‖w2‖1 s.t . fθ,2 ( X ) = y , w1 , j ∈ B2 , ∀j , ( 4 ) which has the following dual form . Theorem 2.1 . The dual of the problem in equation 4 is given by P ∗ ≥ D∗ = max λ∈Rn λTy s.t . max w1∈B2 ∣∣λTXw1∣∣ ≤ 1 . ( 5 ) For finite width networks , there exists a finitem such that strong duality holds , i.e. , P ∗ = D∗ , and an optimal W1 for equation 4 satisfies ‖ ( XW∗1 ) Tλ∗‖∞ = 1 , where λ∗ is the dual optimal parameter . Using Theorem 2.1 , we now characterize the optimal neurons as the extreme points of a convex set . Corollary 2.1 . Theorem 2.1 implies that the optimal neurons are extreme points which solve the following problem arg maxw1∈B2 |λ ∗TXw1 | . Definition 1 . We call the maximizers of the constraint in Corollary 2.1 extreme points . From Theorem 2.1 , we have the following dual problem max λ λTy s.t . max w1∈B2 |λTXw1| ≤ 1 . ( 6 ) Let X = UxΣxVTx be the singular value decomposition ( SVD ) of X 6 . If we assume that there exists w∗ such that Xw∗ = y due to Proposition 2.1 , then equation 6 is equivalent to max λ̃ λ̃TΣxw̃ ∗ s.t . ‖ΣTx λ̃‖2 ≤ 1 , ( 7 ) where λ̃ = UTxλ and w̃ ∗ = VTxw ∗ . Notice that in equation 7 , we use an alternative formulation for the constraint , i.e. , ‖XTλ‖2 ≤ 1 instead of |λTXw1| ≤ 1 , ∀w1 ∈ B2 since the extreme point is achieved when w1 = XTλ/‖XTλ‖2 . Given rank ( X ) = r ≤ min { n , d } , we have λ̃TΣxw̃ ∗ = λ̃TΣx [ Ir 0r×d−r 0d−r×r 0d−r×d−r ] w̃∗︸ ︷︷ ︸ w∗r ≤ ‖ΣTx λ̃‖2‖w̃∗r‖2 ≤ ‖w̃∗r‖2 , ( 8 ) 4This corresponds to weak regularization , i.e. , β → 0 in equation 1 ( see e.g . Wei et al . ( 2018 ) . ) . 5All the equivalence lemmas and proofs are presented in Appendix A.3 . 6In this paper , we use full SVD unless otherwise stated . which shows that the maximum objective value is achieved when ΣTx λ̃ = c1w̃ ∗ r . Thus , we have w∗1 = VxΣ T x λ̃ ‖VxΣTx λ̃‖2 = Vxw̃ ∗ r ‖w̃∗r‖2 = PXT ( w∗ ) ‖PXT ( w∗ ) ‖2 , where PXT ( · ) projects its input onto the range of XT . In the following results , we show that one can consider a planted model without loss of generality and prove strong duality for equation 4 . Proposition 2.1 . [ Du & Hu ( 2019 ) ] Given w∗ = arg minw ‖Xw − y‖2 , we have arg min W1 , w2 ‖XW1w2 −Xw∗‖22 = arg min W1 , w2 ‖XW1w2 − y‖22 . Theorem 2.2 . Let { X , y } be feasible for equation 4 , then strong duality holds for finite width networks .
The authors consider training neural networks with a variety of losses and regularization (such as weight decay). The authors introduce a novel convex-dual formulation which allows them to characterize optimal solutions as being extreme points of particular convex sets. For multi-layer linear networks, the authors prove that the optimal weight matrices have rank equal to the number of outputs of the network, and whose singular vectors align with those of neighboring layers. For ReLU nets in one-dimension, the authors prove that optimal solutions act as linear spline interpolators (the kinks between linear pieces occur at data points), and the authors prove closed form expressions for optimal weights at intermediate layers when input data is whitened.
SP:ec03a452d165bcff98d9e40050a495dc1f30255b
Revealing the Structure of Deep Neural Networks via Convex Duality
1 INTRODUCTION . Deep neural networks ( DNNs ) have become extremely popular due to their success in machine learning applications . Even though DNNs are highly over-parameterized and non-convex , simple first-order algorithms , e.g. , Stochastic Gradient Descent ( SGD ) , can be used to successfully train them . Moreover , recent work has shown that highly over-parameterized networks trained with SGD obtain simple solutions that generalize well ( Savarese et al. , 2019 ; Parhi & Nowak , 2019 ; Ergen & Pilanci , 2020a ; b ) , where two-layer ReLU networks with the minimum Euclidean norm solution and zero training error are proven to fit a linear spline model in 1D regression . Therefore , regularizing the solution towards smaller norm weights might be the key to understand the generalization properties of DNNs . However , analyzing DNNs is still theoretically elusive even in the absence of nonlinear activations . Therefore , we study norm regularized DNNs and develop a framework based on convex duality such that a set of optimal solutions to the training problem can be analytically characterized . Deep linear networks have been the subject of extensive theoretical analysis due to their tractability . A line of research ( Saxe et al. , 2013 ; Arora et al. , 2018a ; Laurent & Brecht , 2018 ; Du & Hu , 2019 ; Shamir , 2018 ) focused on GD training dynamics , however , they lack the analysis of generalization properties of deep networks . Another line of research ( Gunasekar et al. , 2017 ; Arora et al. , 2019 ; Bhojanapalli et al. , 2016 ) studied the generalization properties via matrix factorization and showed that linear networks trained with GD converge to minimum nuclear norm solutions . Later on , Arora et al . ( 2018b ) ; Du et al . ( 2018 ) showed that gradient flow enforces the layer weights to align . Ji & Telgarsky ( 2019 ) further proved that each layer weight matrix is asymptotically rank-one . These results provide insights to characterize the structure of the optimal layer weights , however , they require multiple strong assumptions , e.g. , linearly separable training data and strictly decreasing loss function , which makes the results impractical . Furthermore , Zhang et al . ( 2019 ) provided some characterizations for nonstandard networks , which are valid for hinge loss and specific regularizations where the data matrix is included . Unlike these studies , we introduce a complete characterization for the regularized deep network training problem without requiring such assumptions . Our contributions : 1 ) We introduce a convex analytic framework that characterizes a set of optimal solutions to regularized training problems as the extreme points of a convex set , which is valid for vector outputs and popular loss functions including squared , cross entropy and hinge loss1 ; 2 ) For deep linear networks with K outputs , we prove that each optimal layer weight matrix aligns 1Extensions to other loss functions , e.g. , cross entropy and hinge loss , are presented Appendix A.1 with the previous layers and becomes rank-K via convex duality ; 3 ) For deep ReLU networks , we obtain the same weight alignment result for whitened or rank-one data matrices . As a corollary , we achieve closed-form solutions for the optimal hidden layer weights when data is whitened or rank-one ( see Theorem 4.1 and 4.3 ) . As another corollary , we prove that the optimal networks are linear spline interpolators for one-dimensional , i.e. , rank-one , data which generalizes the two-layer results for one-dimensional data in Savarese et al . ( 2019 ) ; Parhi & Nowak ( 2019 ) ; Ergen & Pilanci ( 2020a ; b ) to arbitrary depth . We note that the analysis of ReLU networks for the one dimensional data considered in these works is non-trivial , which is a special case of our rank-one/whitened data assumption . Notation : We denote matrices/vectors as uppercase/lowercase bold letters . We use 0k ( or 1k ) and Ik to denote a vector of zeros ( or ones ) and the identity matrix of size k , respectively . We denote the set of integers from 1 to n as [ n ] . To denote Frobenius , operator , and nuclear norms , we use ‖ · ‖F , ‖ · ‖2 , and ‖ · ‖∗ , respectively . Furthermore , σmax ( · ) and σmin ( · ) represent the maximum and minimum singular values , respectively and B2 is defined as B2 : = { u ∈ Rd | ‖u‖2 ≤ 1 } . 1.1 OVERVIEW OF OUR RESULTS . We consider an L-layer network with layer weights Wl ∈ Rml−1×ml , ∀l ∈ [ L ] , where m0 = d and mL = 1 , respectively . Then , given a data matrix X ∈ Rn×d , the output is fθ , L ( X ) = AL−1wL , Al = g ( Al−1Wl ) ∀l ∈ [ L − 1 ] , where A0 = X and g ( · ) is the activation function . Given a label vector y ∈ Rn , training problem can be formulated as follows min { θl } Ll=1 L ( fθ , L ( X ) , y ) + βR ( θ ) , ( 1 ) where L ( · , · ) is an arbitrary loss function , R ( θ ) is regularization for the layer weights , β > 0 is a regularization parameter , θl = { Wl , ml } , and θ : = { θl } Ll=1 . In the paper , for the sake of presentation simplicity , we illustrate the conventional training setup with squared loss and ` 2-norm regularization , i.e. , L ( fθ , L ( X ) , y ) = ‖fθ , L ( X ) − y‖22 and R ( θ ) = ∑L l=1 ‖Wl‖2F . However , our analysis is valid for arbitrary loss functions and different regularization terms as proven in Appendix . Thus , we consider the following optimization problem P ∗ = min { θl } Ll=1 L ( fθ , L ( X ) , y ) + β L∑ l=1 ‖Wl‖2F . ( 2 ) Next , we show that the minimum ` 22 norm is equivalent to minimum ` 1 norm after a rescaling . Lemma 1.1 . The following problems are equivalent : min { θl } Ll=1 L ( fθ , L ( X ) , y ) + β L∑ l=1 ‖Wl‖2F = min { θl } Ll=1 , t L ( fθ , L ( X ) , y ) + 2β‖wL‖1 + β ( L− 2 ) t2 s.t . wL−1 , j ∈ B2 , ‖Wl‖F ≤ t , ∀l ∈ [ L− 2 ] , where wL−1 , j denotes the jth column of WL−1 . Using Lemma 1.12 , we first take the dual with respect to the output layer weights wL and then change the order of min-max to achieve the following dual deep network training problem , which provides a lower bound 3 P ∗ ≥D∗ = min t max λ min wL−1 , j∈B2 , ∀j ‖Wl‖F≤t , ∀l∈ [ L−2 ] −L∗ ( λ ) + β ( L− 2 ) t2 s.t . ‖ATL−1λ‖∞ ≤ 2β . 2The proof is presented in Appendix A.3 . 3For the definitions and details see Appendix A.1 . To the best of our knowledge , the above dual deep network characterization is novel . Using this result , we first characterize a set of weights that minimize the objective via the optimality conditions and active constraints in the dual objective . We then prove the optimality of these weights by proving strong duality , i.e. , P ∗ = D∗ , for deep networks . We then show that , for deep linear networks with K outputs , optimal weight matrices are rank-K and align with the previous layers . More importantly , the same analysis and conclusions also apply to deep ReLU networks with K outputs when the input is whitened and/or rank-one . To the best of our knowledge , this is the first work providing a complete characterization for deep ReLU networks via convex duality . Based on this analysis , we even obtain closed-form solutions for the optimal layer weights . As a corollary , we show that deep ReLU networks fit a linear spline interpolation when the input is a one-dimensional dataset . We also provide an experiment in Figure 1 to verify this claim . We emphasize that this result was previously known only for two-layer networks ( Savarese et al. , 2019 ; Parhi & Nowak , 2019 ; Ergen & Pilanci , 2020a ; b ) and here we extend it to arbitrary depth L ( see Table 1 for details ) . 2 WARMUP : TWO-LAYER LINEAR NETWORKS . To illustrate an application of the convex dual D∗ , we consider the simple case of two-layer linear networks with the output fθ,2 ( X ) = XW1w2 and define the parameter space as θ ∈ Θ = { ( W1 , w2 , m ) |W1 ∈ Rd×m , w2 ∈ Rm , m ∈ Z+ } . Motivated by recent results ( Neyshabur et al. , 2014 ; Chizat & Bach , 2018 ; Savarese et al. , 2019 ; Parhi & Nowak , 2019 ; Ergen & Pilanci , 2020a ; b ) , we first focus on a minimum norm4 variant of equation 1 when L ( fθ , L ( X ) , y ) = ‖fθ , L ( X ) − y‖22 and then extend it to equation 1 . The minimum norm primal training problem can be written as min θ∈Θ ‖W1‖2F + ‖w2‖22 s.t . fθ,2 ( X ) = y . ( 3 ) Using Lemma A.15 , we equivalently have P ∗ = min θ∈Θ ‖w2‖1 s.t . fθ,2 ( X ) = y , w1 , j ∈ B2 , ∀j , ( 4 ) which has the following dual form . Theorem 2.1 . The dual of the problem in equation 4 is given by P ∗ ≥ D∗ = max λ∈Rn λTy s.t . max w1∈B2 ∣∣λTXw1∣∣ ≤ 1 . ( 5 ) For finite width networks , there exists a finitem such that strong duality holds , i.e. , P ∗ = D∗ , and an optimal W1 for equation 4 satisfies ‖ ( XW∗1 ) Tλ∗‖∞ = 1 , where λ∗ is the dual optimal parameter . Using Theorem 2.1 , we now characterize the optimal neurons as the extreme points of a convex set . Corollary 2.1 . Theorem 2.1 implies that the optimal neurons are extreme points which solve the following problem arg maxw1∈B2 |λ ∗TXw1 | . Definition 1 . We call the maximizers of the constraint in Corollary 2.1 extreme points . From Theorem 2.1 , we have the following dual problem max λ λTy s.t . max w1∈B2 |λTXw1| ≤ 1 . ( 6 ) Let X = UxΣxVTx be the singular value decomposition ( SVD ) of X 6 . If we assume that there exists w∗ such that Xw∗ = y due to Proposition 2.1 , then equation 6 is equivalent to max λ̃ λ̃TΣxw̃ ∗ s.t . ‖ΣTx λ̃‖2 ≤ 1 , ( 7 ) where λ̃ = UTxλ and w̃ ∗ = VTxw ∗ . Notice that in equation 7 , we use an alternative formulation for the constraint , i.e. , ‖XTλ‖2 ≤ 1 instead of |λTXw1| ≤ 1 , ∀w1 ∈ B2 since the extreme point is achieved when w1 = XTλ/‖XTλ‖2 . Given rank ( X ) = r ≤ min { n , d } , we have λ̃TΣxw̃ ∗ = λ̃TΣx [ Ir 0r×d−r 0d−r×r 0d−r×d−r ] w̃∗︸ ︷︷ ︸ w∗r ≤ ‖ΣTx λ̃‖2‖w̃∗r‖2 ≤ ‖w̃∗r‖2 , ( 8 ) 4This corresponds to weak regularization , i.e. , β → 0 in equation 1 ( see e.g . Wei et al . ( 2018 ) . ) . 5All the equivalence lemmas and proofs are presented in Appendix A.3 . 6In this paper , we use full SVD unless otherwise stated . which shows that the maximum objective value is achieved when ΣTx λ̃ = c1w̃ ∗ r . Thus , we have w∗1 = VxΣ T x λ̃ ‖VxΣTx λ̃‖2 = Vxw̃ ∗ r ‖w̃∗r‖2 = PXT ( w∗ ) ‖PXT ( w∗ ) ‖2 , where PXT ( · ) projects its input onto the range of XT . In the following results , we show that one can consider a planted model without loss of generality and prove strong duality for equation 4 . Proposition 2.1 . [ Du & Hu ( 2019 ) ] Given w∗ = arg minw ‖Xw − y‖2 , we have arg min W1 , w2 ‖XW1w2 −Xw∗‖22 = arg min W1 , w2 ‖XW1w2 − y‖22 . Theorem 2.2 . Let { X , y } be feasible for equation 4 , then strong duality holds for finite width networks .
This work uses dual formulations of Neural Networks with ReLU activations. It starts explaining the dual formulations with simplest single layer unregularised linear neural networks with a single dimensional output layer. Then gradually extends the models to deep, regularised models with ReLU activations. There is also an assumption on the data to be of rank one or whitened. The experiments are limited and not essential, since they only show that the theory can be confirmed with experiments, albeit they also demonstrate the limitations of simplified models studied here.
SP:ec03a452d165bcff98d9e40050a495dc1f30255b
Saliency is a Possible Red Herring When Diagnosing Poor Generalization
1 INTRODUCTION . A fundamental challenge when applying deep learning models stems from poor generalization due to covariate shift ( Moreno-Torres et al. , 2012 ) when the probably approximately correct ( PAC ) learning i.i.d . assumption is invalid ( Valiant , 1984 ) i.e . the training distribution is different from the test distribution . One explanation for this is shortcut learning or incorrect feature attribution , where the model during training overfits to a set of training-data specific decision rules to explain the training data instead of modelling the more general causative factors that generated the data ( Goodfellow et al. , 2016 ; Reed & Marks , 1999 ; Geirhos et al. , 2020 ; Hermann & Lampinen , 2020 ; Parascandolo et al. , 2020 ; Arjovsky et al. , 2019 ; Zhang et al. , 2016 ) . In medical imaging , poor generalization due to test-set distribution shifts are common and this problem is exacerbated by small cohorts . Previous work has hypothesized that this poor generalization is in part due to the presence of confounding variables in the training data such as acquisition site or other image acquisition parameters because attribution maps ( aka saliency maps ; Simonyan et al . ( 2014 ) ) produced by the trained model do not highlight features that a human expert would use to make a diagnosis ( Zech et al. , 2018 ; DeGrave et al. , 2020 ; Badgeley et al. , 2019 ; Zhao et al. , 2019 ; Young et al. , 2019 ) . Previous researchers have made the assumption that saliency maps can demonstrate that the model is not overfit or behaving unexpectedly ( Pasa et al. , 2019 ; Tschandl et al. , 2020 ) . We started this work under the same assumption only to find the contradictory evidence we present in this paper . In this work , we set out to test the hypothesis that models with good generalization properties have attribution maps which only utilize the class-discriminative features to make predictions , by explicitly regularizing the models to ignore confounders using attribution priors ( Erion et al. , 2019 ; Ross et al. , 2017 ) , i.e. , to make predictions using the correct anatomy ( as a doctor would ) . We evaluated whether this regularization would A ) improve out of distribution generalization , and B ) change feature attribution to be more like the attribution priors . If there exists a relationship between the attribution map and generalization performance , we would expect these regularizations to positively impact both generalization and attribution quality simultaneously . To evaluate attribution quality , we define good attribution to be an attribution map that agrees strongly with expert knowledge in the form of a binary mask on the input data . We show that the existing and proposed feature-attribution-aware methods help facilitate generalization in the presence of a train-test distribution shift . However , while feature-attribution-aware methods change the attribution maps relative to baseline , there is no strong correlation between generalization performance and good attribution . This in turn challenges the assumption made in previous works that the “ incorrect ” attribution maps were indicative of poor generalization performance . This suggests that A ) efforts to validate model correctness using attribution maps may not be reliable , and B ) that efforts to control feature attribution using masks on the input may not function as expected . All code and datasets for this paper are publicly available1 . Our contributions include : • A synthetic dataset that encourages models to overfit to an easy to represent confounder instead of a more complicated counting task . • Two new tasks constructed from open medical datasets which have a correlation between the pathology and either imaging site ( site pathology correlation ; SPC ) or view ( view pathology correlation ; VPC ) , and we manipulate the nature of this correlation differently in the training and test distributions to create a distribution shift ( Figure 5 ) , introducing confounding variables as observed in previous work ( Zhao et al. , 2019 ; DeGrave et al. , 2020 ) . • Evaluation of existing methods for controlling feature attribution using mask information ; right for the right reasons ( RRR ; Ross et al . ( 2017 ) ) , GradMask ( Simpson et al. , 2019 ) , and adversarial domain invariance ( Tzeng et al. , 2017 ; Ganin & Lempitsky , 2015 ) . • A new method for controlling feature attribution based on minimizing activation differences between masked and unmasked images ( ActDiff ) . • Evaluate the relationship between generalization improvement and feature attribution in real- life out of distribution generalization tasks with traditional classifiers . 2 RELATED WORK . It is a well-documented phenomenon that convolutional neural networks ( CNNs ) , instead of building object-level representations of the input data , tend to find convenient surface-level statistics in the training data that are predictive of class ( Jo & Bengio , 2017 ) . Previous work has attempted to reduce the model ’ s proclivity to use confounding features by randomly masking out regions of the input ( DeVries & Taylor , 2017 ) , forcing the network to learn representations that aren ’ t dependent on a single input feature . However , this regularization approach gives no control over the kinds of representations learned by the model , so we do not include it in our study . Recently , multiple approaches have proposed to control feature representations by penalizing the model for producing saliency gradients outside of a regions of interest indicating the classdiscriminative feature ( Simpson et al. , 2019 ; Zhuang et al. , 2019 ; Rieger et al. , 2019 ) . These approaches were introduced by Right for the Right Reasons ( RRR ) , which showed impressive improvements in attribution correctness on synthetic data ( Ross et al. , 2017 ) . The follow-up work has generally demonstrated a small improvement in generalization accuracy on real data , and much more impressive results on synthetic data . Another feature attribution-aware regularization approach additionally dealt with class imbalances by increasing the impact of the gradients inside the region of interest of the under-represented class Zhuang et al . ( 2019 ) . One alternative to saliency-based methods , which can be noisy due to the ReLU activations allowing irrelevant features to pass through the activation function ( Kim et al. , 2019 ) , would be to leverage methods that aim to produce domain invariant features in the latent space of the network . These methods regularize the network such that the latent representations of two or more “ domains ” are encouraged to be as similar as possible , often by minimizing a distance metric or by employing an adversary that is trained to distinguish between the different domains ( Kouw & Loog , 2019 ; Ganin & Lempitsky , 2015 ; Tzeng et al. , 2015 ; Liu & Tuzel , 2016 ) . In this work , we view the masked version of the input as the training domain and the unmasked version of the input as the test domain , and compare these approaches with saliency-based approaches for the task of reducing the model ’ s reliance on confounding features . To the best of our knowledge , these strategies have not been tried to control feature attribution . 1https : //github.com/josephdviviano/saliency-red-herring 3 METHODS . Domain Invariance with the Activation Difference and Adversarial Loss : Leveraging ideas from domain adaptation , we introduce two methods designed to make the model invariant to features arising from outside of the attribution priors . The first is the embarrassingly simple Activation Difference ( ActDiff ) approach , which simply penalizes , for each input , the L2-normed distance between the masked and unmasked input ’ s latent representations . This loss is most similar to a style transfer approach which transforms a random noise image into one containing the same layerwise activations as some target image ( Gatys et al. , 2015 ) to apply a visual aesthetic to some input semantic contents , and encourages the network to build features which appear inside the masked regions even though it always sees the full image during training . Therefore we minimize Lact = ∑ ( Xmasked , x ) ∈D Lclf + λact||ol ( xmasked ) − ol ( x ) ||2 , ( 1 ) where ol ( x ) are the pre-activation outputs for layer l of the n-layer encoder f ( x ) when the network is presented with the original data x , ol ( xmasked ) are the pre-activations outputs for layer l when presented with masked data xmasked , and Lclf is the standard cross entropy loss . We define xmasked = x·xseg+shuffle ( x ) · ( 1 − xseg ) where background pixels are shuffled uniquely for each presentation to the network in order to destroy any spatial information available in those regions of the image without introducing any consistent artefacts into the image or shifts in the distribution of input intensities . This method is at a high level similar to using maximum mean discrepancy ( MMD ) for domain adaptation ( Baktashmotlagh et al. , 2016 ; 2013 ) where instead of minimizing the distance between the means of the two domain distributions , we instead minimize the distance between the features directly . One could replace the L2 norm with any Lk norm , and choices of k < 2 might be useful when regularizing larger latent representations as L2 distances collapse to a constant value in extremely high dimensional spaces due to the curse of dimensionality ( Aggarwal et al. , 2001 ) . We found during experimentation that regularizing the pre-activations led to better results at the cost of longer time to convergence , perhaps because the L2 norm is more effective when the feature vectors are not sparse , but we leave this conjecture to future work . The second approach we explore employs a discriminator D ( · ) optimized to distinguish between latent representations arising from passing xmasked or x through the encoder f ( · ) ( Tzeng et al. , 2017 ; Goodfellow et al. , 2014 ) . Simultaneously , we optimize the encoder f ( · ) to fool the discriminator and still produce representations that are predictive of the output class . Therefore , D and f are optimized using the LD and Lf respectively : LD = λdisc ( Exmasked [ logD ( f ( xmasked ) ) ] + Exmasked [ log ( 1−D ( f ( x ) ) ) ] ) ( 2 ) Lf = Lclf + λdisc ( Ex [ log ( 1−D ( f ( xmasked ) ) ) ] + Ex [ logD ( f ( x ) ) ] ) ( 3 ) This approach is similar to the one employed in ( Janizek et al. , 2020 ) , where the authors encouraged the model to be invariant to the view of the X-Ray ( Lateral vs PA ) , and here ‘ view ’ denotes whether the image is masked or not . D ( · ) had three fully-connected hidden layers of size 1024 before outputting a binary prediction . To facilitate the stability of training , we updated D ( · ) more frequently than the encoder treating this ratio as a hyperparameter . We optimized D ( · ) independently using Adam with a distinct learning rate , and applied spectral normalization to the hidden layers of D ( · ) . Direct Attribution Control with the Right for the Right Reasons and GradMask Loss : These input gradient attribution regularizers directly control which regions of the input are desirable for determining the class label by penalizing saliency outside of a defined input mask . The most basic gradient based “ input feature attribution ” can be calculated as ∂|ŷi|∂x for each input x ( Simonyan et al. , 2014 ; Lo et al. , 2015 ) . In the binary classification case , RRR ( Ross et al. , 2017 ) calculates saliency of the summed log probabilities of the 2 output classes with respect to the input x , Lrrr = ∑ ( xseg , x ) ∈D Lclf + λrrr · ∂ ( log ( p̂0 ) + log ( p̂1 ) ) 2 ∂x · ( 1− xseg ) , ( 4 ) where ( 1 − xseg ) is a binary mask that covers everything outside the defined regions of interest . The numerator in the RRR loss can be extended to the multi-class case by substituting ∑K k log ( p̂k ) . GradMask ( Simpson et al. , 2019 ) similarly calculates saliency using the contrast between the two output logits , and is only defined for the binary classification case , Lgradmask = ∑ ( xseg , x ) ∈D Lclf + λgradmask · ∣∣∣∣∂ |ŷ0 − ŷ1|∂x · ( 1− xseg ) ∣∣∣∣ 2 , ( 5 ) where ŷ0 and ŷ1 are the predicted outputs for our two classes . Classify Masked : We evaluated the effect imposing the attribution prior by simply training a model using masked data ( and evaluating it using unmasked data ) as a control experiment . The data was masked by shuffling the pixels outside of the mask during training , as was done for the domain invariance experiments to produce xmasked . We refer to these experiments as Masked .
The reviewed paper explores the relationship between the quality and spatial distribution of the saliency maps produced at inference time and the model's generalization performance. The authors employed a number of existing methods as well as proposed and implemented their own technique (ActDiff) to align saliency maps with causally plausible regions. All methods were applied on synthetic and real-world data in a series of clever experiments, showing little correlation between saliency map spatial alignment and performance on unseen data.
SP:88181a6db5701fbd9a096e08d5f892d6c1bea0e9
Saliency is a Possible Red Herring When Diagnosing Poor Generalization
1 INTRODUCTION . A fundamental challenge when applying deep learning models stems from poor generalization due to covariate shift ( Moreno-Torres et al. , 2012 ) when the probably approximately correct ( PAC ) learning i.i.d . assumption is invalid ( Valiant , 1984 ) i.e . the training distribution is different from the test distribution . One explanation for this is shortcut learning or incorrect feature attribution , where the model during training overfits to a set of training-data specific decision rules to explain the training data instead of modelling the more general causative factors that generated the data ( Goodfellow et al. , 2016 ; Reed & Marks , 1999 ; Geirhos et al. , 2020 ; Hermann & Lampinen , 2020 ; Parascandolo et al. , 2020 ; Arjovsky et al. , 2019 ; Zhang et al. , 2016 ) . In medical imaging , poor generalization due to test-set distribution shifts are common and this problem is exacerbated by small cohorts . Previous work has hypothesized that this poor generalization is in part due to the presence of confounding variables in the training data such as acquisition site or other image acquisition parameters because attribution maps ( aka saliency maps ; Simonyan et al . ( 2014 ) ) produced by the trained model do not highlight features that a human expert would use to make a diagnosis ( Zech et al. , 2018 ; DeGrave et al. , 2020 ; Badgeley et al. , 2019 ; Zhao et al. , 2019 ; Young et al. , 2019 ) . Previous researchers have made the assumption that saliency maps can demonstrate that the model is not overfit or behaving unexpectedly ( Pasa et al. , 2019 ; Tschandl et al. , 2020 ) . We started this work under the same assumption only to find the contradictory evidence we present in this paper . In this work , we set out to test the hypothesis that models with good generalization properties have attribution maps which only utilize the class-discriminative features to make predictions , by explicitly regularizing the models to ignore confounders using attribution priors ( Erion et al. , 2019 ; Ross et al. , 2017 ) , i.e. , to make predictions using the correct anatomy ( as a doctor would ) . We evaluated whether this regularization would A ) improve out of distribution generalization , and B ) change feature attribution to be more like the attribution priors . If there exists a relationship between the attribution map and generalization performance , we would expect these regularizations to positively impact both generalization and attribution quality simultaneously . To evaluate attribution quality , we define good attribution to be an attribution map that agrees strongly with expert knowledge in the form of a binary mask on the input data . We show that the existing and proposed feature-attribution-aware methods help facilitate generalization in the presence of a train-test distribution shift . However , while feature-attribution-aware methods change the attribution maps relative to baseline , there is no strong correlation between generalization performance and good attribution . This in turn challenges the assumption made in previous works that the “ incorrect ” attribution maps were indicative of poor generalization performance . This suggests that A ) efforts to validate model correctness using attribution maps may not be reliable , and B ) that efforts to control feature attribution using masks on the input may not function as expected . All code and datasets for this paper are publicly available1 . Our contributions include : • A synthetic dataset that encourages models to overfit to an easy to represent confounder instead of a more complicated counting task . • Two new tasks constructed from open medical datasets which have a correlation between the pathology and either imaging site ( site pathology correlation ; SPC ) or view ( view pathology correlation ; VPC ) , and we manipulate the nature of this correlation differently in the training and test distributions to create a distribution shift ( Figure 5 ) , introducing confounding variables as observed in previous work ( Zhao et al. , 2019 ; DeGrave et al. , 2020 ) . • Evaluation of existing methods for controlling feature attribution using mask information ; right for the right reasons ( RRR ; Ross et al . ( 2017 ) ) , GradMask ( Simpson et al. , 2019 ) , and adversarial domain invariance ( Tzeng et al. , 2017 ; Ganin & Lempitsky , 2015 ) . • A new method for controlling feature attribution based on minimizing activation differences between masked and unmasked images ( ActDiff ) . • Evaluate the relationship between generalization improvement and feature attribution in real- life out of distribution generalization tasks with traditional classifiers . 2 RELATED WORK . It is a well-documented phenomenon that convolutional neural networks ( CNNs ) , instead of building object-level representations of the input data , tend to find convenient surface-level statistics in the training data that are predictive of class ( Jo & Bengio , 2017 ) . Previous work has attempted to reduce the model ’ s proclivity to use confounding features by randomly masking out regions of the input ( DeVries & Taylor , 2017 ) , forcing the network to learn representations that aren ’ t dependent on a single input feature . However , this regularization approach gives no control over the kinds of representations learned by the model , so we do not include it in our study . Recently , multiple approaches have proposed to control feature representations by penalizing the model for producing saliency gradients outside of a regions of interest indicating the classdiscriminative feature ( Simpson et al. , 2019 ; Zhuang et al. , 2019 ; Rieger et al. , 2019 ) . These approaches were introduced by Right for the Right Reasons ( RRR ) , which showed impressive improvements in attribution correctness on synthetic data ( Ross et al. , 2017 ) . The follow-up work has generally demonstrated a small improvement in generalization accuracy on real data , and much more impressive results on synthetic data . Another feature attribution-aware regularization approach additionally dealt with class imbalances by increasing the impact of the gradients inside the region of interest of the under-represented class Zhuang et al . ( 2019 ) . One alternative to saliency-based methods , which can be noisy due to the ReLU activations allowing irrelevant features to pass through the activation function ( Kim et al. , 2019 ) , would be to leverage methods that aim to produce domain invariant features in the latent space of the network . These methods regularize the network such that the latent representations of two or more “ domains ” are encouraged to be as similar as possible , often by minimizing a distance metric or by employing an adversary that is trained to distinguish between the different domains ( Kouw & Loog , 2019 ; Ganin & Lempitsky , 2015 ; Tzeng et al. , 2015 ; Liu & Tuzel , 2016 ) . In this work , we view the masked version of the input as the training domain and the unmasked version of the input as the test domain , and compare these approaches with saliency-based approaches for the task of reducing the model ’ s reliance on confounding features . To the best of our knowledge , these strategies have not been tried to control feature attribution . 1https : //github.com/josephdviviano/saliency-red-herring 3 METHODS . Domain Invariance with the Activation Difference and Adversarial Loss : Leveraging ideas from domain adaptation , we introduce two methods designed to make the model invariant to features arising from outside of the attribution priors . The first is the embarrassingly simple Activation Difference ( ActDiff ) approach , which simply penalizes , for each input , the L2-normed distance between the masked and unmasked input ’ s latent representations . This loss is most similar to a style transfer approach which transforms a random noise image into one containing the same layerwise activations as some target image ( Gatys et al. , 2015 ) to apply a visual aesthetic to some input semantic contents , and encourages the network to build features which appear inside the masked regions even though it always sees the full image during training . Therefore we minimize Lact = ∑ ( Xmasked , x ) ∈D Lclf + λact||ol ( xmasked ) − ol ( x ) ||2 , ( 1 ) where ol ( x ) are the pre-activation outputs for layer l of the n-layer encoder f ( x ) when the network is presented with the original data x , ol ( xmasked ) are the pre-activations outputs for layer l when presented with masked data xmasked , and Lclf is the standard cross entropy loss . We define xmasked = x·xseg+shuffle ( x ) · ( 1 − xseg ) where background pixels are shuffled uniquely for each presentation to the network in order to destroy any spatial information available in those regions of the image without introducing any consistent artefacts into the image or shifts in the distribution of input intensities . This method is at a high level similar to using maximum mean discrepancy ( MMD ) for domain adaptation ( Baktashmotlagh et al. , 2016 ; 2013 ) where instead of minimizing the distance between the means of the two domain distributions , we instead minimize the distance between the features directly . One could replace the L2 norm with any Lk norm , and choices of k < 2 might be useful when regularizing larger latent representations as L2 distances collapse to a constant value in extremely high dimensional spaces due to the curse of dimensionality ( Aggarwal et al. , 2001 ) . We found during experimentation that regularizing the pre-activations led to better results at the cost of longer time to convergence , perhaps because the L2 norm is more effective when the feature vectors are not sparse , but we leave this conjecture to future work . The second approach we explore employs a discriminator D ( · ) optimized to distinguish between latent representations arising from passing xmasked or x through the encoder f ( · ) ( Tzeng et al. , 2017 ; Goodfellow et al. , 2014 ) . Simultaneously , we optimize the encoder f ( · ) to fool the discriminator and still produce representations that are predictive of the output class . Therefore , D and f are optimized using the LD and Lf respectively : LD = λdisc ( Exmasked [ logD ( f ( xmasked ) ) ] + Exmasked [ log ( 1−D ( f ( x ) ) ) ] ) ( 2 ) Lf = Lclf + λdisc ( Ex [ log ( 1−D ( f ( xmasked ) ) ) ] + Ex [ logD ( f ( x ) ) ] ) ( 3 ) This approach is similar to the one employed in ( Janizek et al. , 2020 ) , where the authors encouraged the model to be invariant to the view of the X-Ray ( Lateral vs PA ) , and here ‘ view ’ denotes whether the image is masked or not . D ( · ) had three fully-connected hidden layers of size 1024 before outputting a binary prediction . To facilitate the stability of training , we updated D ( · ) more frequently than the encoder treating this ratio as a hyperparameter . We optimized D ( · ) independently using Adam with a distinct learning rate , and applied spectral normalization to the hidden layers of D ( · ) . Direct Attribution Control with the Right for the Right Reasons and GradMask Loss : These input gradient attribution regularizers directly control which regions of the input are desirable for determining the class label by penalizing saliency outside of a defined input mask . The most basic gradient based “ input feature attribution ” can be calculated as ∂|ŷi|∂x for each input x ( Simonyan et al. , 2014 ; Lo et al. , 2015 ) . In the binary classification case , RRR ( Ross et al. , 2017 ) calculates saliency of the summed log probabilities of the 2 output classes with respect to the input x , Lrrr = ∑ ( xseg , x ) ∈D Lclf + λrrr · ∂ ( log ( p̂0 ) + log ( p̂1 ) ) 2 ∂x · ( 1− xseg ) , ( 4 ) where ( 1 − xseg ) is a binary mask that covers everything outside the defined regions of interest . The numerator in the RRR loss can be extended to the multi-class case by substituting ∑K k log ( p̂k ) . GradMask ( Simpson et al. , 2019 ) similarly calculates saliency using the contrast between the two output logits , and is only defined for the binary classification case , Lgradmask = ∑ ( xseg , x ) ∈D Lclf + λgradmask · ∣∣∣∣∂ |ŷ0 − ŷ1|∂x · ( 1− xseg ) ∣∣∣∣ 2 , ( 5 ) where ŷ0 and ŷ1 are the predicted outputs for our two classes . Classify Masked : We evaluated the effect imposing the attribution prior by simply training a model using masked data ( and evaluating it using unmasked data ) as a control experiment . The data was masked by shuffling the pixels outside of the mask during training , as was done for the domain invariance experiments to produce xmasked . We refer to these experiments as Masked .
This paper focuses on the confounder problem that spatially-seperated image regions (e.g. shoulders of xray images) might spuriously correlated with the target (e.g. pneumonia). If given a human-labeled region that is deemed important, we can decrease this spuriousness by regularizing the model toward the important region. They not only compare with several existing saliency-based methods (RRR and GradMask), but also propose 2 new methods (ActDiff, Adversarial) inspired from domain adapataion literature that the representation of the classifier should be similar between original image and the masked image (the image that the non-important region is shuffled). They compare in 1 synthetic dataset and 2 xray datasets. They show that (1) these methods (sometimes) hurt generalization when spuriousness does not exist, and (2) the model's saliency map is only weakly correlated with generalization performance, and thus doubting the validtiy of using saliency maps for diagnosing whether a model is overfit to spurious features.
SP:88181a6db5701fbd9a096e08d5f892d6c1bea0e9
Transformers are Deep Infinite-Dimensional Non-Mercer Binary Kernel Machines
Despite their ubiquity in core AI fields like natural language processing , the mechanics of deep attention-based neural networks like the “ Transformer ” model are not fully understood . In this article , we present a new perspective towards understanding how Transformers work . In particular , we show that the “ dot-product attention ” that is the core of the Transformer ’ s operation can be characterized as a kernel learning method on a pair of Banach spaces . In particular , the Transformer ’ s kernel is characterized as having an infinite feature dimension . Along the way we generalize the standard kernel learning problem to what we term a “ binary ” kernel learning problem , where data come from two input domains and a response is defined for every cross-domain pair . We prove a new representer theorem for these binary kernel machines with non-Mercer ( indefinite , asymmetric ) kernels ( implying that the functions learned are elements of reproducing kernel Banach spaces rather than Hilbert spaces ) , and also prove a new universal approximation theorem showing that the Transformer calculation can learn any binary non-Mercer reproducing kernel Banach space pair . We experiment with new kernels in Transformers , and obtain results that suggest the infinite dimensionality of the standard Transformer kernel is partially responsible for its performance . This paper ’ s results provide a new theoretical understanding of a very important but poorly understood model in modern machine learning . 1 INTRODUCTION . Since its proposal by Bahdanau et al . ( 2015 ) , so-called neural attention has become the backbone of many state-of-the-art deep learning models . This is true in particular in natural language processing ( NLP ) , where the Transformer model of Vaswani et al . ( 2017 ) has become ubiquitous . This ubiquity is such that much of the last few years ’ NLP breakthroughs have been due to developing new training regimes for Transformers ( Radford et al. , 2018 ; Devlin et al. , 2019 ; Yang et al. , 2019 ; Liu et al. , 2019 ; Wang et al. , 2019a ; Joshi et al. , 2020 ; Lan et al. , 2020 ; Brown et al. , 2020 , etc. ) . Like most modern deep neural networks , theoretical understanding of the Transformer has lagged behind the rate of Transformer-based performance improvements on AI tasks like NLP . Recently , several authors have noted Transformer operations ’ relationship to other , better-understood topics in deep learning theory , like the similarities between attention and convolution ( Ramachandran et al. , 2019 ; Cordonnier et al. , 2020 ) and the design of the residual blocks in multi-layer Transformers ( e.g. , Lu et al . ( 2019 ) ; see also the reordering of the main learned ( fully-connected or attentional ) operation , elementwise nonlinearity , and normalization in the original Transformer authors ’ official reference codebase ( Vaswani et al. , 2018 ) and in some more recent studies of deeper Transformers ( Wang et al. , 2019b ) to the “ pre-norm ” ordering of normalize , learned operation , nonlinearity , add residual ordering of modern ( “ v2 ” ) Resnets ( He et al. , 2016 ) ) . In this paper , we propose a new lens to understand the central component of the Transformer , its “ dot-product attention ” operation . In particular , we show dot-product attention can be characterized as a particular class of kernel method ( Schölkopf & Smola , 2002 ) . More specifically , it is a so-called indefinite and asymmetric kernel method , which refer to two separate generalizations of the classic class of kernels that does not require the classic assumptions of symmetry and positive ( semi- ) definiteness ( Ong et al. , 2004 ; Balcan et al. , 2008 ; Zhang et al. , 2009 ; Wu et al. , 2010 ; Loosli et al. , 2016 ; Oglic & Gärtner , 2018 ; 2019 , etc. ) . We in fact show in Theorem 2 below that dot-product attention can learn any asymmetric indefinite kernel . This insight has several interesting implications . Most immediately , it provides some theoretical justification for one of the more mysterious components of the Transformer model . It also potentially opens the door for the application of decades of classic kernel method theory towards understanding one of today ’ s most important neural network models , perhaps similarly to how tools from digital signal processing are widely used to study convolutional neural networks . We make a first step on this last point in this paper , proposing a generalization of prior kernel methods we call “ binary ” kernel machines , that learns how to predict distinct values for pairs of elements across two input sets , similar to an attention model . The remainder of this paper is organized as follows . Section 2 reviews the mathematical background of both Transformers and classic kernel methods . Section 3 presents the definition of kernel machines on reproducing kernel Banach spaces ( RKBS ’ s ) that we use to characterize Transformers . In particular we note that the Transformer can be described as having an infinite-dimensional feature space . Section 4 begins our theoretical results , explicitly describing the Transformer in terms of reproducing kernels , including explicit formulations of the Transformer ’ s kernel feature maps and its relation to prior kernels . Section 5 discusses Transformers as kernel learners , including a new representer theorem and a characterization of stochastic-gradient-descent-trained attention networks as approximate kernel learners . In Section 6 , we present empirical evidence that the infinite-dimensional character of the Transformer kernel may be somewhat responsible for the model ’ s effectiveness . Section 7 concludes and summarizes our work . 2 BACKGROUND AND RELATED WORK . 2.1 TRANSFORMER NEURAL NETWORK MODELS . The Transformer model ( Vaswani et al. , 2017 ) has become ubiquitous in many core AI applications like natural language processing . Here , we review its core components . Say we have two ordered sets of vectors , a set of “ source ” elements { s1 , s2 , . . . , sS } , sj ∈ Rds and a set of “ target ” elements { t1 , t2 , . . . , tT } , ti ∈ Rdt . In its most general form , the neural-network “ attention ” operation that forms the backbone of the Transformer model is to compute , for each ti , a ti-specific embedding of the source sequence { sj } Sj=1.1 The particular function used in the Transformer is the so-called “ scaled dot-product ” attention , which takes the form aij = ( WQti ) T ( WKsj ) √ d αij = exp ( aij ) ∑S j=1 exp ( aij ) t′i = S∑ j=1 αijW V sj ( 1 ) where W V , WK ∈ Rds×d , and WQ ∈ Rdt×d are learnable weight matrices , usually called the “ value , ” “ key , ” and “ query ” weight matrices , respectively . Usually multiple so-called “ attention heads ” with independent parameter matrices implement several parallel computations of ( 1 ) , with the Cartesian product ( vector concatenation ) of several d-dimensional head outputs forming the final output t′i . Usually the unnormalized aij ’ s are called attention scores or attention logits , and the normalized αij ’ s are called attention weights . In this paper , we restrict our focus to the dot-product formulation of attention shown in ( 1 ) . Several other alternative forms of attention that perform roughly the same function ( i.e. , mapping from Rds × Rdt to R ) have been proposed ( Bahdanau et al. , 2015 ; Luong et al. , 2015 ; Veličković et al. , 2018 ; Battaglia et al. , 2018 , etc . ) but the dot-product formulation of the Transformer is by far the most popular . 2.2 KERNEL METHODS AND GENERALIZATIONS OF KERNELS . Kernel methods ( Schölkopf & Smola , 2002 ; Steinwart & Christmann , 2008 , etc . ) are a classic and powerful class of machine learning methods . The key component of kernel methods are the namesake 1Often , the source and target sets are taken to be the same , si = ti ∀i . This instance of attention is called self attention . kernel functions , which allow the efficient mapping of input data from a low-dimensional data domain , where linear solutions to problems like classification or regression may not be possible , to a high- or infinite-dimensional embedding domain , where linear solutions can be found . Given two nonempty sets X and Y , a kernel function κ is a continuous function κ : X × Y → R. In the next few sections , we will review the classic symmetric and positive ( semi- ) definite , or Mercer , kernels , then discuss more general forms . 2.2.1 SYMMETRIC AND POSITIVE SEMIDEFINITE ( MERCER ) KERNELS . If X = Y , and for all xi , xj ∈ X = Y , a particular kernel κ has the properties symmetry : κ ( xi , xj ) = κ ( xj , xi ) ( 2a ) positive ( semi- ) definiteness : cTKc ≥ 0 ∀ c ∈ Rn ; i , j = 1 , . . . , n ; n ∈ N ( 2b ) whereK in ( 2b ) is the Gram matrix , defined as Kij = κ ( xi , xj ) , then κ is said to be a Mercer kernel . For Mercer kernels , it is well-known that , among other facts , ( i ) we can define a Hilbert space of functions on X , denotedHκ ( called the reproducing kernel Hilbert space , or RKHS , associated with the reproducing kernel κ ) , ( ii ) Hκ has for each x a ( continuous ) unique element δx called a point evaluation functional , with the property f ( x ) = δx ( f ) ∀f ∈ Hκ , ( iii ) κ has the so-called reproducing property , 〈f , κ ( x , · ) 〉Hκ = f ( x ) ∀f ∈ Hκ , where 〈· , ·〉Hκ is the inner product on Hκ , and ( iv ) we can define a “ feature map ” Φ : X → FH , where FH is another Hilbert space sometimes called the feature space , and κ ( x , y ) = 〈Φ ( x ) , Φ ( y ) 〉FH ( where 〈· , ·〉FH is the inner product associated with FH ) . This last point gives rise to the kernel trick for RKHS ’ s . From a machine learning and optimization perspective , kernels that are symmetric and positive ( semi- ) definite ( PSD ) are desirable because those properties guarantee that empirical-risk-minimization kernel learning problems like support vector machines ( SVMs ) , Gaussian processes , etc . are convex . Convexity gives appealing guarantees for the tractability of a learning problem and optimality of solutions . 2.2.2 LEARNING WITH NON-MERCER KERNELS . Learning methods with non-Mercer kernels , or kernels that relax the assumptions ( 2 ) , have been studied for some time . One line of work ( Lin & Lin , 2003 ; Ong et al. , 2004 ; Chen & Ye , 2008 ; Luss & D ’ aspremont , 2008 ; Alabdulmohsin et al. , 2015 ; Loosli et al. , 2016 ; Oglic & Gärtner , 2018 ; 2019 , etc . ) has focused on learning with symmetric but indefinite kernels , i.e. , kernels that do not satisfy ( 2b ) . Indefinite kernels have been identified as reproducing kernels for so-called reproducing kernel Kreı̆n spaces ( RKKS ’ s ) since Schwartz ( 1964 ) and Alpay ( 1991 ) . Replacing a Mercer kernel in a learning problem like an SVM with an indefinite kernel makes the optimization problem nonconvex in general ( as the kernel Gram matrixK is no longer always PSD ) . Some early work in learning with indefinite kernels tried to ameliorate this problem by modifying the spectrum of the Gram matrix such that it again becomes PSD ( e.g. , Graepel et al. , 1998 ; Roth et al. , 2003 ; Wu et al. , 2005 ) . More recently , Loosli et al . ( 2016 ) ; Oglic & Gärtner ( 2018 ) , among others , have proposed optimization procedures to learn in the RKKS directly . They report better performance on some learning problems when using indefinite kernels than either popular Mercer kernels or spectrally-modified indefinite kernels , suggesting that sacrificing convexity can empirically give a performance boost . This conclusion is of course reminiscent of the concurrent experience of deep neural networks , which are hard to optimize due to their high degree of non-convexity , yet give superior performance to many other methods . Another line of work has explored the application of kernel methods to learning in more general Banach spaces , i.e. , reproducing kernel Banach spaces ( RKBS ’ s ) ( Zhang et al. , 2009 ) . Various constructions to serve as the reproducing kernel for a Banach space ( replacing the inner product of an RKHS ) have been proposed , including semi-inner products ( Zhang et al. , 2009 ) , positive-definite bilinear forms via a Fourier transform construction ( Fasshauer et al. , 2015 ) , and others ( Song et al. , 2013 ; Georgiev et al. , 2014 , etc. ) . In this work , we consider RKBS ’ s whose kernels may be neither symmetric nor PSD . A definition of these spaces is presented next .
The paper aims at providing a mathematical structure for explaining the mechanism behind the attention block characteristic to transformers. The focus of the paper is on the scaled dot-product attention, reviewed in Eq. (1). In my understanding, the whole mechanism can be seen as an instance of the set kernel. The inputs are bags of items, where an item is denoted with $s_j$. The items are embedded into some feature space via matrix multiplication $W^V s_j$. The set kernel representation of a bag is obtained by weighted averaging of item embeddings, where the item-specific weight is the output of an exponential family model. The latter model is obtained by combining embeddings of items and corresponding context vectors, denoted with $t_i$ (see Eq. 1 for more details).
SP:48e591a5fa2802fc4bb0c7100d120ff860b074f3
Transformers are Deep Infinite-Dimensional Non-Mercer Binary Kernel Machines
Despite their ubiquity in core AI fields like natural language processing , the mechanics of deep attention-based neural networks like the “ Transformer ” model are not fully understood . In this article , we present a new perspective towards understanding how Transformers work . In particular , we show that the “ dot-product attention ” that is the core of the Transformer ’ s operation can be characterized as a kernel learning method on a pair of Banach spaces . In particular , the Transformer ’ s kernel is characterized as having an infinite feature dimension . Along the way we generalize the standard kernel learning problem to what we term a “ binary ” kernel learning problem , where data come from two input domains and a response is defined for every cross-domain pair . We prove a new representer theorem for these binary kernel machines with non-Mercer ( indefinite , asymmetric ) kernels ( implying that the functions learned are elements of reproducing kernel Banach spaces rather than Hilbert spaces ) , and also prove a new universal approximation theorem showing that the Transformer calculation can learn any binary non-Mercer reproducing kernel Banach space pair . We experiment with new kernels in Transformers , and obtain results that suggest the infinite dimensionality of the standard Transformer kernel is partially responsible for its performance . This paper ’ s results provide a new theoretical understanding of a very important but poorly understood model in modern machine learning . 1 INTRODUCTION . Since its proposal by Bahdanau et al . ( 2015 ) , so-called neural attention has become the backbone of many state-of-the-art deep learning models . This is true in particular in natural language processing ( NLP ) , where the Transformer model of Vaswani et al . ( 2017 ) has become ubiquitous . This ubiquity is such that much of the last few years ’ NLP breakthroughs have been due to developing new training regimes for Transformers ( Radford et al. , 2018 ; Devlin et al. , 2019 ; Yang et al. , 2019 ; Liu et al. , 2019 ; Wang et al. , 2019a ; Joshi et al. , 2020 ; Lan et al. , 2020 ; Brown et al. , 2020 , etc. ) . Like most modern deep neural networks , theoretical understanding of the Transformer has lagged behind the rate of Transformer-based performance improvements on AI tasks like NLP . Recently , several authors have noted Transformer operations ’ relationship to other , better-understood topics in deep learning theory , like the similarities between attention and convolution ( Ramachandran et al. , 2019 ; Cordonnier et al. , 2020 ) and the design of the residual blocks in multi-layer Transformers ( e.g. , Lu et al . ( 2019 ) ; see also the reordering of the main learned ( fully-connected or attentional ) operation , elementwise nonlinearity , and normalization in the original Transformer authors ’ official reference codebase ( Vaswani et al. , 2018 ) and in some more recent studies of deeper Transformers ( Wang et al. , 2019b ) to the “ pre-norm ” ordering of normalize , learned operation , nonlinearity , add residual ordering of modern ( “ v2 ” ) Resnets ( He et al. , 2016 ) ) . In this paper , we propose a new lens to understand the central component of the Transformer , its “ dot-product attention ” operation . In particular , we show dot-product attention can be characterized as a particular class of kernel method ( Schölkopf & Smola , 2002 ) . More specifically , it is a so-called indefinite and asymmetric kernel method , which refer to two separate generalizations of the classic class of kernels that does not require the classic assumptions of symmetry and positive ( semi- ) definiteness ( Ong et al. , 2004 ; Balcan et al. , 2008 ; Zhang et al. , 2009 ; Wu et al. , 2010 ; Loosli et al. , 2016 ; Oglic & Gärtner , 2018 ; 2019 , etc. ) . We in fact show in Theorem 2 below that dot-product attention can learn any asymmetric indefinite kernel . This insight has several interesting implications . Most immediately , it provides some theoretical justification for one of the more mysterious components of the Transformer model . It also potentially opens the door for the application of decades of classic kernel method theory towards understanding one of today ’ s most important neural network models , perhaps similarly to how tools from digital signal processing are widely used to study convolutional neural networks . We make a first step on this last point in this paper , proposing a generalization of prior kernel methods we call “ binary ” kernel machines , that learns how to predict distinct values for pairs of elements across two input sets , similar to an attention model . The remainder of this paper is organized as follows . Section 2 reviews the mathematical background of both Transformers and classic kernel methods . Section 3 presents the definition of kernel machines on reproducing kernel Banach spaces ( RKBS ’ s ) that we use to characterize Transformers . In particular we note that the Transformer can be described as having an infinite-dimensional feature space . Section 4 begins our theoretical results , explicitly describing the Transformer in terms of reproducing kernels , including explicit formulations of the Transformer ’ s kernel feature maps and its relation to prior kernels . Section 5 discusses Transformers as kernel learners , including a new representer theorem and a characterization of stochastic-gradient-descent-trained attention networks as approximate kernel learners . In Section 6 , we present empirical evidence that the infinite-dimensional character of the Transformer kernel may be somewhat responsible for the model ’ s effectiveness . Section 7 concludes and summarizes our work . 2 BACKGROUND AND RELATED WORK . 2.1 TRANSFORMER NEURAL NETWORK MODELS . The Transformer model ( Vaswani et al. , 2017 ) has become ubiquitous in many core AI applications like natural language processing . Here , we review its core components . Say we have two ordered sets of vectors , a set of “ source ” elements { s1 , s2 , . . . , sS } , sj ∈ Rds and a set of “ target ” elements { t1 , t2 , . . . , tT } , ti ∈ Rdt . In its most general form , the neural-network “ attention ” operation that forms the backbone of the Transformer model is to compute , for each ti , a ti-specific embedding of the source sequence { sj } Sj=1.1 The particular function used in the Transformer is the so-called “ scaled dot-product ” attention , which takes the form aij = ( WQti ) T ( WKsj ) √ d αij = exp ( aij ) ∑S j=1 exp ( aij ) t′i = S∑ j=1 αijW V sj ( 1 ) where W V , WK ∈ Rds×d , and WQ ∈ Rdt×d are learnable weight matrices , usually called the “ value , ” “ key , ” and “ query ” weight matrices , respectively . Usually multiple so-called “ attention heads ” with independent parameter matrices implement several parallel computations of ( 1 ) , with the Cartesian product ( vector concatenation ) of several d-dimensional head outputs forming the final output t′i . Usually the unnormalized aij ’ s are called attention scores or attention logits , and the normalized αij ’ s are called attention weights . In this paper , we restrict our focus to the dot-product formulation of attention shown in ( 1 ) . Several other alternative forms of attention that perform roughly the same function ( i.e. , mapping from Rds × Rdt to R ) have been proposed ( Bahdanau et al. , 2015 ; Luong et al. , 2015 ; Veličković et al. , 2018 ; Battaglia et al. , 2018 , etc . ) but the dot-product formulation of the Transformer is by far the most popular . 2.2 KERNEL METHODS AND GENERALIZATIONS OF KERNELS . Kernel methods ( Schölkopf & Smola , 2002 ; Steinwart & Christmann , 2008 , etc . ) are a classic and powerful class of machine learning methods . The key component of kernel methods are the namesake 1Often , the source and target sets are taken to be the same , si = ti ∀i . This instance of attention is called self attention . kernel functions , which allow the efficient mapping of input data from a low-dimensional data domain , where linear solutions to problems like classification or regression may not be possible , to a high- or infinite-dimensional embedding domain , where linear solutions can be found . Given two nonempty sets X and Y , a kernel function κ is a continuous function κ : X × Y → R. In the next few sections , we will review the classic symmetric and positive ( semi- ) definite , or Mercer , kernels , then discuss more general forms . 2.2.1 SYMMETRIC AND POSITIVE SEMIDEFINITE ( MERCER ) KERNELS . If X = Y , and for all xi , xj ∈ X = Y , a particular kernel κ has the properties symmetry : κ ( xi , xj ) = κ ( xj , xi ) ( 2a ) positive ( semi- ) definiteness : cTKc ≥ 0 ∀ c ∈ Rn ; i , j = 1 , . . . , n ; n ∈ N ( 2b ) whereK in ( 2b ) is the Gram matrix , defined as Kij = κ ( xi , xj ) , then κ is said to be a Mercer kernel . For Mercer kernels , it is well-known that , among other facts , ( i ) we can define a Hilbert space of functions on X , denotedHκ ( called the reproducing kernel Hilbert space , or RKHS , associated with the reproducing kernel κ ) , ( ii ) Hκ has for each x a ( continuous ) unique element δx called a point evaluation functional , with the property f ( x ) = δx ( f ) ∀f ∈ Hκ , ( iii ) κ has the so-called reproducing property , 〈f , κ ( x , · ) 〉Hκ = f ( x ) ∀f ∈ Hκ , where 〈· , ·〉Hκ is the inner product on Hκ , and ( iv ) we can define a “ feature map ” Φ : X → FH , where FH is another Hilbert space sometimes called the feature space , and κ ( x , y ) = 〈Φ ( x ) , Φ ( y ) 〉FH ( where 〈· , ·〉FH is the inner product associated with FH ) . This last point gives rise to the kernel trick for RKHS ’ s . From a machine learning and optimization perspective , kernels that are symmetric and positive ( semi- ) definite ( PSD ) are desirable because those properties guarantee that empirical-risk-minimization kernel learning problems like support vector machines ( SVMs ) , Gaussian processes , etc . are convex . Convexity gives appealing guarantees for the tractability of a learning problem and optimality of solutions . 2.2.2 LEARNING WITH NON-MERCER KERNELS . Learning methods with non-Mercer kernels , or kernels that relax the assumptions ( 2 ) , have been studied for some time . One line of work ( Lin & Lin , 2003 ; Ong et al. , 2004 ; Chen & Ye , 2008 ; Luss & D ’ aspremont , 2008 ; Alabdulmohsin et al. , 2015 ; Loosli et al. , 2016 ; Oglic & Gärtner , 2018 ; 2019 , etc . ) has focused on learning with symmetric but indefinite kernels , i.e. , kernels that do not satisfy ( 2b ) . Indefinite kernels have been identified as reproducing kernels for so-called reproducing kernel Kreı̆n spaces ( RKKS ’ s ) since Schwartz ( 1964 ) and Alpay ( 1991 ) . Replacing a Mercer kernel in a learning problem like an SVM with an indefinite kernel makes the optimization problem nonconvex in general ( as the kernel Gram matrixK is no longer always PSD ) . Some early work in learning with indefinite kernels tried to ameliorate this problem by modifying the spectrum of the Gram matrix such that it again becomes PSD ( e.g. , Graepel et al. , 1998 ; Roth et al. , 2003 ; Wu et al. , 2005 ) . More recently , Loosli et al . ( 2016 ) ; Oglic & Gärtner ( 2018 ) , among others , have proposed optimization procedures to learn in the RKKS directly . They report better performance on some learning problems when using indefinite kernels than either popular Mercer kernels or spectrally-modified indefinite kernels , suggesting that sacrificing convexity can empirically give a performance boost . This conclusion is of course reminiscent of the concurrent experience of deep neural networks , which are hard to optimize due to their high degree of non-convexity , yet give superior performance to many other methods . Another line of work has explored the application of kernel methods to learning in more general Banach spaces , i.e. , reproducing kernel Banach spaces ( RKBS ’ s ) ( Zhang et al. , 2009 ) . Various constructions to serve as the reproducing kernel for a Banach space ( replacing the inner product of an RKHS ) have been proposed , including semi-inner products ( Zhang et al. , 2009 ) , positive-definite bilinear forms via a Fourier transform construction ( Fasshauer et al. , 2015 ) , and others ( Song et al. , 2013 ; Georgiev et al. , 2014 , etc. ) . In this work , we consider RKBS ’ s whose kernels may be neither symmetric nor PSD . A definition of these spaces is presented next .
In this paper, the authors treat a particular Transformer, "dot-product attention", as an RKBS kernel called "exponentiated query-key kernel". The explicit form of feature maps and Bach space are given. Moreover, authors term a binary kernel learning problems within the framework of regularized empirical risk minimization. The problem and the correponding representer theorem is new due to its extension to Banach space. A new approximation theorem is also proved and some experiements are done.
SP:48e591a5fa2802fc4bb0c7100d120ff860b074f3
A Block Minifloat Representation for Training Deep Neural Networks
1 INTRODUCTION . The energy consumption and execution time associated with training Deep Neural Networks ( DNNs ) is directly related to the precision of the underlying numerical representation . Most commercial accelerators , such as NVIDIA Graphics Processing Units ( GPUs ) , employ conventional floating-point representations due to their standard of use and wide dynamic range . However , double-precision ( FP64 ) and single-precision ( FP32 ) formats have relatively high memory bandwidth requirements and incur significant hardware overhead for general matrix multiplication ( GEMM ) . To reduce these costs and deliver training at increased speed and scale , representations have moved to 16-bit formats , with NVIDIA and Google providing FP16 ( IEEE-754 , 2019 ) and Bfloat16 ( Kalamkar et al. , 2019 ) respectively . With computational requirements for DNNs likely to increase , further performance gains are necessary in both datacenter and edge devices , where there are stricter physical constraints . New number representations must be easy to use and lead to high accuracy results . Recent 8-bit floating-point representations have shown particular promise , achieving equivalent FP32 accuracy over different tasks and datasets ( Wang et al. , 2018 ; Sun et al. , 2019 ) . We refer to such representations as minifloats in this paper . Minifloats are ideal candidates for optimization . By varying the number of exponent and mantissa bits , many formats can be explored for different trade-offs of dynamic range and precision . These include logarithmic and fixed point representations which provide substantial gains in speed and hardware density compared to their floating-point counterparts . For instance , 32-bit integer adders are approximately 10× smaller and 4× more energy efficient than comparative FP16 units ( Dally , 2015 ) . That said , fixed point representations still lack the dynamic range necessary to represent small gradients for backpropagation , and must be combined with other techniques for training convergence . Block floating point ( BFP ) in ( Yang et al. , 2019 ; Drumond et al. , 2018 ) share exponents across blocks of 8-bit integer numbers , and provide a type of coarse-grained dynamic range for training . This approach will typically incur some accuracy loss on more challenging datasets , however all dotproducts within the block can be computed with dense fixed point logic . In comparison , HFP8 ( Sun et al. , 2019 ) minifloats require larger floating-point units ( expensive FP16 adders in particular ) but have at least 5 exponent bits dedicated to each gradient and suffer zero degradation in training accuracy . It would seem that an ideal representation should bridge the gap between each of these approaches . Our work achieves this for 8-bit and sub 8-bit precision schemes , overcoming two key challenges in the process . These are listed below and discussed with related works . 1.1 CHALLENGES AND RELATED WORK . Minimising data loss with fewer bits : While several works have demonstrated training with fewer than 8 bits of precision , they typically lead to loss of accuracy on more complex problems and have performance bottlenecks because parts of the algorithm are left in high precision ( Hubara et al. , 2017 ; Zhou et al. , 2016 ; Miyashita et al. , 2016 ) . Therefore , training end-to-end with reduced precision representations that are persistent remains a key challenge . In this regard , 8 bit tensors with 16-bit updates can be trained effectively ( Banner et al. , 2018 ) . Data loss arises when formats do not have enough range to capture variations in tensor distributions during training . BFloat ( Kalamkar et al. , 2019 ) adds two extra exponent bits for a custom 16-bit representation , and the Apex library is used in ( Micikevicius et al. , 2017 ; Wang et al. , 2018 ; Sun et al. , 2019 ) for scaling the loss function into a numerically representable range . Block floating point and other variants apply similar functionality for fixed point numbers , but at a finer granularity . WAGE ( Wu et al. , 2018 ) uses layer-wise scaling factors , SWALP ( Yang et al. , 2019 ) shares exponents across feature maps and convolution channels , and HBFP ( Drumond et al. , 2018 ) does the same for dot-products , though their implementation requires caching of intermediate activations in FP32 and wide weight storage for better accuracy . S2FP8 ( Cambier et al. , 2020 ) replaces loss-scaling in FP8 ( Wang et al. , 2018 ) with squeeze and shift factors that center 8-bit minifloats over the mean exponent of the value distribution . Shift factors operate similarly to BFP shared exponents , whereas squeeze factors can divert precision away from high value regions leading to errors in dot-product calculations . We provide some empirical evidence of this effect in Section 4.5 . Finally , HFP8 ( Sun et al. , 2019 ) defines two minifloat formats that are optimized for range and precision requirements of forward and backward paths separately . In this work , we seek minifloat formats that are also optimized for arithmetic density . Increasing the performance density of floating-point : Most DNN training frameworks are developed with GEMM accumulation in FP32 . The authors in ( Wang et al. , 2018 ) reduced the accumulation width to FP16 with chunk-based computations and stochastic rounding . However , training minifloats with even denser dot-products has not been demonstrated . For DNN inference , ELMA ( Johnson , 2018 ) and posit number systems ( Gustafson & Yonemoto , 2017 ) describe arithmetic that accumulate minifloat-like numbers as integers . Such work is applicable when the number of exponent bits is small , however training under such regimes can lead to data loss due to limited dynamic range . 1.2 CONTRIBUTIONS . In this paper , we present the Block Minifloat ( BM ) representation which addresses both of the aforementioned challenges . BM is a modification of block floating point that replaces the fixed point values with minifloats , whilst maintaining shared exponents across blocks of numbers . BM formats generalise a far wider spectrum of reduced precision representations and produce better outcomes than previous 8-bit regimes . Specific contributions of our work include : • Block Minifloat ( BM ) , a more efficient alternative to INT8 and FP8 for end-to-end DNN training . Shared exponent biases provide dynamic range and accuracy , while small exponent encodings provide fine-grained dynamic range and reduce the hardware cost of GEMM accumulation . • A new 8-bit floating-point format that uses no more than 4 exponent bits , achieving equivalent accuracy to floating-point with denser hardware via efficient Kulisch accumulation . • An exploration of the BM design space showing high accuracy DNN training with sub 8-bit representations for all weights , activations and gradients . This includes two techniques for minimising data loss of a practical implementation , namely gradual underflow and cost-aware block designs . 50 |X| minifloat ( 3,2 ) log 2 |a| |a| value distribution Align with max . exponent ß 26 Figure 2 : Exponent bias shifts the minifloat distribution to align with the maximum exponent of the value distribution 2 BLOCK MINIFLOAT REPRESENTATION . 2.1 MINIFLOAT NUMBER FORMAT . Equation ( 1 ) computes the real value of a minifloat number , where ( e , m ) denote the number of exponent and mantissa bits in the representation . X 〈 e , m 〉 = { E = 0 , ( −1 ) s × 21−β × ( 0 + F × 2−m ) ( denormal ) otherwise , ( −1 ) s × 2E−β × ( 1 + F × 2−m ) ( normal ) ( 1 ) The decimal expansions of the exponent and mantissa are both unsigned integers , given by E and F respectively , s refers to the sign bit and β = 2e−1 − 1 is the exponent bias for the binaryoffset encoding scheme . This is consistent with IEEE-754 floating-point standards , except that our minifloats are considerably smaller ( 4-8 bits only ) , can generalise to multiple ( e , m ) configurations , and do not handle nan/infinity bit patterns . Instead , arithmetic is allowed to saturate at the limits of the representable range [ X+min , X + max ] . For example , a minifloat representation with X 〈 4 , 3 〉 have exponent and mantissas that range between [ 0 , 15 ] and [ 0 , 7 ] respectively . Therefore , the largest normal and smallest denormal positive numbers areX+max = 480 andX + min = 2 −9 . This corresponds to a dynamic range of 108 dB shown in Table 7 in Appendix A.1 . 2.2 SHARED EXPONENT BIAS . The main difference between minifloat and block minifloat ( BM ) representations are highlighted in Figure 1 . Minifloats have one exponent per element , but that exponent must be wide enough to tolerate changes in DNN tensor distributions during training ( i.e . 5 bits for gradients in FP8 ( Wang et al. , 2018 ) ) . In contrast , BM share exponent biases across blocks of N minifloat numbers . This provides equivalent dynamic range with respect to the block , but with fewer exponent bits than the original minifloat format . Block floating point ( BFP ) operates similarly , but all numbers within the block are integers ( Drumond et al. , 2018 ) . BM can generalise for this case , i.e . when e = 0 . The real value of the ith element from BM tensor a is given in Equation ( 2 ) , where X is an unbiased minifloat tensor , represented by ( e , m ) exponent and mantissa bits , and βa is the shared exponent bias . ai = Xi 〈 e , m 〉 × 2−βa ( 2 ) In this example , ai can only be represented accurately when the shared exponent bias βa ( calculated for the entire tensor ) and the distribution of X jointly captures the value distribution of a . For example , large and small values in a could saturate or be lost altogether if βa is too large or too small . However , some leeway exists when exponents are shared across dot products . This is because dot products are reduce operations , meaning their sum is dominated by the largest values in the inputs . For this reason , we calculate βa to specifically guard against overflow , and unlike ( Cambier et al. , 2020 ) we don ’ t apply any scaling which could divert precision away from larger value regions . Our method of updating β during training is illustrated in Figure 2 and formalized in Equation 3 below . βa = max ( blog2 |a|c ) − ( 2e − 1 ) ( 3 ) The first term denotes the maximum exponent for the tensor a , which changes and must be updated during training , while the second term is fixed and refers to the maximum exponent of X . In terms of hardware , shared biases ensure that all dot products can be computed with denser minifloat arithmetic . This is shown in Equation 4 for BM tensors a and b , each with N elements . a · b = N∑ i=1 ( ( Xai × 2−βa ) × ( Xbi × 2−βb ) ) = 2− ( βa+βb ) × ( Xa ·Xb ) ( 4 ) The dot product , Xa ·Xb , have minifloat formats with smaller exponents , while the cost of calculating , storing and aligning the exponent biases during training is amortized over the length of the dot-product . Next we show how minifloat formats with fewer exponent bits lead to faster and more compact hardware . 2.3 KULISCH ACCUMULATION In the above equations , kadd calculates the number of bits required for the largest product of two numbers , plus one extra bit for the addition , and kshift determines the maximum number of bits the mantissa product must be shifted to align with the addend . Crucially , by considering the size of kadd and kshift , BM formats can be designed to trade-off fine-grained dynamic range ( i.e . exponent bits ) for more precision and smaller hardware . In fact , formats with exponents up to 4 bits may yield kadd of approximately the same size as INT8/INT32 arithmetic units , while kadd becomes prohibitively wider and more expensive for larger exponents . This is clearly shown via example in Table 1 above , but more importantly , it is supported by hardware synthesis results given in Section 5 and Appendix A.4 . For example , an 8-bit minifloat format having 4 exponent bits achieves a 1.6× area reduction compared to HFP8 ( Sun et al. , 2019 ) with 5 exponent bits . Furthermore , through an extensive set of experiments we discover that such representations can also achieve high training accuracy which forms a key contribution of our work .
The authors proposes block-minifloat (BM), a floating-point format for DNN training. BM is a fairly simple extension to block floating-point (BFP), which was proposed in (Drumond 2018 and Yang 2019). In BFP, a block of integer mantissas share a single exponent. In BM, a block of narrow floats share a single exponent bias. The shared exponent bias helps to shorten the exponent field on each individual float element. This is a good contribution, though a bit trivial.
SP:2cabed9c97692e64a609bb5a66fe7505c53c59fb
A Block Minifloat Representation for Training Deep Neural Networks
1 INTRODUCTION . The energy consumption and execution time associated with training Deep Neural Networks ( DNNs ) is directly related to the precision of the underlying numerical representation . Most commercial accelerators , such as NVIDIA Graphics Processing Units ( GPUs ) , employ conventional floating-point representations due to their standard of use and wide dynamic range . However , double-precision ( FP64 ) and single-precision ( FP32 ) formats have relatively high memory bandwidth requirements and incur significant hardware overhead for general matrix multiplication ( GEMM ) . To reduce these costs and deliver training at increased speed and scale , representations have moved to 16-bit formats , with NVIDIA and Google providing FP16 ( IEEE-754 , 2019 ) and Bfloat16 ( Kalamkar et al. , 2019 ) respectively . With computational requirements for DNNs likely to increase , further performance gains are necessary in both datacenter and edge devices , where there are stricter physical constraints . New number representations must be easy to use and lead to high accuracy results . Recent 8-bit floating-point representations have shown particular promise , achieving equivalent FP32 accuracy over different tasks and datasets ( Wang et al. , 2018 ; Sun et al. , 2019 ) . We refer to such representations as minifloats in this paper . Minifloats are ideal candidates for optimization . By varying the number of exponent and mantissa bits , many formats can be explored for different trade-offs of dynamic range and precision . These include logarithmic and fixed point representations which provide substantial gains in speed and hardware density compared to their floating-point counterparts . For instance , 32-bit integer adders are approximately 10× smaller and 4× more energy efficient than comparative FP16 units ( Dally , 2015 ) . That said , fixed point representations still lack the dynamic range necessary to represent small gradients for backpropagation , and must be combined with other techniques for training convergence . Block floating point ( BFP ) in ( Yang et al. , 2019 ; Drumond et al. , 2018 ) share exponents across blocks of 8-bit integer numbers , and provide a type of coarse-grained dynamic range for training . This approach will typically incur some accuracy loss on more challenging datasets , however all dotproducts within the block can be computed with dense fixed point logic . In comparison , HFP8 ( Sun et al. , 2019 ) minifloats require larger floating-point units ( expensive FP16 adders in particular ) but have at least 5 exponent bits dedicated to each gradient and suffer zero degradation in training accuracy . It would seem that an ideal representation should bridge the gap between each of these approaches . Our work achieves this for 8-bit and sub 8-bit precision schemes , overcoming two key challenges in the process . These are listed below and discussed with related works . 1.1 CHALLENGES AND RELATED WORK . Minimising data loss with fewer bits : While several works have demonstrated training with fewer than 8 bits of precision , they typically lead to loss of accuracy on more complex problems and have performance bottlenecks because parts of the algorithm are left in high precision ( Hubara et al. , 2017 ; Zhou et al. , 2016 ; Miyashita et al. , 2016 ) . Therefore , training end-to-end with reduced precision representations that are persistent remains a key challenge . In this regard , 8 bit tensors with 16-bit updates can be trained effectively ( Banner et al. , 2018 ) . Data loss arises when formats do not have enough range to capture variations in tensor distributions during training . BFloat ( Kalamkar et al. , 2019 ) adds two extra exponent bits for a custom 16-bit representation , and the Apex library is used in ( Micikevicius et al. , 2017 ; Wang et al. , 2018 ; Sun et al. , 2019 ) for scaling the loss function into a numerically representable range . Block floating point and other variants apply similar functionality for fixed point numbers , but at a finer granularity . WAGE ( Wu et al. , 2018 ) uses layer-wise scaling factors , SWALP ( Yang et al. , 2019 ) shares exponents across feature maps and convolution channels , and HBFP ( Drumond et al. , 2018 ) does the same for dot-products , though their implementation requires caching of intermediate activations in FP32 and wide weight storage for better accuracy . S2FP8 ( Cambier et al. , 2020 ) replaces loss-scaling in FP8 ( Wang et al. , 2018 ) with squeeze and shift factors that center 8-bit minifloats over the mean exponent of the value distribution . Shift factors operate similarly to BFP shared exponents , whereas squeeze factors can divert precision away from high value regions leading to errors in dot-product calculations . We provide some empirical evidence of this effect in Section 4.5 . Finally , HFP8 ( Sun et al. , 2019 ) defines two minifloat formats that are optimized for range and precision requirements of forward and backward paths separately . In this work , we seek minifloat formats that are also optimized for arithmetic density . Increasing the performance density of floating-point : Most DNN training frameworks are developed with GEMM accumulation in FP32 . The authors in ( Wang et al. , 2018 ) reduced the accumulation width to FP16 with chunk-based computations and stochastic rounding . However , training minifloats with even denser dot-products has not been demonstrated . For DNN inference , ELMA ( Johnson , 2018 ) and posit number systems ( Gustafson & Yonemoto , 2017 ) describe arithmetic that accumulate minifloat-like numbers as integers . Such work is applicable when the number of exponent bits is small , however training under such regimes can lead to data loss due to limited dynamic range . 1.2 CONTRIBUTIONS . In this paper , we present the Block Minifloat ( BM ) representation which addresses both of the aforementioned challenges . BM is a modification of block floating point that replaces the fixed point values with minifloats , whilst maintaining shared exponents across blocks of numbers . BM formats generalise a far wider spectrum of reduced precision representations and produce better outcomes than previous 8-bit regimes . Specific contributions of our work include : • Block Minifloat ( BM ) , a more efficient alternative to INT8 and FP8 for end-to-end DNN training . Shared exponent biases provide dynamic range and accuracy , while small exponent encodings provide fine-grained dynamic range and reduce the hardware cost of GEMM accumulation . • A new 8-bit floating-point format that uses no more than 4 exponent bits , achieving equivalent accuracy to floating-point with denser hardware via efficient Kulisch accumulation . • An exploration of the BM design space showing high accuracy DNN training with sub 8-bit representations for all weights , activations and gradients . This includes two techniques for minimising data loss of a practical implementation , namely gradual underflow and cost-aware block designs . 50 |X| minifloat ( 3,2 ) log 2 |a| |a| value distribution Align with max . exponent ß 26 Figure 2 : Exponent bias shifts the minifloat distribution to align with the maximum exponent of the value distribution 2 BLOCK MINIFLOAT REPRESENTATION . 2.1 MINIFLOAT NUMBER FORMAT . Equation ( 1 ) computes the real value of a minifloat number , where ( e , m ) denote the number of exponent and mantissa bits in the representation . X 〈 e , m 〉 = { E = 0 , ( −1 ) s × 21−β × ( 0 + F × 2−m ) ( denormal ) otherwise , ( −1 ) s × 2E−β × ( 1 + F × 2−m ) ( normal ) ( 1 ) The decimal expansions of the exponent and mantissa are both unsigned integers , given by E and F respectively , s refers to the sign bit and β = 2e−1 − 1 is the exponent bias for the binaryoffset encoding scheme . This is consistent with IEEE-754 floating-point standards , except that our minifloats are considerably smaller ( 4-8 bits only ) , can generalise to multiple ( e , m ) configurations , and do not handle nan/infinity bit patterns . Instead , arithmetic is allowed to saturate at the limits of the representable range [ X+min , X + max ] . For example , a minifloat representation with X 〈 4 , 3 〉 have exponent and mantissas that range between [ 0 , 15 ] and [ 0 , 7 ] respectively . Therefore , the largest normal and smallest denormal positive numbers areX+max = 480 andX + min = 2 −9 . This corresponds to a dynamic range of 108 dB shown in Table 7 in Appendix A.1 . 2.2 SHARED EXPONENT BIAS . The main difference between minifloat and block minifloat ( BM ) representations are highlighted in Figure 1 . Minifloats have one exponent per element , but that exponent must be wide enough to tolerate changes in DNN tensor distributions during training ( i.e . 5 bits for gradients in FP8 ( Wang et al. , 2018 ) ) . In contrast , BM share exponent biases across blocks of N minifloat numbers . This provides equivalent dynamic range with respect to the block , but with fewer exponent bits than the original minifloat format . Block floating point ( BFP ) operates similarly , but all numbers within the block are integers ( Drumond et al. , 2018 ) . BM can generalise for this case , i.e . when e = 0 . The real value of the ith element from BM tensor a is given in Equation ( 2 ) , where X is an unbiased minifloat tensor , represented by ( e , m ) exponent and mantissa bits , and βa is the shared exponent bias . ai = Xi 〈 e , m 〉 × 2−βa ( 2 ) In this example , ai can only be represented accurately when the shared exponent bias βa ( calculated for the entire tensor ) and the distribution of X jointly captures the value distribution of a . For example , large and small values in a could saturate or be lost altogether if βa is too large or too small . However , some leeway exists when exponents are shared across dot products . This is because dot products are reduce operations , meaning their sum is dominated by the largest values in the inputs . For this reason , we calculate βa to specifically guard against overflow , and unlike ( Cambier et al. , 2020 ) we don ’ t apply any scaling which could divert precision away from larger value regions . Our method of updating β during training is illustrated in Figure 2 and formalized in Equation 3 below . βa = max ( blog2 |a|c ) − ( 2e − 1 ) ( 3 ) The first term denotes the maximum exponent for the tensor a , which changes and must be updated during training , while the second term is fixed and refers to the maximum exponent of X . In terms of hardware , shared biases ensure that all dot products can be computed with denser minifloat arithmetic . This is shown in Equation 4 for BM tensors a and b , each with N elements . a · b = N∑ i=1 ( ( Xai × 2−βa ) × ( Xbi × 2−βb ) ) = 2− ( βa+βb ) × ( Xa ·Xb ) ( 4 ) The dot product , Xa ·Xb , have minifloat formats with smaller exponents , while the cost of calculating , storing and aligning the exponent biases during training is amortized over the length of the dot-product . Next we show how minifloat formats with fewer exponent bits lead to faster and more compact hardware . 2.3 KULISCH ACCUMULATION In the above equations , kadd calculates the number of bits required for the largest product of two numbers , plus one extra bit for the addition , and kshift determines the maximum number of bits the mantissa product must be shifted to align with the addend . Crucially , by considering the size of kadd and kshift , BM formats can be designed to trade-off fine-grained dynamic range ( i.e . exponent bits ) for more precision and smaller hardware . In fact , formats with exponents up to 4 bits may yield kadd of approximately the same size as INT8/INT32 arithmetic units , while kadd becomes prohibitively wider and more expensive for larger exponents . This is clearly shown via example in Table 1 above , but more importantly , it is supported by hardware synthesis results given in Section 5 and Appendix A.4 . For example , an 8-bit minifloat format having 4 exponent bits achieves a 1.6× area reduction compared to HFP8 ( Sun et al. , 2019 ) with 5 exponent bits . Furthermore , through an extensive set of experiments we discover that such representations can also achieve high training accuracy which forms a key contribution of our work .
This paper introduced a new representation (Block Minifloat) for training DNNs with low precisions of 8-bit or less. This new representation combines FP8 formats and the shared exponent bias concept to cover the dynamic range of tensors needed for DNN training. Compared to other published FP8 format, this representation has smaller exponents, which allows to use a more efficient Kulisch accumulator. The representation has been verified on a spectrum of deep learning models and datasets.
SP:2cabed9c97692e64a609bb5a66fe7505c53c59fb
Transferable Unsupervised Robust Representation Learning
1 INTRODUCTION . Recently , there has been an increasing interest in unsupervised visual representation learning , where the goal is to learn effective representations of images without using human annotations ( Bachman et al. , 2019 ; Chen et al. , 2020b ; He et al. , 2020 ; Misra & Maaten , 2020 ) . In this work , we consider a relatively under-explored aspect : the robustness of these representations . Here , we use robustness to encompass the representation ’ s resilience to common corruptions ( Hendrycks & Dietterich , 2019 ) , adversarial examples ( Madry et al. , 2018 ) , and its ability to measure the uncertainty of its output in the face of such perturbations ( Kumar et al. , 2019 ) . More specifically , we develop new learning methods for transferable robustness of these representations , which improves and preserves the representation ’ s robustness after fine-tuning on downstream tasks . While recent works have only evaluated the virtue of a representation by its accuracy on clean data after transfer learning and fine-tuning , we argue that transferable robustness should also be an integral part of a good representation . Recently , Rezaei & Liu ( 2020 ) have shown that downstream task models are vulnerable to adversarial attacks that are based solely on the pre-trained representation before fine-tuning . This highlights the importance of transferable robustness , without which downstream task models are vulnerable and lack generalization . Moreover , it is commonly assumed that there needs to be a trade-off between natural accuracy ( on clean data ) and robust accuracy ( on corrupted data ) ( Zhang et al. , 2019 ) . While there have been works showing that such a trade-off is not necessary for supervised learning ( Yang et al. , 2020 ) , it is unclear how the principles they leverage is applicable to unsupervised representation learning . Summary of Contributions : ( 1 ) We show that the accuracy-robustness trade-off is not necessary for unsupervised representation learning . ( 2 ) We develop a new representation learning framework : Unsupervised Robust Representation Learning ( URRL ) , which uses a novel mix of representation learning pretext task and robust supervised learning ( AugMix , Hendrycks et al . ( 2020b ) ) . ( 3 ) In addition , we propose a task-agnostic similarity regularization that further improves the robustness of downstream tasks without the need for any adversarial training or additional data augmentation . ( 4 ) We introduce an evaluation framework for the transfer robustness of a representation , which includes its resilience to corruptions , adversarial robustness , and uncertainty calibration . ( 5 ) We show that URRL improves both the clean accuracy and robustness of state-of-the-art representation learning under linear evaluation , and our full framework , URRL with Similarity Regularization ( URRL-SR ) , further improves its robust accuracy by over 10 % on 12 datasets . The proposed URRL is shown in Figure 1 ( a ) . Our approach is motivated by the fact that in previous works , data augmentation has played an important role in both supervised learning robustness and unsupervised representation learning ( Yun et al. , 2019 ; Chen et al. , 2020b ) . URRL randomly samples a pretext task of unsupervised representation learning and a robust data augmentation ( AugMix , Hendrycks et al . ( 2020b ) ) , and then optimizes them both under a contrastive learning framework . We show that URRL improves both the clean accuracy ( on the original images without corruptions ) and the robustness of the learned representation under the standard linear evaluation protocol . Nevertheless , using the representation under linear evaluation limits the performance of transfer learning , and ultimately the usefulness of representation learning in downstream tasks . It is thus important to evaluate the representations ’ transferable robustness after fine-tuning the entire network to the downstream task . The biggest challenge is to preserve the inherited robustness of the representations : an aggressive fine-tuning schedule on a small dataset can significantly overwrite the robustness of the learned representations . We address this challenge by proposing a task-agnostic similarity regularization that is applicable for the fine-tuning of the learned representation on any downstream task . We show that this improves the robustness of the fine-tuned model . The proposed regularization is shown in Figure 1 ( b ) . fθ is initialized by the robust representation f∗ learned in Figure 1 ( a ) , and is now being fine-tuned by the downstream task loss Ltask . f∗ is robust because it is trained on augmentation of corrupted versions of an image . We hypothesize that this form of robustness is not just about how f∗ represents an image individually , but also about how f∗ measures the similarities between images . This implies that we can preserve the robustness of f∗ by maintaining its similarity measures between images . We achieve this by regularizing the similarity matrix of a representation during fine-tuning to be similar to that of the original representation before fine-tuning . This allows the downstream task model to better utilize the robustness of the learned representation , while not capping the performance , which would be the case if the representation is fixed . Our full approach , URRL with similarity regularization ( URRL-SR ) , further improves URRL ’ s robust accuracy by over 10 % on 12 datasets without any adversarial training or further data augmentation . 2 METHOD . In this work , we advocate the transferable robustness of unsupervised representation learning , which measures the robustness of a representation after fine-tuning on downstream tasks . The two challenges are : ( i ) It is commonly assumed that there is an accuracy-robustness trade-off , and the promotion of transferable robustness could potentially set back the performance gain from unsupervised representation learning . ( ii ) the robustness of a representation could be changed drastically during the fine-tuning process , and thus make it challenging to preserve the robustness after fine-tuning the whole network . In Section 2.1 , we address the first challenge by proposing URRL , which combines the advantages of pretext tasks from unsupervised representation learning with robust augmentations to improve not only the robustness but also the clean accuracy . In Section 2.2 , we address the second challenge by proposing a task-agnostic similarity regularization that preserves the robustness of learned representations , while not capping the performance of transfer learning . 2.1 UNSUPERVISED ROBUST REPRESENTATION LEARNING . In this section , we discuss the proposed Unsupervised Robust Representation Learning ( URRL ) , which combines the advantages of representation learning pretext task and robust augmentation . We observe that data augmentation plays a central role in the recent literature of both unsupervised representation learning and supervised learning robustness . Contrastive learning has become a predominant design for representation learning ( Chen et al. , 2020b ) . Given an unlabeled dataset { xi } of images xi , the goal is to learn the representation of each image zi = fθ1 ( xi ) by optimizing the parameters θ1 of the encoding function . The role of data augmentation is to randomly create two correlated views of the same image . Let Trep be a family of data augmentation . We can then sample two data augmentation functions t1 , t2 ∼ Trep , and apply them to an image xi to obtain a positive pair xq = t1 ( xi ) and xk+ = t2 ( xi ) . The goal is then to train the encoder fθ1 such that it still encodes the two augmented images xq and xk+ similarly despite the random augmentations to the images . In this case , the representation can learn to ignore information that is not task-relevant ( introduced by the random augmentation ) , while still capturing the task-relevant information in the images . One can achieve this through the contrastive loss : Lcontra = − log exp ( zq · zk+/τ ) exp ( zq · zk+/τ ) + ∑ k− exp ( zq · zk−/τ ) , ( 1 ) where τ is the softmax temperature , and zk− are the representations of negative samples . The negative samples are often randomly augmented versions of images in the same batch xj , j 6= i . The family of data augmentation Trep plays a crucial role here as it would determine what the encoder fθ1 learns to ignore and preserve in the representation of an image . On the other hand , data augmentation improves the robustness of supervised learning by effectively expanding the training dataset without human annotation . Given a dataset { xi , yi } of images xi and the corresponding labels yi , one can apply data augmentation Trob to obtain an augmented dataset { Trob ( xi ) , yi } , where Trob ( xi ) = t ( xi ) , t ∼ Trob . Trob improves the robustness of the model by indicating that the augmented image Trob ( xi ) still has the same label yi as the original image xi . Recent works have shown that by mixing various types of perturbations , the learned classifier has the potential to be robust to novel perturbations that are not used in training ( Hendrycks et al. , 2020b ) . Trob plays a crucial role in which types of perturbation the learned model would be robust to . Given the importance of data augmentation in both of these aspects , a reasonable direction for unsupervised robust representation learning is to design a new family of data augmentation functions that can be used in Eq . ( 1 ) to learn robust representation without human annotation . We observe that the goal of Trep and Trob are quite similar at the high-level : In robustness literature , the aim of data augmentation is to increase the diversity of training data as much as possible without drifting off the data manifold ( Hendrycks et al. , 2020b ) . On the other hand , recent work hypothesizes that the best data augmentations for unsupervised representation learning are ones that “ share the minimal information necessary to perform well at the downstream task ” ( Tian et al. , 2020 ) . If we take the downstream task to be classification and assume that the reason for not drifting off the data manifold is also optimizing for classification performance , then the aims of these two augmentations are actually quite similar : both are trying to preserve information that is enough to do well on classification , while increasing perturbation ( and decreasing shared information ) as much as possible . As we will show in the experiments , this is indeed the case : a representation learned with Trep is already more robust than ones learned by supervised pre-training ; At the same time , Trob can already serve as an effective pretext task for unsupervised representation learning . It could seem that using Trob as a pretext would directly lead to unsupervised representation learning with transferable robustness . However , one missing piece of naively using Trob as a pretext for representation learning is the augmentation that focuses on color distortion . As observed and shown by Chen et al . ( 2020b ) , color distortion plays a critical role in the success of unsupervised representation learning because patches from the same image could share a similar color distribution , and without color distortion augmentation , the encoder could learn to exploit a shortcut to minimize Eq . ( 1 ) by focusing on the color histogram of an image . Drastic color distortion is often discouraged for Trob because “ histogram color augmentation can change the image ’ s class ” ( Hendrycks et al. , 2020b ) . Therefore , we propose a straightforward solution to the problem by incorporating color histogram distortion into Trob . The proposed data augmentation family Turrl for URRL does not sample the data augmentation function t directly . Instead , we use a two-stage process : Turrl ( xi ) = t ( xi ) , t ∼ T , T = { Trob with probability p , Trep with probability 1− p , ( 2 ) where we first sample the family of data augmentation T , and then sample the actual augmentation from T . Here , the sampled T could be either Trob or Trep . With the inclusion of Trep , Turrl prevents the encoder f from exploiting the color histogram . On the other hand , the use of Trob in addition to Trep further strengthens the robustness of the learned representation . We will show that this simple approach is able to outperform more sophisticated approaches to modify Trob . In this work , we use the pretext task of Chen et al . ( 2020d ) as Trep and AugMix ( Hendrycks et al. , 2020b ) as Trob
This paper uses a different data augmentation (AugMix) scheme to improve self-supervised representation learning. It improves accuracy and (corruption and adversarial) robustness by a sufficiently interesting amount. The paper's presentation is clear, but the paper could be more thorough. Since the technique is simple and general, it could easily be broadly applicable to the burgeoning area of self-supervised learning.
SP:5d875376d1c68281008c7a22abcf09b968afb841
Transferable Unsupervised Robust Representation Learning
1 INTRODUCTION . Recently , there has been an increasing interest in unsupervised visual representation learning , where the goal is to learn effective representations of images without using human annotations ( Bachman et al. , 2019 ; Chen et al. , 2020b ; He et al. , 2020 ; Misra & Maaten , 2020 ) . In this work , we consider a relatively under-explored aspect : the robustness of these representations . Here , we use robustness to encompass the representation ’ s resilience to common corruptions ( Hendrycks & Dietterich , 2019 ) , adversarial examples ( Madry et al. , 2018 ) , and its ability to measure the uncertainty of its output in the face of such perturbations ( Kumar et al. , 2019 ) . More specifically , we develop new learning methods for transferable robustness of these representations , which improves and preserves the representation ’ s robustness after fine-tuning on downstream tasks . While recent works have only evaluated the virtue of a representation by its accuracy on clean data after transfer learning and fine-tuning , we argue that transferable robustness should also be an integral part of a good representation . Recently , Rezaei & Liu ( 2020 ) have shown that downstream task models are vulnerable to adversarial attacks that are based solely on the pre-trained representation before fine-tuning . This highlights the importance of transferable robustness , without which downstream task models are vulnerable and lack generalization . Moreover , it is commonly assumed that there needs to be a trade-off between natural accuracy ( on clean data ) and robust accuracy ( on corrupted data ) ( Zhang et al. , 2019 ) . While there have been works showing that such a trade-off is not necessary for supervised learning ( Yang et al. , 2020 ) , it is unclear how the principles they leverage is applicable to unsupervised representation learning . Summary of Contributions : ( 1 ) We show that the accuracy-robustness trade-off is not necessary for unsupervised representation learning . ( 2 ) We develop a new representation learning framework : Unsupervised Robust Representation Learning ( URRL ) , which uses a novel mix of representation learning pretext task and robust supervised learning ( AugMix , Hendrycks et al . ( 2020b ) ) . ( 3 ) In addition , we propose a task-agnostic similarity regularization that further improves the robustness of downstream tasks without the need for any adversarial training or additional data augmentation . ( 4 ) We introduce an evaluation framework for the transfer robustness of a representation , which includes its resilience to corruptions , adversarial robustness , and uncertainty calibration . ( 5 ) We show that URRL improves both the clean accuracy and robustness of state-of-the-art representation learning under linear evaluation , and our full framework , URRL with Similarity Regularization ( URRL-SR ) , further improves its robust accuracy by over 10 % on 12 datasets . The proposed URRL is shown in Figure 1 ( a ) . Our approach is motivated by the fact that in previous works , data augmentation has played an important role in both supervised learning robustness and unsupervised representation learning ( Yun et al. , 2019 ; Chen et al. , 2020b ) . URRL randomly samples a pretext task of unsupervised representation learning and a robust data augmentation ( AugMix , Hendrycks et al . ( 2020b ) ) , and then optimizes them both under a contrastive learning framework . We show that URRL improves both the clean accuracy ( on the original images without corruptions ) and the robustness of the learned representation under the standard linear evaluation protocol . Nevertheless , using the representation under linear evaluation limits the performance of transfer learning , and ultimately the usefulness of representation learning in downstream tasks . It is thus important to evaluate the representations ’ transferable robustness after fine-tuning the entire network to the downstream task . The biggest challenge is to preserve the inherited robustness of the representations : an aggressive fine-tuning schedule on a small dataset can significantly overwrite the robustness of the learned representations . We address this challenge by proposing a task-agnostic similarity regularization that is applicable for the fine-tuning of the learned representation on any downstream task . We show that this improves the robustness of the fine-tuned model . The proposed regularization is shown in Figure 1 ( b ) . fθ is initialized by the robust representation f∗ learned in Figure 1 ( a ) , and is now being fine-tuned by the downstream task loss Ltask . f∗ is robust because it is trained on augmentation of corrupted versions of an image . We hypothesize that this form of robustness is not just about how f∗ represents an image individually , but also about how f∗ measures the similarities between images . This implies that we can preserve the robustness of f∗ by maintaining its similarity measures between images . We achieve this by regularizing the similarity matrix of a representation during fine-tuning to be similar to that of the original representation before fine-tuning . This allows the downstream task model to better utilize the robustness of the learned representation , while not capping the performance , which would be the case if the representation is fixed . Our full approach , URRL with similarity regularization ( URRL-SR ) , further improves URRL ’ s robust accuracy by over 10 % on 12 datasets without any adversarial training or further data augmentation . 2 METHOD . In this work , we advocate the transferable robustness of unsupervised representation learning , which measures the robustness of a representation after fine-tuning on downstream tasks . The two challenges are : ( i ) It is commonly assumed that there is an accuracy-robustness trade-off , and the promotion of transferable robustness could potentially set back the performance gain from unsupervised representation learning . ( ii ) the robustness of a representation could be changed drastically during the fine-tuning process , and thus make it challenging to preserve the robustness after fine-tuning the whole network . In Section 2.1 , we address the first challenge by proposing URRL , which combines the advantages of pretext tasks from unsupervised representation learning with robust augmentations to improve not only the robustness but also the clean accuracy . In Section 2.2 , we address the second challenge by proposing a task-agnostic similarity regularization that preserves the robustness of learned representations , while not capping the performance of transfer learning . 2.1 UNSUPERVISED ROBUST REPRESENTATION LEARNING . In this section , we discuss the proposed Unsupervised Robust Representation Learning ( URRL ) , which combines the advantages of representation learning pretext task and robust augmentation . We observe that data augmentation plays a central role in the recent literature of both unsupervised representation learning and supervised learning robustness . Contrastive learning has become a predominant design for representation learning ( Chen et al. , 2020b ) . Given an unlabeled dataset { xi } of images xi , the goal is to learn the representation of each image zi = fθ1 ( xi ) by optimizing the parameters θ1 of the encoding function . The role of data augmentation is to randomly create two correlated views of the same image . Let Trep be a family of data augmentation . We can then sample two data augmentation functions t1 , t2 ∼ Trep , and apply them to an image xi to obtain a positive pair xq = t1 ( xi ) and xk+ = t2 ( xi ) . The goal is then to train the encoder fθ1 such that it still encodes the two augmented images xq and xk+ similarly despite the random augmentations to the images . In this case , the representation can learn to ignore information that is not task-relevant ( introduced by the random augmentation ) , while still capturing the task-relevant information in the images . One can achieve this through the contrastive loss : Lcontra = − log exp ( zq · zk+/τ ) exp ( zq · zk+/τ ) + ∑ k− exp ( zq · zk−/τ ) , ( 1 ) where τ is the softmax temperature , and zk− are the representations of negative samples . The negative samples are often randomly augmented versions of images in the same batch xj , j 6= i . The family of data augmentation Trep plays a crucial role here as it would determine what the encoder fθ1 learns to ignore and preserve in the representation of an image . On the other hand , data augmentation improves the robustness of supervised learning by effectively expanding the training dataset without human annotation . Given a dataset { xi , yi } of images xi and the corresponding labels yi , one can apply data augmentation Trob to obtain an augmented dataset { Trob ( xi ) , yi } , where Trob ( xi ) = t ( xi ) , t ∼ Trob . Trob improves the robustness of the model by indicating that the augmented image Trob ( xi ) still has the same label yi as the original image xi . Recent works have shown that by mixing various types of perturbations , the learned classifier has the potential to be robust to novel perturbations that are not used in training ( Hendrycks et al. , 2020b ) . Trob plays a crucial role in which types of perturbation the learned model would be robust to . Given the importance of data augmentation in both of these aspects , a reasonable direction for unsupervised robust representation learning is to design a new family of data augmentation functions that can be used in Eq . ( 1 ) to learn robust representation without human annotation . We observe that the goal of Trep and Trob are quite similar at the high-level : In robustness literature , the aim of data augmentation is to increase the diversity of training data as much as possible without drifting off the data manifold ( Hendrycks et al. , 2020b ) . On the other hand , recent work hypothesizes that the best data augmentations for unsupervised representation learning are ones that “ share the minimal information necessary to perform well at the downstream task ” ( Tian et al. , 2020 ) . If we take the downstream task to be classification and assume that the reason for not drifting off the data manifold is also optimizing for classification performance , then the aims of these two augmentations are actually quite similar : both are trying to preserve information that is enough to do well on classification , while increasing perturbation ( and decreasing shared information ) as much as possible . As we will show in the experiments , this is indeed the case : a representation learned with Trep is already more robust than ones learned by supervised pre-training ; At the same time , Trob can already serve as an effective pretext task for unsupervised representation learning . It could seem that using Trob as a pretext would directly lead to unsupervised representation learning with transferable robustness . However , one missing piece of naively using Trob as a pretext for representation learning is the augmentation that focuses on color distortion . As observed and shown by Chen et al . ( 2020b ) , color distortion plays a critical role in the success of unsupervised representation learning because patches from the same image could share a similar color distribution , and without color distortion augmentation , the encoder could learn to exploit a shortcut to minimize Eq . ( 1 ) by focusing on the color histogram of an image . Drastic color distortion is often discouraged for Trob because “ histogram color augmentation can change the image ’ s class ” ( Hendrycks et al. , 2020b ) . Therefore , we propose a straightforward solution to the problem by incorporating color histogram distortion into Trob . The proposed data augmentation family Turrl for URRL does not sample the data augmentation function t directly . Instead , we use a two-stage process : Turrl ( xi ) = t ( xi ) , t ∼ T , T = { Trob with probability p , Trep with probability 1− p , ( 2 ) where we first sample the family of data augmentation T , and then sample the actual augmentation from T . Here , the sampled T could be either Trob or Trep . With the inclusion of Trep , Turrl prevents the encoder f from exploiting the color histogram . On the other hand , the use of Trob in addition to Trep further strengthens the robustness of the learned representation . We will show that this simple approach is able to outperform more sophisticated approaches to modify Trob . In this work , we use the pretext task of Chen et al . ( 2020d ) as Trep and AugMix ( Hendrycks et al. , 2020b ) as Trob
This paper proposes *Unsupervised Robust Representation Learning* (URRL), a framework that combines several data augmentation schemes and a similarity-based loss. The goal is to improve the robustness of visual representations to image perturbations. A further goal is to maintain the robustness properties of pre-trained representations after fine-tuning the network to downstream tasks.
SP:5d875376d1c68281008c7a22abcf09b968afb841
PABI: A Unified PAC-Bayesian Informativeness Measure for Incidental Supervision Signals
1 INTRODUCTION . The supervised learning paradigm , where direct supervision signals are assumed to be available in high-quality and large amounts , has been struggling to fulfill the needs in many real-world AI applications . As a result , researchers and practitioners often resort to datasets that are not collected directly for the target task but , hopefully , capture some phenomena useful for it ( Pan & Yang , 2009 ; Vapnik & Vashist , 2009 ; Roth , 2017 ; Kolesnikov et al. , 2019 ) . However , it remains unclear how to predict the benefits of these incidental signals on our target task beforehand , so the common practice is often trial-and-error : do experiments with different combinations of datasets and learning protocols , often exhaustively , to achieve improvement on a target task ( Liu et al. , 2019 ; Khashabi et al. , 2020 ) . Not only this is very costly , this trial-and-error approach can also be hard to interpret : if we don ’ t see improvements , is it because the incidental signals themselves are not useful for our target task , or is it because the learning protocols we have tried are inappropriate ? The difficulties of foreshadowing the benefits of various incidental supervision signals are two-fold . First , it is hard to provide a unified measure because of the intrinsic differences among different signals ( e.g. , how do we predict and compare the benefit of learning from noisy data and the benefit of knowing some constraints for the target task ? ) . Second , it is hard to provide a practical measure supported by theory . Previous attempts are either not practical or too heuristic ( Baxter , 1998 ; BenDavid et al. , 2010 ; Thrun & O ’ Sullivan , 1998 ; Gururangan et al. , 2020 ) . In this paper , we propose a unified PAC-Bayesian motivated informativeness measure ( PABI ) to quantify the value of incidental signals . We suggest that the informativeness of various incidental signals can be uniformly characterized by the reduction in the original concept class uncertainty they provide . Specifically , in the PAC-Bayesian framework1 , the informativeness is based on the Kullback–Leibler ( KL ) divergence between the prior and the posterior , where incidental signals are used to estimate a better prior ( closer to the gold posterior ) to achieve better generalization performance . Furthermore , we provide a more practical entropy-based approximation of PABI . In practice , PABI first computes the entropy of the prior estimated from incidental signals , and then computes the relative decrease to the entropy of the prior without any information , as the informativeness of incidental signals . 1We choose the PAC-Bayes framework here because it allows us to link PABI to the performance measure . 6 We have been in need of a unified informativeness measure like PABI . For instance , it might be obvious that we can expect better learning performance if the training data are less noisy and more completely annotated , but what if we want to compare the benefits of a noisy dataset and that of a partial dataset ? PABI enables this kind of comparisons beforehand , on a wide range of incidental signals such as partial labels , noisy labels , constraints2 , auxiliary signals , cross-domain signals , and some combinations of them , for sequence tagging tasks in NLP . A specific example of NER is shown in Fig . 1 , and the advantages of PABI are in Table 1 . Finally , our experiments on two NLP tasks , NER and QA , show that there is a strong positive correlation between PABI and the relative improvement for various incidental signals . This strong positive correlation indicates that the proposed unified , theory-motivated measure PABI can serve as a good indicator of the final learning performance , providing a promising way to know which signals are helpful for a target task beforehand . Organization . We start with related work in Section 1.1 . Then we derive informativeness measure PABI in Section 2 . We show examples on how to compute PABI using various incidental signals in Section 3 . We verify the effectiveness of PABI in Section 4 . Section 5 concludes this paper . 1.1 RELATED WORK . There are lots of practical measures proposed to quantify the benefits of specific types of signals . For example , a widely used measure for partial signals in structured learning is the partial rate ( Cour et al. , 2011 ; Hovy & Hovy , 2012 ; Liu & Dietterich , 2014 ; Van Rooyen & Williamson , 2017 ; Ning et al. , 2019 ) ; a widely used measure for noisy signals is the noise ratio ( Angluin & Laird , 1988 ; Natarajan et al. , 2013 ; Rolnick et al. , 2017 ; Van Rooyen & Williamson , 2017 ) ; Ning et al . ( 2019 ) propose to use the concaveness of the mutual information with different percentage of annotations to quantify the strength of constraints in the structured learning ; others , in NLP , have quantified the contribution of constraints experimentally ( Chang et al. , 2012 ; 2008 ) . Bjerva ( 2017 ) proposes to use conditional entropy or mutual information to quantify the value for auxiliary signals . As for domain adaptation , domain similarity can be measured by the performance gap between domains ( Wang et al. , 2019 ) or measures based on the language model in NLP , such as the vocabulary overlap ( Gururangan et al. , 2020 ) . Among them , the most relevant work is ( Bjerva , 2017 ) . However , their conditional entropy or mutual information is based on token-level label distribution , which can not be used for incidental signals involving multiple tokens or inputs , such as constraints and cross-domain signals . At the same time , for the cases where both PABI and mutual information can handle , PABI works similar to the mutual information as shown in Fig . 2 , and PABI can further be shown to be a strictly increasing function of the mutual information . The key advantage of our proposed measure PABI is that PABI is a unified measure motivated by the PAC-Bayesian theory for a broader range of incidental signals compared to these practical measures for specific types of incidental signals . There also has been a line of theoretical work that attempts to exploit incidental supervision signals . Among them , the most relevant part is task relatedness . Ben-David & Borbely ( 2008 ) define the 2Constraints are used to model the dependency among words and sentences , which are considered in a lot of work , such as CRF ( Lafferty et al. , 2001 ) and ILP ( Roth & Yih , 2004 ) . task relatedness based on the richness of transformations between inputs for different tasks , but their analysis is limited to cases where data is from the same classification problem but the inputs are in different subspace . Juba ( 2006 ) proposes to use the joint Kolmogorov complexity ( Li et al. , 2008 ) to characterize relatedness , but it is still unclear how to compute the joint Kolmogorov complexity in real-world applications . Mahmud & Ray ( 2008 ) further propose to use conditional Kolmogorov complexity to measure the task relatedness and provide empirical analysis for decision trees , but it is unclear how to use their relatedness for other models , such as deep neural networks . Thrun & O ’ Sullivan ( 1998 ) propose to cluster tasks based on the similarity between the task-optimal distance metric of k-nearest neighbors ( KNN ) , but their analysis is based on KNN and it is unclear how to use their relatedness for other models . A lot of other works provide quite good qualitative analysis to show various incidental signals are helpful but they did not provide quantitative analysis to quantify to what extent these types of incidental signals can help ( Balcan & Blum , 2010 ; Abu-Mostafa , 1993 ; Natarajan et al. , 2013 ; Van Rooyen & Williamson , 2017 ; Baxter , 1998 ; London et al. , 2016 ; Ciliberto et al. , 2019 ; Ben-David et al. , 2010 ; Wang et al. , 2020 ) . Compared to these theoretical analyses , PABI can be easily used in practice to quantify the benefits of a broader range of incidental signals . 2 PABI : A UNIFIED PAC-BAYESIAN INFORMATIVENESS MEASURE We start with notations and preliminaries . Let X be the input space , Y be the label space , and Ŷ be the prediction space . LetD denote the underlying distribution onX ×Y . Let ` : Y×Ŷ → R+ be the loss function that we use to evaluate learning algorithms . A set of training samples S = { xi , yi } mi=1 is generated i.i.d . from D. In the common supervised learning setting , we usually assume the concept that generates data comes from the concept class C. In this paper , we assume C is finite , and its size is | C | , which is common in NLP . We want to choose a predictor c : X → Ŷ from C such that it generalizes well to unseen data with respect to ` , measured by the generalization error RD ( c ) = Ex , y∼D [ ` ( y , c ( x ) ) ] . The training error over S is RS ( c ) = 1m ∑m i=1 ` ( yi , c ( xi ) ) . More generally , instead of predicting a concept , we can specify a distribution over the concept class . Let P denote the space of probability distributions over C. General Bayesian learning algorithms ( Zhang et al. , 2006 ) in the PAC-Bayesian framework ( McAllester , 1999a ; b ; Seeger , 2002 ; McAllester , 2003b ; a ; Maurer , 2004 ; Guedj , 2019 ) aim to choose a posterior πλ ∈ P over the concept class C based on a prior π0 ∈ P and training data S , where λ is a hyper parameter that controls the tradeoff between the prior and the data likelihood . In this setting , the training error and the generalization error need to be generalized , to take the distribution into account , as LS ( πλ ) = Ec∼πλ [ RS ( c ) ] and LD ( πλ ) = Ec∼πλ [ RD ( c ) ] respectively . One can easily see that when the posterior is one-hot ( exactly one entry of the distribution is 1 ) , we have the original definitions of training error and generalization error , as in the PAC framework ( Valiant , 1984 ) . 4Papers are denoted by abbreviations of author names as : CST ’ 11 ( Cour et al. , 2011 ) , HH ’ 12 ( Hovy & Hovy , 2012 ) , LD ’ 14 ( Liu & Dietterich , 2014 ) , AL ’ 88 ( Angluin & Laird , 1988 ) , NDRT ’ 13 ( Natarajan et al. , 2013 ) , RVBS ’ 17 ( Rolnick et al. , 2017 ) , VW ’ 17 ( Van Rooyen & Williamson , 2017 ) , WNR ’ 20 ( Wang et al. , 2020 ) , NHFR ’ 19 ( Ning et al. , 2019 ) , B ’ 17 ( Bjerva , 2017 ) , GMSLBDS ’ 20 ( Gururangan et al. , 2020 ) . 2.1 INFORMATIVENESS MEASURES IN THE PAC-BAYESIAN FRAMEWORK . We are now ready to derive the proposed informativeness measure PABI motivated by PAC-Bayes . The generalization error bound in the PAC-Bayesian framework ( Guedj , 2019 ; Catoni , 2007 ) says that with probability 1 − δ over S , LD ( πλ∗ ) ≤ LD ( π∗ ) + √ 8B ( DKL ( π∗||π0 ) +ln 2 ln ( mC ) δ ) m , where πλ∗ is the posterior distribution with the optimal λ∗ = √ 2m ( DKL ( π∗||π0 ) +ln 2δ ) B , π ∗ ∈ P is the gold posterior that generates the data , DKL ( π∗||π0 ) denotes the KL divergence from π0 to π∗ , B and C are two constants . This is based on the Theorem 2 in Guedj ( 2019 ) . As shown in the generalization bound , the generalization error is bounded by the KL divergence DKL ( π ∗||π0 ) from the prior distribution to the gold posterior distribution . Therefore , we propose to utilize incidental signals to improve the prior distribution from π0 to π̃0 so that it is closer to the gold posterior distribution π∗ . Correspondingly , we can define PABI , the informativeness measure for incidental supervision signals , by measuring the improvement with regard to the gold posterior , in KL divergence sense . Definition 2.1 ( PABI ) . Suppose we use incidental signals to improve the prior distribution from π0 to π̃0 . The informativeness measure for incidental signals , PABI , is defined as S ( π0 , π̃0 ) , √ 1− DKL ( π ∗||π̃0 ) DKL ( π∗||π0 ) ( 1 ) Remark . Note that S ( π0 , π̃0 ) = 0 if π̃0 = π0 , while if π̃0 = π∗ , then S ( π0 , π̃0 ) = 1 . This result is consistent with our intuition that the closer π̃0 is to π∗ , the more benefits we can gain from incidental signals . The square root function is used in PABI for two reasons : first , the generalization bounds in both PAC-Bayesian and PAC ( see Sec . 2.2 ) frameworks have the square root function ; second , in our later experiments , we find that square root function can significantly improve the Pearson correlation between the relative performance improvement and PABI . It is worthwhile to note that the square root is not crucial for our framework , because our goal is to compare the benefits among different incidental supervision signals , where the relative values are expressive enough . In this sense , any strictly increasing function in [ 0 , 1 ] over the current formulation would be acceptable . In our paper , we focus on the setting that the gold posterior π∗ is one-hot , which means π∗ concentrates on the true concept c∗ ∈ C , though the definition of PABI can handle general gold posterior . However , π∗ is unknown in practice , which makes Eq . ( 1 ) hard to be computed in reality . In the following , we provide an approximation Ŝ of PABI . Definition 2.2 ( Approximation of PABI ) . Assume that the original prior π0 is uniform , and the gold posterior π∗ is one-hot concentrated on the true concept c∗ in C , as we have assumed that C is finite . Let H ( · ) be the entropy function . The approximation Ŝ of PABI is defined as Ŝ ( π0 , π̃0 ) , √ 1− H ( π̃0 ) H ( π0 ) = √ 1− H ( π̃0 ) ln | C | ( 2 ) The uniform prior π0 is usually used when we do not have information about the prior on which concept in the class that generates data . The intuition behind Ŝ is that , it measures how much entropy incidental signals reduce , compared with non-informative prior π0 . Ŝ can be computed through data and thus is practical . To see how this approximation works , first note DKL ( π∗||π0 ) = ln | C | because π∗ is one-hot and π0 is uniform over the finite concept class C. Let πc be the one-hot distribution concentrated on concept c for each c ∈ C. The approximation is that we estimate π∗ by πc , where c follows π̃0 : DKL ( π∗||π̃0 ) ≈ Ec∼π̃0DKL ( πc||π̃0 ) . It turns out Ec∼π̃0DKL ( πc||π̃0 ) = H ( π̃0 ) . Therefore , Ŝ ( π0 , π̃0 ) = √ 1− H ( π̃0 ) ln | C | = √ 1− Ec∼π̃0DKL ( πc||π̃0 ) ln | C | ≈ √ 1− DKL ( π ∗||π̃0 ) DKL ( π∗||π0 ) = S ( π0 , π̃0 ) . We later show that the approximation of PABI and PABI is equivalent in the non-probabilistic cases with the finite concept class , indicating the quality of this approximation . Furthermore , the effectiveness of this approximation in NLP applications also indicates the quality of this approximation . 2.2 PABI IN THE PAC FRAMEWORK We have derived PABI in the PAC-Bayesian framework . Here , we discuss briefly on what PABI reduces to in the PAC framework and what limitations are when PABI is restricted to the PAC framework . The generalization bound in the PAC framework ( Mohri et al. , 2018 ) says with probability 1− δ over S , RD ( c ) ≤ RS ( c ) + √ ln | C |+ln 2δ 2m . We propose to reduce the concept class from C to C̃ by using incidental signals . Then PABI in the PAC framework can be written as S ( C , C̃ ) = √ 1− ln |C̃| ln | C | ( 3 ) It turns out that Eq . ( 3 ) is a special case of Eq . ( 1 ) when π∗ is one-hot over C , π0 is uniform over C and π̃0 is uniform over C̃ ( See Appx . A.1 for the derivation ) . As shown in Appx . A.1 , we can see that the three informativeness measures , PABI in Eq . ( 1 ) , the approximation of PABI in Eq . ( 2 ) , and PABI in the PAC framework in Eq . ( 3 ) , are equivalent , i.e . S ( π0 , π̃0 ) = Ŝ ( π0 , π̃0 ) = S ( C , C̃ ) , in the non-probabilistic cases with the finite concept class . The equivalence among three measures further indicates that both PABI and the approximation of PABI are reasonable . However , PABI restricted to the PAC framework can not handle the probabilistic cases . For example , incidental signals can reduce the probability of some concepts , though the concept class is not reduced . In this example , S ( C , C̃ ) is zero , but we actually benefit from incidental signals . Some analysis on the extensions and general limitations of PABI can be found in Appx . A.2 and A.3 . We need to notice that the size of concept class also plays an important role in the lower bound on the generalization error ( more details in Appx . A.4 ) , indicating that PABI based on the reduction of the concept class is a reasonable measure . 3 EXAMPLES FOR PABI In this section , we show some examples of sequence tagging tasks5 in NLP for PABI . Similar to the categorization of transfer learning ( Pan & Yang , 2009 ) , we use inductive signals to denote the signals with a different conditional probability distribution ( P ( y |x ) ) from gold signals , such as noisy and auxiliary signals , and transductive signals to denote the signals with the same task ( P ( y |x ) ) as gold signals but a different marginal distribution of x ( P ( x ) ) from gold signals , such as cross-domain and cross-lingual signals . In our following analysis , we study the tasks with finite concept class which is quite common in NLP . For simplicity , we focus on simple cases where the number of incidental signals is large enough . How different factors ( including base model performance , size of incidental signals , data distributions , algorithms , cost-sensitive losses ) affect PABI are discussed in Appx . A.5 . We derive the PABI for partial labels in detail and the derivations for others are similar . More examples and details can be found in Appx . A.6 .
This paper proposes a unified PAC-Bayesian-based informativeness measure (PABI) to quantify the value of incidental signals. PABI can measure various types of incidental signals such as partial labels, noisy labels, constraints, auxiliary signals, cross-domain signals, and their combinations. In NER and QA tasks, they showed the strong correlation signals between PABI and the relative improvements for various incidental signals.
SP:f952feef70a17987e9691ce2faef013e1b59168e
PABI: A Unified PAC-Bayesian Informativeness Measure for Incidental Supervision Signals
1 INTRODUCTION . The supervised learning paradigm , where direct supervision signals are assumed to be available in high-quality and large amounts , has been struggling to fulfill the needs in many real-world AI applications . As a result , researchers and practitioners often resort to datasets that are not collected directly for the target task but , hopefully , capture some phenomena useful for it ( Pan & Yang , 2009 ; Vapnik & Vashist , 2009 ; Roth , 2017 ; Kolesnikov et al. , 2019 ) . However , it remains unclear how to predict the benefits of these incidental signals on our target task beforehand , so the common practice is often trial-and-error : do experiments with different combinations of datasets and learning protocols , often exhaustively , to achieve improvement on a target task ( Liu et al. , 2019 ; Khashabi et al. , 2020 ) . Not only this is very costly , this trial-and-error approach can also be hard to interpret : if we don ’ t see improvements , is it because the incidental signals themselves are not useful for our target task , or is it because the learning protocols we have tried are inappropriate ? The difficulties of foreshadowing the benefits of various incidental supervision signals are two-fold . First , it is hard to provide a unified measure because of the intrinsic differences among different signals ( e.g. , how do we predict and compare the benefit of learning from noisy data and the benefit of knowing some constraints for the target task ? ) . Second , it is hard to provide a practical measure supported by theory . Previous attempts are either not practical or too heuristic ( Baxter , 1998 ; BenDavid et al. , 2010 ; Thrun & O ’ Sullivan , 1998 ; Gururangan et al. , 2020 ) . In this paper , we propose a unified PAC-Bayesian motivated informativeness measure ( PABI ) to quantify the value of incidental signals . We suggest that the informativeness of various incidental signals can be uniformly characterized by the reduction in the original concept class uncertainty they provide . Specifically , in the PAC-Bayesian framework1 , the informativeness is based on the Kullback–Leibler ( KL ) divergence between the prior and the posterior , where incidental signals are used to estimate a better prior ( closer to the gold posterior ) to achieve better generalization performance . Furthermore , we provide a more practical entropy-based approximation of PABI . In practice , PABI first computes the entropy of the prior estimated from incidental signals , and then computes the relative decrease to the entropy of the prior without any information , as the informativeness of incidental signals . 1We choose the PAC-Bayes framework here because it allows us to link PABI to the performance measure . 6 We have been in need of a unified informativeness measure like PABI . For instance , it might be obvious that we can expect better learning performance if the training data are less noisy and more completely annotated , but what if we want to compare the benefits of a noisy dataset and that of a partial dataset ? PABI enables this kind of comparisons beforehand , on a wide range of incidental signals such as partial labels , noisy labels , constraints2 , auxiliary signals , cross-domain signals , and some combinations of them , for sequence tagging tasks in NLP . A specific example of NER is shown in Fig . 1 , and the advantages of PABI are in Table 1 . Finally , our experiments on two NLP tasks , NER and QA , show that there is a strong positive correlation between PABI and the relative improvement for various incidental signals . This strong positive correlation indicates that the proposed unified , theory-motivated measure PABI can serve as a good indicator of the final learning performance , providing a promising way to know which signals are helpful for a target task beforehand . Organization . We start with related work in Section 1.1 . Then we derive informativeness measure PABI in Section 2 . We show examples on how to compute PABI using various incidental signals in Section 3 . We verify the effectiveness of PABI in Section 4 . Section 5 concludes this paper . 1.1 RELATED WORK . There are lots of practical measures proposed to quantify the benefits of specific types of signals . For example , a widely used measure for partial signals in structured learning is the partial rate ( Cour et al. , 2011 ; Hovy & Hovy , 2012 ; Liu & Dietterich , 2014 ; Van Rooyen & Williamson , 2017 ; Ning et al. , 2019 ) ; a widely used measure for noisy signals is the noise ratio ( Angluin & Laird , 1988 ; Natarajan et al. , 2013 ; Rolnick et al. , 2017 ; Van Rooyen & Williamson , 2017 ) ; Ning et al . ( 2019 ) propose to use the concaveness of the mutual information with different percentage of annotations to quantify the strength of constraints in the structured learning ; others , in NLP , have quantified the contribution of constraints experimentally ( Chang et al. , 2012 ; 2008 ) . Bjerva ( 2017 ) proposes to use conditional entropy or mutual information to quantify the value for auxiliary signals . As for domain adaptation , domain similarity can be measured by the performance gap between domains ( Wang et al. , 2019 ) or measures based on the language model in NLP , such as the vocabulary overlap ( Gururangan et al. , 2020 ) . Among them , the most relevant work is ( Bjerva , 2017 ) . However , their conditional entropy or mutual information is based on token-level label distribution , which can not be used for incidental signals involving multiple tokens or inputs , such as constraints and cross-domain signals . At the same time , for the cases where both PABI and mutual information can handle , PABI works similar to the mutual information as shown in Fig . 2 , and PABI can further be shown to be a strictly increasing function of the mutual information . The key advantage of our proposed measure PABI is that PABI is a unified measure motivated by the PAC-Bayesian theory for a broader range of incidental signals compared to these practical measures for specific types of incidental signals . There also has been a line of theoretical work that attempts to exploit incidental supervision signals . Among them , the most relevant part is task relatedness . Ben-David & Borbely ( 2008 ) define the 2Constraints are used to model the dependency among words and sentences , which are considered in a lot of work , such as CRF ( Lafferty et al. , 2001 ) and ILP ( Roth & Yih , 2004 ) . task relatedness based on the richness of transformations between inputs for different tasks , but their analysis is limited to cases where data is from the same classification problem but the inputs are in different subspace . Juba ( 2006 ) proposes to use the joint Kolmogorov complexity ( Li et al. , 2008 ) to characterize relatedness , but it is still unclear how to compute the joint Kolmogorov complexity in real-world applications . Mahmud & Ray ( 2008 ) further propose to use conditional Kolmogorov complexity to measure the task relatedness and provide empirical analysis for decision trees , but it is unclear how to use their relatedness for other models , such as deep neural networks . Thrun & O ’ Sullivan ( 1998 ) propose to cluster tasks based on the similarity between the task-optimal distance metric of k-nearest neighbors ( KNN ) , but their analysis is based on KNN and it is unclear how to use their relatedness for other models . A lot of other works provide quite good qualitative analysis to show various incidental signals are helpful but they did not provide quantitative analysis to quantify to what extent these types of incidental signals can help ( Balcan & Blum , 2010 ; Abu-Mostafa , 1993 ; Natarajan et al. , 2013 ; Van Rooyen & Williamson , 2017 ; Baxter , 1998 ; London et al. , 2016 ; Ciliberto et al. , 2019 ; Ben-David et al. , 2010 ; Wang et al. , 2020 ) . Compared to these theoretical analyses , PABI can be easily used in practice to quantify the benefits of a broader range of incidental signals . 2 PABI : A UNIFIED PAC-BAYESIAN INFORMATIVENESS MEASURE We start with notations and preliminaries . Let X be the input space , Y be the label space , and Ŷ be the prediction space . LetD denote the underlying distribution onX ×Y . Let ` : Y×Ŷ → R+ be the loss function that we use to evaluate learning algorithms . A set of training samples S = { xi , yi } mi=1 is generated i.i.d . from D. In the common supervised learning setting , we usually assume the concept that generates data comes from the concept class C. In this paper , we assume C is finite , and its size is | C | , which is common in NLP . We want to choose a predictor c : X → Ŷ from C such that it generalizes well to unseen data with respect to ` , measured by the generalization error RD ( c ) = Ex , y∼D [ ` ( y , c ( x ) ) ] . The training error over S is RS ( c ) = 1m ∑m i=1 ` ( yi , c ( xi ) ) . More generally , instead of predicting a concept , we can specify a distribution over the concept class . Let P denote the space of probability distributions over C. General Bayesian learning algorithms ( Zhang et al. , 2006 ) in the PAC-Bayesian framework ( McAllester , 1999a ; b ; Seeger , 2002 ; McAllester , 2003b ; a ; Maurer , 2004 ; Guedj , 2019 ) aim to choose a posterior πλ ∈ P over the concept class C based on a prior π0 ∈ P and training data S , where λ is a hyper parameter that controls the tradeoff between the prior and the data likelihood . In this setting , the training error and the generalization error need to be generalized , to take the distribution into account , as LS ( πλ ) = Ec∼πλ [ RS ( c ) ] and LD ( πλ ) = Ec∼πλ [ RD ( c ) ] respectively . One can easily see that when the posterior is one-hot ( exactly one entry of the distribution is 1 ) , we have the original definitions of training error and generalization error , as in the PAC framework ( Valiant , 1984 ) . 4Papers are denoted by abbreviations of author names as : CST ’ 11 ( Cour et al. , 2011 ) , HH ’ 12 ( Hovy & Hovy , 2012 ) , LD ’ 14 ( Liu & Dietterich , 2014 ) , AL ’ 88 ( Angluin & Laird , 1988 ) , NDRT ’ 13 ( Natarajan et al. , 2013 ) , RVBS ’ 17 ( Rolnick et al. , 2017 ) , VW ’ 17 ( Van Rooyen & Williamson , 2017 ) , WNR ’ 20 ( Wang et al. , 2020 ) , NHFR ’ 19 ( Ning et al. , 2019 ) , B ’ 17 ( Bjerva , 2017 ) , GMSLBDS ’ 20 ( Gururangan et al. , 2020 ) . 2.1 INFORMATIVENESS MEASURES IN THE PAC-BAYESIAN FRAMEWORK . We are now ready to derive the proposed informativeness measure PABI motivated by PAC-Bayes . The generalization error bound in the PAC-Bayesian framework ( Guedj , 2019 ; Catoni , 2007 ) says that with probability 1 − δ over S , LD ( πλ∗ ) ≤ LD ( π∗ ) + √ 8B ( DKL ( π∗||π0 ) +ln 2 ln ( mC ) δ ) m , where πλ∗ is the posterior distribution with the optimal λ∗ = √ 2m ( DKL ( π∗||π0 ) +ln 2δ ) B , π ∗ ∈ P is the gold posterior that generates the data , DKL ( π∗||π0 ) denotes the KL divergence from π0 to π∗ , B and C are two constants . This is based on the Theorem 2 in Guedj ( 2019 ) . As shown in the generalization bound , the generalization error is bounded by the KL divergence DKL ( π ∗||π0 ) from the prior distribution to the gold posterior distribution . Therefore , we propose to utilize incidental signals to improve the prior distribution from π0 to π̃0 so that it is closer to the gold posterior distribution π∗ . Correspondingly , we can define PABI , the informativeness measure for incidental supervision signals , by measuring the improvement with regard to the gold posterior , in KL divergence sense . Definition 2.1 ( PABI ) . Suppose we use incidental signals to improve the prior distribution from π0 to π̃0 . The informativeness measure for incidental signals , PABI , is defined as S ( π0 , π̃0 ) , √ 1− DKL ( π ∗||π̃0 ) DKL ( π∗||π0 ) ( 1 ) Remark . Note that S ( π0 , π̃0 ) = 0 if π̃0 = π0 , while if π̃0 = π∗ , then S ( π0 , π̃0 ) = 1 . This result is consistent with our intuition that the closer π̃0 is to π∗ , the more benefits we can gain from incidental signals . The square root function is used in PABI for two reasons : first , the generalization bounds in both PAC-Bayesian and PAC ( see Sec . 2.2 ) frameworks have the square root function ; second , in our later experiments , we find that square root function can significantly improve the Pearson correlation between the relative performance improvement and PABI . It is worthwhile to note that the square root is not crucial for our framework , because our goal is to compare the benefits among different incidental supervision signals , where the relative values are expressive enough . In this sense , any strictly increasing function in [ 0 , 1 ] over the current formulation would be acceptable . In our paper , we focus on the setting that the gold posterior π∗ is one-hot , which means π∗ concentrates on the true concept c∗ ∈ C , though the definition of PABI can handle general gold posterior . However , π∗ is unknown in practice , which makes Eq . ( 1 ) hard to be computed in reality . In the following , we provide an approximation Ŝ of PABI . Definition 2.2 ( Approximation of PABI ) . Assume that the original prior π0 is uniform , and the gold posterior π∗ is one-hot concentrated on the true concept c∗ in C , as we have assumed that C is finite . Let H ( · ) be the entropy function . The approximation Ŝ of PABI is defined as Ŝ ( π0 , π̃0 ) , √ 1− H ( π̃0 ) H ( π0 ) = √ 1− H ( π̃0 ) ln | C | ( 2 ) The uniform prior π0 is usually used when we do not have information about the prior on which concept in the class that generates data . The intuition behind Ŝ is that , it measures how much entropy incidental signals reduce , compared with non-informative prior π0 . Ŝ can be computed through data and thus is practical . To see how this approximation works , first note DKL ( π∗||π0 ) = ln | C | because π∗ is one-hot and π0 is uniform over the finite concept class C. Let πc be the one-hot distribution concentrated on concept c for each c ∈ C. The approximation is that we estimate π∗ by πc , where c follows π̃0 : DKL ( π∗||π̃0 ) ≈ Ec∼π̃0DKL ( πc||π̃0 ) . It turns out Ec∼π̃0DKL ( πc||π̃0 ) = H ( π̃0 ) . Therefore , Ŝ ( π0 , π̃0 ) = √ 1− H ( π̃0 ) ln | C | = √ 1− Ec∼π̃0DKL ( πc||π̃0 ) ln | C | ≈ √ 1− DKL ( π ∗||π̃0 ) DKL ( π∗||π0 ) = S ( π0 , π̃0 ) . We later show that the approximation of PABI and PABI is equivalent in the non-probabilistic cases with the finite concept class , indicating the quality of this approximation . Furthermore , the effectiveness of this approximation in NLP applications also indicates the quality of this approximation . 2.2 PABI IN THE PAC FRAMEWORK We have derived PABI in the PAC-Bayesian framework . Here , we discuss briefly on what PABI reduces to in the PAC framework and what limitations are when PABI is restricted to the PAC framework . The generalization bound in the PAC framework ( Mohri et al. , 2018 ) says with probability 1− δ over S , RD ( c ) ≤ RS ( c ) + √ ln | C |+ln 2δ 2m . We propose to reduce the concept class from C to C̃ by using incidental signals . Then PABI in the PAC framework can be written as S ( C , C̃ ) = √ 1− ln |C̃| ln | C | ( 3 ) It turns out that Eq . ( 3 ) is a special case of Eq . ( 1 ) when π∗ is one-hot over C , π0 is uniform over C and π̃0 is uniform over C̃ ( See Appx . A.1 for the derivation ) . As shown in Appx . A.1 , we can see that the three informativeness measures , PABI in Eq . ( 1 ) , the approximation of PABI in Eq . ( 2 ) , and PABI in the PAC framework in Eq . ( 3 ) , are equivalent , i.e . S ( π0 , π̃0 ) = Ŝ ( π0 , π̃0 ) = S ( C , C̃ ) , in the non-probabilistic cases with the finite concept class . The equivalence among three measures further indicates that both PABI and the approximation of PABI are reasonable . However , PABI restricted to the PAC framework can not handle the probabilistic cases . For example , incidental signals can reduce the probability of some concepts , though the concept class is not reduced . In this example , S ( C , C̃ ) is zero , but we actually benefit from incidental signals . Some analysis on the extensions and general limitations of PABI can be found in Appx . A.2 and A.3 . We need to notice that the size of concept class also plays an important role in the lower bound on the generalization error ( more details in Appx . A.4 ) , indicating that PABI based on the reduction of the concept class is a reasonable measure . 3 EXAMPLES FOR PABI In this section , we show some examples of sequence tagging tasks5 in NLP for PABI . Similar to the categorization of transfer learning ( Pan & Yang , 2009 ) , we use inductive signals to denote the signals with a different conditional probability distribution ( P ( y |x ) ) from gold signals , such as noisy and auxiliary signals , and transductive signals to denote the signals with the same task ( P ( y |x ) ) as gold signals but a different marginal distribution of x ( P ( x ) ) from gold signals , such as cross-domain and cross-lingual signals . In our following analysis , we study the tasks with finite concept class which is quite common in NLP . For simplicity , we focus on simple cases where the number of incidental signals is large enough . How different factors ( including base model performance , size of incidental signals , data distributions , algorithms , cost-sensitive losses ) affect PABI are discussed in Appx . A.5 . We derive the PABI for partial labels in detail and the derivations for others are similar . More examples and details can be found in Appx . A.6 .
This paper proposes PABI (PAC-Bayesian Informativeness?), a way of measuring and predicting the usefulness of “incidental supervision signal” for a downstream classification task. In particular, when labeled data is only available in noisy or partial form, or over a different domain than the target test domain, this data may still be used to improve a classifier, but it’s unclear how to tell which forms of incidental supervision will be most useful. Having a measure which allows us to compare different types of such supervision enables us to make intelligent tradeoffs.
SP:f952feef70a17987e9691ce2faef013e1b59168e
Self-Activating Neural Ensembles for Continual Reinforcement Learning
1 INTRODUCTION . Lifelong learning is of critical importance for the field of robotics ; an agent that interacts with the world should be able to continuously learn from it , acting intelligently in a wide variety of situations . In marked contrast to this ideal , most standard deep reinforcement learning methods are centered around a single task . First , a task is defined , then a policy is learned to maximize the rewards the agent receives in that setting . If the task is changed , a completely new model is learned , throwing away the previous model and previous interactions . Task specification therefore plays a central role in current end-to-end deep reinforcement learning frameworks . But is task-driven learning scalable ? In contrast , humans do not require concrete task boundaries to be able to effectively learn separate tasks – instead , we perform continual ( lifelong ) learning . The same model is used to learn new skills , leveraging the lessons of previous skills to learn more efficiently , without forgetting old behaviors . However , when placed into continual learning settings , current deep reinforcement learning approaches do neither : the transfer properties of these systems are negligible and they suffer from catastrophic forgetting ( McCloskey & Cohen , 1989 ; French , 2006 ) . The core issue of catastrophic forgetting is that a neural network trained on one task starts to forget what it knows when trained on a second task , and this issue only becomes exacerbated as more tasks are added . The problem ultimately stems from training one network end-to-end sequentially ; the shared nature of the weights and the backpropagation used to update them mean that later tasks overwrite earlier ones ( McCloskey & Cohen , 1989 ; Ratcliff , 1990 ) . To handle this , past approaches have attempted a wide variety of ideas : from task-based regularization ( Kirkpatrick et al. , 2017 ) , to learning different sub-modules for different tasks ( Rusu et al. , 2016 ) , to dual-system slow/fast learners inspired by the human hippocampus ( Schwarz et al. , 2018 ) . The core problem of continual learning , which none of these methods address , is that the agent needs to autonomously determine how and when to adapt to changing environments , as it is infeasible for a human to indefinitely provide an agent with task-boundary supervision . Specifically , these approaches rely on the notion of tasks to identify when to spawn new sub-modules , when to freeze weights , when to save parameters , etc . Leaning on task boundaries is unscalable and side-steps the core problem . There are a few existing task-free methods . Some address the problem by utilizing fixed subdivisions of the input space ( Aljundi et al. , 2018 ; Veness et al. , 2019 ) , which we believe limits their flexibility . Recent experience-based approaches such as Rolnick et al . ( 2018 ) forgo explicit task IDs , but to do so they must maintain a large replay buffer , which is unscalable with an ever-increasing number of tasks . To our knowledge only one other continual learning method , Neural Dirichlet Process Mixture Models ( Lee et al. , 2020 ) , adaptively creates new clusters , and we show in our experiments that SANE outperforms it . Our method approaches the problem head-on by dynamically adapting to changing environments . Our task-agnostic hierarchical method , Self-Activating Neural Ensembles ( SANE ) , depicted in Figure 1 , is the core of the method . Every node in the tree is a separate module , none task-specific . At each timestep a single path through the tree is activated to determine the action to take . Only activated nodes are updated , leaving unused modules unchanged and therefore immune to catastrophic forgetting . Critically , our tree is dynamic ; new nodes are created when existing nodes are found to be insufficient . This allows for the creation of new paths through the tree for novel scenarios , preventing destructive parameter updates to the other nodes . SANE provides the following desirable properties for continual reinforcement learning : ( a ) It mitigates catastrophic forgetting by only updating relevant modules ; ( b ) Because of its task-agnostic nature , unlike previous approaches , it does not require explicit supervision with task IDs ; ( c ) It achieves these targets with bounded resources and computation . In our results , we demonstrate the ability of SANE to learn and retain MNIST digits when presented fully sequentially , a challenging task our baselines struggle with . We also demonstrate SANE on a series of three grid world tasks , showing that SANE works in the reinforcement learning setting . 2 MODEL . The structure of our Self-Activating Neural Ensembles ( SANE ) system is a tree , as shown in Figure 1 . Each node in the tree contains both an actor and a critic , described in 2.1 . At each timestep we activate a path through the tree from the root to a leaf , at each layer selecting the node whose critic estimates the highest activation score ( described in 2.2 ) . We then sample an action from that leaf node ’ s policy to execute in the environment . During training , the activated nodes are the only ones updated ; all other nodes are unchanged . This enables behaviors selected for by other paths through the tree to remain unchanged . The tree structure is critical to the success of the system ; a node ’ s children can be seen as partitioning the input space that activates the node , specializing their policies to these subspaces . When they differ sufficiently from their parent in performance , they are promoted to a higher level of the tree and obtain children of their own , further partitioning the space . Nodes are constantly being created , promoted to higher levels , or merged as the situation demands ( described in Section 2.4 ) . Static vs . Dynamic Trees : One critical question to ask is why use a dynamic structure and not just a huge static tree with only parameter updates ? In the case of the static tree , if a path through the network is beneficial for one task , it is likely to be chosen as a starting point for the subsequent task , and updated in-place for this new setting . Examples of this can be found in Jacobs et al . ( 1991 ) ; Shazeer et al . ( 2017 ) , where specialized losses are necessary to distribute activation across the ensemble of experts , even in the case of a stationary distribution . With SANE , the change of environment would be detected and a new path created , thus minimizing disruption of the previously beneficial behaviors . 2.1 NODE CONTENTS . Every node i contains the following : a policy pi , a critic Ci , a replay buffer containing a list of ( state s , discounted reward rdisc ) , and a count of the number of times this node has been used ( usage count ) . The policy pi presented here is a vector of n logits , where n is the number of actions available to the agent . The critic Ci is a neural net mapping a state s to two scalars : the value estimate of the discounted reward received if the current node is activated , vi ( s ) , and an estimate of the absolute error : ui ( s ) ≈ |rdisc − vi ( s ) | ( 1 ) With these we can define an optimistic estimate ( upper confidence bound ) and a pessimistic estimate ( lower confidence bound ) for what reward a node can achieve : vUCB , i ( s ) = vi ( s ) + α ∗ ui ( s ) ( 2 ) vLCB , i ( s ) = vi ( s ) − α ∗ ui ( s ) ( 3 ) α is a hyper-parameter representing how wide a margin around the expected value we allow . vUCB is analogous to an upper confidence bound in multi-armed bandit literature : as training proceeds and vi becomes more accurate , ui will decrease , providing a natural transition from exploration to exploitation for each node as it learns . This may however act too optimistically in highly stochastic environments , an area of future work . Each node ’ s replay buffer contains the history of experiences per node and is used to train the node ’ s critic . The usage count is the number of times a node has been activated and is used in the merging of nodes . These are described more in sections 2.3 and 2.4 . 2.2 INFERENCE . For each observed state st from the environment , we activate a path through the tree from the root to a leaf node , whose policy is used to determine the next action to take in the environment , at . The environment then responds with a reward rt and a new observation st+1 ( See Figure 2 ) . We find the path recursively : from an activated node , the next node to activate is selected from its children by taking the node with the highest optimistic upper bound of reward . This process continues until a leaf node is reached . After the set of activated nodes is determined , an action is selected stochastically from the activated leaf ’ s policy , and executed in the environment . New nodes are not created mid-episode to keep the tree idempotent , which allows us to readily run environments in parallel . During inference , three things happen at each timestep to support updating the tree . All active nodes : • are registered to receive the replay entry for that timestep after the episode completes . • compare their critic ’ s estimate to their parent ’ s . If they differ sufficiently ( Section 2.4 ) , the child will be promoted during the next tree structure update . • increment their usage count . 2.3 PARAMETER UPDATES . SANE training updates consist of two steps : parameter updates ( replay buffer , policy , and critic ) and tree structure updates ( creating new nodes , merging nodes , etc. ) . After T steps of data collection have occurred , we trigger both a parameter update and a tree structure update . Replay Buffer Update : Each node ’ s replay buffer contains the history of the times that node was activated , and is used to train the node ’ s critic . Each entry in the replay buffer contains an input state s and a discounted reward received rdisc , which is also used in the training of the policies . The discounted reward is computed in the standard fashion , as in Espeholt et al . ( 2018 ) . When the addition of new entries results in the replay buffer exceeding its max length , instead of removing the oldest entries , random entries are removed instead . This is to mitigate each critic from developing a recency bias . Policy Update : The policy for each node is trained on-line using REINFORCE ( Williams , 1992 ) with Monte Carlo returns . Training the Critics : The critic for each node is trained off-line using the replay buffer . More specifically , we split a node ’ s replay buffer into batches each of size k. The critic has two functions to estimate : v ( s ) ( the expected value ) and u ( s ) ( the uncertainty as defined in equation 1 ) . We use L2 loss for both reward and error prediction . Note that this is the slowest step in the training of the SANE tree . Since the nodes all use separate critics , this step can be effectively parallelized . We only train a critic when its node was activated at least once since the last time nodes were trained .
The paper proposes SANE -- an architecture and a training algorithm for continual learning. The SANE model consists of a tree where each node can act as an RL agent and where nodes act according to the dispatching mechanism based on their reward prediction. This allows to activate and update only those agents that are specialized in the current task and thus may prevent catastrophic forgetting caused by updating the whole model.
SP:6fbc712869c021f261ee4e71e49a9043f8191925
Self-Activating Neural Ensembles for Continual Reinforcement Learning
1 INTRODUCTION . Lifelong learning is of critical importance for the field of robotics ; an agent that interacts with the world should be able to continuously learn from it , acting intelligently in a wide variety of situations . In marked contrast to this ideal , most standard deep reinforcement learning methods are centered around a single task . First , a task is defined , then a policy is learned to maximize the rewards the agent receives in that setting . If the task is changed , a completely new model is learned , throwing away the previous model and previous interactions . Task specification therefore plays a central role in current end-to-end deep reinforcement learning frameworks . But is task-driven learning scalable ? In contrast , humans do not require concrete task boundaries to be able to effectively learn separate tasks – instead , we perform continual ( lifelong ) learning . The same model is used to learn new skills , leveraging the lessons of previous skills to learn more efficiently , without forgetting old behaviors . However , when placed into continual learning settings , current deep reinforcement learning approaches do neither : the transfer properties of these systems are negligible and they suffer from catastrophic forgetting ( McCloskey & Cohen , 1989 ; French , 2006 ) . The core issue of catastrophic forgetting is that a neural network trained on one task starts to forget what it knows when trained on a second task , and this issue only becomes exacerbated as more tasks are added . The problem ultimately stems from training one network end-to-end sequentially ; the shared nature of the weights and the backpropagation used to update them mean that later tasks overwrite earlier ones ( McCloskey & Cohen , 1989 ; Ratcliff , 1990 ) . To handle this , past approaches have attempted a wide variety of ideas : from task-based regularization ( Kirkpatrick et al. , 2017 ) , to learning different sub-modules for different tasks ( Rusu et al. , 2016 ) , to dual-system slow/fast learners inspired by the human hippocampus ( Schwarz et al. , 2018 ) . The core problem of continual learning , which none of these methods address , is that the agent needs to autonomously determine how and when to adapt to changing environments , as it is infeasible for a human to indefinitely provide an agent with task-boundary supervision . Specifically , these approaches rely on the notion of tasks to identify when to spawn new sub-modules , when to freeze weights , when to save parameters , etc . Leaning on task boundaries is unscalable and side-steps the core problem . There are a few existing task-free methods . Some address the problem by utilizing fixed subdivisions of the input space ( Aljundi et al. , 2018 ; Veness et al. , 2019 ) , which we believe limits their flexibility . Recent experience-based approaches such as Rolnick et al . ( 2018 ) forgo explicit task IDs , but to do so they must maintain a large replay buffer , which is unscalable with an ever-increasing number of tasks . To our knowledge only one other continual learning method , Neural Dirichlet Process Mixture Models ( Lee et al. , 2020 ) , adaptively creates new clusters , and we show in our experiments that SANE outperforms it . Our method approaches the problem head-on by dynamically adapting to changing environments . Our task-agnostic hierarchical method , Self-Activating Neural Ensembles ( SANE ) , depicted in Figure 1 , is the core of the method . Every node in the tree is a separate module , none task-specific . At each timestep a single path through the tree is activated to determine the action to take . Only activated nodes are updated , leaving unused modules unchanged and therefore immune to catastrophic forgetting . Critically , our tree is dynamic ; new nodes are created when existing nodes are found to be insufficient . This allows for the creation of new paths through the tree for novel scenarios , preventing destructive parameter updates to the other nodes . SANE provides the following desirable properties for continual reinforcement learning : ( a ) It mitigates catastrophic forgetting by only updating relevant modules ; ( b ) Because of its task-agnostic nature , unlike previous approaches , it does not require explicit supervision with task IDs ; ( c ) It achieves these targets with bounded resources and computation . In our results , we demonstrate the ability of SANE to learn and retain MNIST digits when presented fully sequentially , a challenging task our baselines struggle with . We also demonstrate SANE on a series of three grid world tasks , showing that SANE works in the reinforcement learning setting . 2 MODEL . The structure of our Self-Activating Neural Ensembles ( SANE ) system is a tree , as shown in Figure 1 . Each node in the tree contains both an actor and a critic , described in 2.1 . At each timestep we activate a path through the tree from the root to a leaf , at each layer selecting the node whose critic estimates the highest activation score ( described in 2.2 ) . We then sample an action from that leaf node ’ s policy to execute in the environment . During training , the activated nodes are the only ones updated ; all other nodes are unchanged . This enables behaviors selected for by other paths through the tree to remain unchanged . The tree structure is critical to the success of the system ; a node ’ s children can be seen as partitioning the input space that activates the node , specializing their policies to these subspaces . When they differ sufficiently from their parent in performance , they are promoted to a higher level of the tree and obtain children of their own , further partitioning the space . Nodes are constantly being created , promoted to higher levels , or merged as the situation demands ( described in Section 2.4 ) . Static vs . Dynamic Trees : One critical question to ask is why use a dynamic structure and not just a huge static tree with only parameter updates ? In the case of the static tree , if a path through the network is beneficial for one task , it is likely to be chosen as a starting point for the subsequent task , and updated in-place for this new setting . Examples of this can be found in Jacobs et al . ( 1991 ) ; Shazeer et al . ( 2017 ) , where specialized losses are necessary to distribute activation across the ensemble of experts , even in the case of a stationary distribution . With SANE , the change of environment would be detected and a new path created , thus minimizing disruption of the previously beneficial behaviors . 2.1 NODE CONTENTS . Every node i contains the following : a policy pi , a critic Ci , a replay buffer containing a list of ( state s , discounted reward rdisc ) , and a count of the number of times this node has been used ( usage count ) . The policy pi presented here is a vector of n logits , where n is the number of actions available to the agent . The critic Ci is a neural net mapping a state s to two scalars : the value estimate of the discounted reward received if the current node is activated , vi ( s ) , and an estimate of the absolute error : ui ( s ) ≈ |rdisc − vi ( s ) | ( 1 ) With these we can define an optimistic estimate ( upper confidence bound ) and a pessimistic estimate ( lower confidence bound ) for what reward a node can achieve : vUCB , i ( s ) = vi ( s ) + α ∗ ui ( s ) ( 2 ) vLCB , i ( s ) = vi ( s ) − α ∗ ui ( s ) ( 3 ) α is a hyper-parameter representing how wide a margin around the expected value we allow . vUCB is analogous to an upper confidence bound in multi-armed bandit literature : as training proceeds and vi becomes more accurate , ui will decrease , providing a natural transition from exploration to exploitation for each node as it learns . This may however act too optimistically in highly stochastic environments , an area of future work . Each node ’ s replay buffer contains the history of experiences per node and is used to train the node ’ s critic . The usage count is the number of times a node has been activated and is used in the merging of nodes . These are described more in sections 2.3 and 2.4 . 2.2 INFERENCE . For each observed state st from the environment , we activate a path through the tree from the root to a leaf node , whose policy is used to determine the next action to take in the environment , at . The environment then responds with a reward rt and a new observation st+1 ( See Figure 2 ) . We find the path recursively : from an activated node , the next node to activate is selected from its children by taking the node with the highest optimistic upper bound of reward . This process continues until a leaf node is reached . After the set of activated nodes is determined , an action is selected stochastically from the activated leaf ’ s policy , and executed in the environment . New nodes are not created mid-episode to keep the tree idempotent , which allows us to readily run environments in parallel . During inference , three things happen at each timestep to support updating the tree . All active nodes : • are registered to receive the replay entry for that timestep after the episode completes . • compare their critic ’ s estimate to their parent ’ s . If they differ sufficiently ( Section 2.4 ) , the child will be promoted during the next tree structure update . • increment their usage count . 2.3 PARAMETER UPDATES . SANE training updates consist of two steps : parameter updates ( replay buffer , policy , and critic ) and tree structure updates ( creating new nodes , merging nodes , etc. ) . After T steps of data collection have occurred , we trigger both a parameter update and a tree structure update . Replay Buffer Update : Each node ’ s replay buffer contains the history of the times that node was activated , and is used to train the node ’ s critic . Each entry in the replay buffer contains an input state s and a discounted reward received rdisc , which is also used in the training of the policies . The discounted reward is computed in the standard fashion , as in Espeholt et al . ( 2018 ) . When the addition of new entries results in the replay buffer exceeding its max length , instead of removing the oldest entries , random entries are removed instead . This is to mitigate each critic from developing a recency bias . Policy Update : The policy for each node is trained on-line using REINFORCE ( Williams , 1992 ) with Monte Carlo returns . Training the Critics : The critic for each node is trained off-line using the replay buffer . More specifically , we split a node ’ s replay buffer into batches each of size k. The critic has two functions to estimate : v ( s ) ( the expected value ) and u ( s ) ( the uncertainty as defined in equation 1 ) . We use L2 loss for both reward and error prediction . Note that this is the slowest step in the training of the SANE tree . Since the nodes all use separate critics , this step can be effectively parallelized . We only train a critic when its node was activated at least once since the last time nodes were trained .
This work addresses multi-task learning where task boundaries are unknown. The approach is to construct a dynamic decision tree with nodes made up of small networks. Nodes are merged and promoted in the tree based on learned error bounds on value function estimates. Inference through the tree works by selecting nodes with the highest value prediction. It is an interesting approach for modular learning, even within the same environment.
SP:6fbc712869c021f261ee4e71e49a9043f8191925
Efficient Estimators for Heavy-Tailed Machine Learning
1 INTRODUCTION . Existing estimators in machine learning are largely designed for “ thin-tailed ” data , such as those coming from a Gaussian distribution . Past work in statistical estimation has given sufficient evidence that in the absence of these “ thin-tails ” , classical estimators based on minimizing the empirical error perform poorly ( Catoni , 2012 ; Lugosi et al. , 2019 ) . Theoretical guarantees for methods commonly used in machine learning usually place assumptions on the tails of the underlying distributions that are analyzed . For instance , rates of convergences proven for a variety of stochastic optimization procedures assume that the distribution of gradients have bounded variance ( for e.g. , Zou et al . ( 2018 ) ) or in some cases are sub-Gaussian ( for e.g. , Li & Orabona ( 2019 ) ) . Thus , these guarantees are no longer applicable for heavy-tailed gradient distributions . From a practical point of view however , this is a less than desirable state of affairs : heavy-tailed distributions are ubiquitous in a variety of fields including large scale biological datasets and financial datasets among others ( Fan et al. , 2016 ; Zhou et al. , 2017 ; Fan et al. , 2017 ) . While this may be argued as just artifacts of the domain , recent work has found interesting evidence of heavy-tailed distributions in the intermediate outputs of machine learning algorithms . Specifically , recent work by Simsekli et al . ( 2019 ) and Zhang et al . ( 2019 ) have provided empirical evidence about the existence of such heavy-tailed distributions , especially during neural network training for supervised learning tasks . Following these empirical analyses of Simsekli et al . ( 2019 ) and Zhang et al . ( 2019 ) , we look for sources of heavy-tailed gradients arising during the training of modern generative model based unsupervised learning tasks as well . In our preliminary investigation , we noticed that the distribution of gradient norms i.e. , �gt�2 are indeed heavy-tailed . These are showcased in Figure 1 ; Figures 1a and 1b show the distribution of gradient norms obtained while training the generator of a DCGAN ( Radford et al. , 2015 ) and Real-NVP ( Dinh et al. , 2016 ) on the CIFAR-10 dataset , respectively . These distributions are noticeably heavy-tailed , especially when juxtaposed with those obtained from a Gaussian distribution ( Figure 1c ) . We discuss more about the empirical setup in Section 5.2 . Interestingly , in all the supervised and unsupervised machine learning problems discussed above , we merely need to compute expectations of these varied random heavy-tailed quantities . For instance , mini-batch gradient descent involves aggregating a batch of gradients pertaining to each sample in the mini-batch . Typically , this aggregation is performed by considering the sample mean , and this is a reasonable choice due to its simplicity as an estimate of the expectation of the random gradient . For computing the mean of such heavy-tailed gradient distributions , the sample mean however is highly sub-optimal . This is because sample mean estimates are greatly skewed by samples on the tail . Thus gradient estimates using these sub-optimal sample means of gradients do not necessarily point in the right direction leading to bad solutions , prolonged training time , or a mixture of both . Thus , a critical requirement for training of modern machine learning models is a scalable estimation of the mean of a heavy-tailed random vector . Note that such computations of mean of sample gradients are done in each iteration of ( stochastic ) gradient descent , so that we require that the heavy-tailed mean estimation be extremely scalable , yet with strong guarantees . Note that once we have such a scalable heavy-tailed mean estimator , we could simply use it to compute robust gradient estimates Prasad et al . ( 2020 ) , and learn generic statistical models . We summarize our contributions as follows : • We extend recent analyses of heavy-tailed behavior in machine learning , and provide novel em- pirical evidence of heavy-tailed gradients while training modern generative models such as generative adversarial networks ( GANs ) and invertible flow models . • To combat the issue of aggregating gradient samples from a heavy-tailed distribution , we propose a practical and easy-to-implement algorithm for heavy-tailed mean estimation with provable guarantees on the error of the estimate . • We use the proposed mean estimator to compute robust gradient estimates , which allows us to learn generalized linear models in the heavy-tailed setting , with strong guarantees on the estimation errors . • Finally , we propose a heuristic approximation of the mean estimation algorithm , which scales to random vectors with millions of variables . Accordingly , we use this heuristic to compute robust gradients of large-scale deep learning models with millions of parameters . We show that training with this heuristic outperforms a variety of practical baselines . Notation and other definitions . Let x be a random vector with mean µ . We say that the x has bounded 2k-moments if for all v ∈ Sp−1 ( unit ball ) , E [ ( vT ( x− µ ) ) 2k ] ≤ C2k � E [ ( vT ( x− µ ) ) 2 ] �k . Throughout the paper , we use c , c1 , c2 , . . . , C , C1 , C2 , . . . to denote positive universal constants . 2 EFFICIENT AND PRACTICAL MEAN ESTIMATION . We begin by formalizing the notion of heavy-tailed distributions . Definition 1 ( Heavy-Tailed Distribution ( Resnick , 2007 ) ) . A non-negative random variable X is called heavy-tailed if the tail probability P ( X > t ) is asymptotically proportional to t−α ∗ , where α∗ is a positive constant called the tail index of X . Intuitively , this definition states that if the tail of the distribution P ( X > t ) decreases at a rate slower that e−t , then the distribution is heavy-tailed . An interesting consequence of this definition is the non-existence of higher order moments . Specifically , one can show that the quantity E [ Xα ] is finite for any α if and only if α < α∗ and X is a heavy-tailed random variable with tail index α∗ . In recent statistical estimation literature ( for e.g. , Minsker ( 2015 ) ; Hopkins ( 2018 ) ; Lugosi & Mendelson ( 2019 ) ) , heavy-tailed distributions are defined by the absence of finite higher order moments . In the heavy-tailed mean estimation task , we observe n samples x1 , . . . , xn drawn independently from a distribution P where xi ∈ Rp , which is only assumed to have finite low-order moments , therefore heavy-tailed . The goal of past work ( Catoni , 2012 ; Minsker , 2015 ; Lugosi et al. , 2019 ; Catoni & Giulini , 2017 ) has been to design an estimator �θn of the true mean µ of P which has a small �2-error with high-probability . As a benchmark for estimators in the heavy-tailed model , we observe that when P is the multivariate normal ( or equivalently a sub-Gaussian ) distribution with mean µ and covariance Σ , the sample mean �µn = 1/n � i xi satisfies , with probability at least 1− δ 1 : ��µn − µ�2 � � trace ( Σ ) n + � �Σ�2 log ( 1/δ ) n def = OPTn , Σ , δ ( 1 ) Seminal work by Catoni ( 2012 ) showed that the sample mean is extremely sub-optimal , while more recent work by Lugosi et al . ( 2019 ) showed that the sub-Gaussian error bound is achievable while only assuming that P has finite variance i.e. , 2nd moment . In the multivariate setting , Minsker ( 2015 ) showed that the extremely practical geometric-median-of-means estimator ( GMOM ) achieves a sub-optimal error bound by showing that with probability at least 1− δ : ��θMOM , δ − µ�2 � � trace ( Σ ) log ( 1/δ ) n . ( 2 ) Computationally intractable estimators that truly achieve the sub-Gaussian error bound were proposed by Lugosi et al . ( 2019 ) ; Catoni & Giulini ( 2017 ) . Hopkins ( 2018 ) and later Cherapanamjeri et al . ( 2019 ) developed a sum-of-squares based relaxation of the estimator in Lugosi et al . ( 2019 ) , thereby giving a polynomial time algorithm which achieves optimal rates . More recent work has studied the problem of mean estimation , focusing on constructing theoretically fast polynomial time estimators ( Dong et al. , 2019 ; Lugosi & Mendelson , 2019 ; Diakonikolas & Kane , 2019 ; Lei et al. , 2020 ; Lecué & Depersin , 2019 ) . However , these estimators have several hyperparameters , which require to be tuned for practice , making them impractical . Now , we present our algorithm Filterpd for heavy-tailed mean estimation , and is formally stated as Algorithm 1 . It proceeds in an iterative fashion , by ( 1 ) computing the leading eigenvector of the empirical covariance matrix ( Step ( 3 ) ) , ( 2 ) projecting points along this leading eigenvector ( Step ( 4 ) ) , and ( 3 ) randomly sampling points based on their projection scores ( Step ( 5 ) and ( 6 ) ) . This procedure is repeated for a fixed number of steps . Algorithm 1 Filterpd - Heavy Tailed Mean Estimator Require : Samples S = { zi } ni=1 , Iterations T ∗ 1 : for t = 1 to T ∗ do 2 : Compute �θS = 1|S| |S|� i=1 zi and �ΣS = 1|S| |S|� i=1 ( zi − �θS ) ⊗2 3 : Let v be the leading eigenvector of �ΣS 4 : For each zi , let τi def = � vT ( zi − �θS ) �2 be its score . 5 : Sample a point z ∼ S according to Pr ( zi ) ∝ τi 6 : Remove sample z from S i.e . S = S \ { z } 7 : end for 8 : return 1|S| |S|� i=1 zi Our proposed algorithm is primarily based on the SVD-based filtering algorithm , which has appeared in different forms ( Klivans et al. , 2009 ; Awasthi et al. , 2014 ) and was recently reused in Diakonikolas et al . ( 2016 ; 2017 ) for adversarial mean estimation . For instance , the algorithm in Diakonikolas et al . ( 2017 ) follows a similar procedure , but remove a subset of points at a step depending on magnitude of the projection score . Our first main result is presented as follows : Theorem 1 . Suppose { zi } ni=1 ∼ P with zi ∈ Rp for all i , where P has bounded 4th moment and n satisfies n ≥ Cr2 ( Σ ) log 2 ( p/δ ) log ( 1/δ ) , r ( Σ ) def = trace ( Σ ) ||Σ||2 ( 3 ) 1Here and throughout our paper we use the notation � to denote an inequality with universal constants dropped for conciseness . Then , Filterpd when instantiated for T ∗ = �C log ( 1/δ ) � steps returns an estimate �θδ which satisfies with probability at least 1− 4δ , δ ∈ ( 0 , 0.25 ) : ��θδ − µ�2 � OPTn , Σ , δ Remarks : Theorem 1 shows that when n is sufficiently large , Filterpd returns a mean estimate that achieves the optimal sub-Gaussian deviation bound . This algorithm is also extremely practical as compared to existing algorithms ( for e.g. , Lei et al . ( 2020 ) ) and engenders development of scalable variants , which we later describe in Section 4 . We defer the proofs of Theorem 1 to the appendix .
The author(s) propose a computationally efficient mean estimator for generative distribution that are "heavy-tailed" in nature. The phenomenon of heavy tailed distributions for gradients in the training stage of generative models are common in nature and the proposed method aims to alleviate this problem by constructing a robust gradient estimator in such situation. The proposed methodology is well backed up by synthetic and real data examples. The topic is interesting and the proposed methodology is novel.
SP:cc400541c428521afdffeede69807daf3180cb17
Efficient Estimators for Heavy-Tailed Machine Learning
1 INTRODUCTION . Existing estimators in machine learning are largely designed for “ thin-tailed ” data , such as those coming from a Gaussian distribution . Past work in statistical estimation has given sufficient evidence that in the absence of these “ thin-tails ” , classical estimators based on minimizing the empirical error perform poorly ( Catoni , 2012 ; Lugosi et al. , 2019 ) . Theoretical guarantees for methods commonly used in machine learning usually place assumptions on the tails of the underlying distributions that are analyzed . For instance , rates of convergences proven for a variety of stochastic optimization procedures assume that the distribution of gradients have bounded variance ( for e.g. , Zou et al . ( 2018 ) ) or in some cases are sub-Gaussian ( for e.g. , Li & Orabona ( 2019 ) ) . Thus , these guarantees are no longer applicable for heavy-tailed gradient distributions . From a practical point of view however , this is a less than desirable state of affairs : heavy-tailed distributions are ubiquitous in a variety of fields including large scale biological datasets and financial datasets among others ( Fan et al. , 2016 ; Zhou et al. , 2017 ; Fan et al. , 2017 ) . While this may be argued as just artifacts of the domain , recent work has found interesting evidence of heavy-tailed distributions in the intermediate outputs of machine learning algorithms . Specifically , recent work by Simsekli et al . ( 2019 ) and Zhang et al . ( 2019 ) have provided empirical evidence about the existence of such heavy-tailed distributions , especially during neural network training for supervised learning tasks . Following these empirical analyses of Simsekli et al . ( 2019 ) and Zhang et al . ( 2019 ) , we look for sources of heavy-tailed gradients arising during the training of modern generative model based unsupervised learning tasks as well . In our preliminary investigation , we noticed that the distribution of gradient norms i.e. , �gt�2 are indeed heavy-tailed . These are showcased in Figure 1 ; Figures 1a and 1b show the distribution of gradient norms obtained while training the generator of a DCGAN ( Radford et al. , 2015 ) and Real-NVP ( Dinh et al. , 2016 ) on the CIFAR-10 dataset , respectively . These distributions are noticeably heavy-tailed , especially when juxtaposed with those obtained from a Gaussian distribution ( Figure 1c ) . We discuss more about the empirical setup in Section 5.2 . Interestingly , in all the supervised and unsupervised machine learning problems discussed above , we merely need to compute expectations of these varied random heavy-tailed quantities . For instance , mini-batch gradient descent involves aggregating a batch of gradients pertaining to each sample in the mini-batch . Typically , this aggregation is performed by considering the sample mean , and this is a reasonable choice due to its simplicity as an estimate of the expectation of the random gradient . For computing the mean of such heavy-tailed gradient distributions , the sample mean however is highly sub-optimal . This is because sample mean estimates are greatly skewed by samples on the tail . Thus gradient estimates using these sub-optimal sample means of gradients do not necessarily point in the right direction leading to bad solutions , prolonged training time , or a mixture of both . Thus , a critical requirement for training of modern machine learning models is a scalable estimation of the mean of a heavy-tailed random vector . Note that such computations of mean of sample gradients are done in each iteration of ( stochastic ) gradient descent , so that we require that the heavy-tailed mean estimation be extremely scalable , yet with strong guarantees . Note that once we have such a scalable heavy-tailed mean estimator , we could simply use it to compute robust gradient estimates Prasad et al . ( 2020 ) , and learn generic statistical models . We summarize our contributions as follows : • We extend recent analyses of heavy-tailed behavior in machine learning , and provide novel em- pirical evidence of heavy-tailed gradients while training modern generative models such as generative adversarial networks ( GANs ) and invertible flow models . • To combat the issue of aggregating gradient samples from a heavy-tailed distribution , we propose a practical and easy-to-implement algorithm for heavy-tailed mean estimation with provable guarantees on the error of the estimate . • We use the proposed mean estimator to compute robust gradient estimates , which allows us to learn generalized linear models in the heavy-tailed setting , with strong guarantees on the estimation errors . • Finally , we propose a heuristic approximation of the mean estimation algorithm , which scales to random vectors with millions of variables . Accordingly , we use this heuristic to compute robust gradients of large-scale deep learning models with millions of parameters . We show that training with this heuristic outperforms a variety of practical baselines . Notation and other definitions . Let x be a random vector with mean µ . We say that the x has bounded 2k-moments if for all v ∈ Sp−1 ( unit ball ) , E [ ( vT ( x− µ ) ) 2k ] ≤ C2k � E [ ( vT ( x− µ ) ) 2 ] �k . Throughout the paper , we use c , c1 , c2 , . . . , C , C1 , C2 , . . . to denote positive universal constants . 2 EFFICIENT AND PRACTICAL MEAN ESTIMATION . We begin by formalizing the notion of heavy-tailed distributions . Definition 1 ( Heavy-Tailed Distribution ( Resnick , 2007 ) ) . A non-negative random variable X is called heavy-tailed if the tail probability P ( X > t ) is asymptotically proportional to t−α ∗ , where α∗ is a positive constant called the tail index of X . Intuitively , this definition states that if the tail of the distribution P ( X > t ) decreases at a rate slower that e−t , then the distribution is heavy-tailed . An interesting consequence of this definition is the non-existence of higher order moments . Specifically , one can show that the quantity E [ Xα ] is finite for any α if and only if α < α∗ and X is a heavy-tailed random variable with tail index α∗ . In recent statistical estimation literature ( for e.g. , Minsker ( 2015 ) ; Hopkins ( 2018 ) ; Lugosi & Mendelson ( 2019 ) ) , heavy-tailed distributions are defined by the absence of finite higher order moments . In the heavy-tailed mean estimation task , we observe n samples x1 , . . . , xn drawn independently from a distribution P where xi ∈ Rp , which is only assumed to have finite low-order moments , therefore heavy-tailed . The goal of past work ( Catoni , 2012 ; Minsker , 2015 ; Lugosi et al. , 2019 ; Catoni & Giulini , 2017 ) has been to design an estimator �θn of the true mean µ of P which has a small �2-error with high-probability . As a benchmark for estimators in the heavy-tailed model , we observe that when P is the multivariate normal ( or equivalently a sub-Gaussian ) distribution with mean µ and covariance Σ , the sample mean �µn = 1/n � i xi satisfies , with probability at least 1− δ 1 : ��µn − µ�2 � � trace ( Σ ) n + � �Σ�2 log ( 1/δ ) n def = OPTn , Σ , δ ( 1 ) Seminal work by Catoni ( 2012 ) showed that the sample mean is extremely sub-optimal , while more recent work by Lugosi et al . ( 2019 ) showed that the sub-Gaussian error bound is achievable while only assuming that P has finite variance i.e. , 2nd moment . In the multivariate setting , Minsker ( 2015 ) showed that the extremely practical geometric-median-of-means estimator ( GMOM ) achieves a sub-optimal error bound by showing that with probability at least 1− δ : ��θMOM , δ − µ�2 � � trace ( Σ ) log ( 1/δ ) n . ( 2 ) Computationally intractable estimators that truly achieve the sub-Gaussian error bound were proposed by Lugosi et al . ( 2019 ) ; Catoni & Giulini ( 2017 ) . Hopkins ( 2018 ) and later Cherapanamjeri et al . ( 2019 ) developed a sum-of-squares based relaxation of the estimator in Lugosi et al . ( 2019 ) , thereby giving a polynomial time algorithm which achieves optimal rates . More recent work has studied the problem of mean estimation , focusing on constructing theoretically fast polynomial time estimators ( Dong et al. , 2019 ; Lugosi & Mendelson , 2019 ; Diakonikolas & Kane , 2019 ; Lei et al. , 2020 ; Lecué & Depersin , 2019 ) . However , these estimators have several hyperparameters , which require to be tuned for practice , making them impractical . Now , we present our algorithm Filterpd for heavy-tailed mean estimation , and is formally stated as Algorithm 1 . It proceeds in an iterative fashion , by ( 1 ) computing the leading eigenvector of the empirical covariance matrix ( Step ( 3 ) ) , ( 2 ) projecting points along this leading eigenvector ( Step ( 4 ) ) , and ( 3 ) randomly sampling points based on their projection scores ( Step ( 5 ) and ( 6 ) ) . This procedure is repeated for a fixed number of steps . Algorithm 1 Filterpd - Heavy Tailed Mean Estimator Require : Samples S = { zi } ni=1 , Iterations T ∗ 1 : for t = 1 to T ∗ do 2 : Compute �θS = 1|S| |S|� i=1 zi and �ΣS = 1|S| |S|� i=1 ( zi − �θS ) ⊗2 3 : Let v be the leading eigenvector of �ΣS 4 : For each zi , let τi def = � vT ( zi − �θS ) �2 be its score . 5 : Sample a point z ∼ S according to Pr ( zi ) ∝ τi 6 : Remove sample z from S i.e . S = S \ { z } 7 : end for 8 : return 1|S| |S|� i=1 zi Our proposed algorithm is primarily based on the SVD-based filtering algorithm , which has appeared in different forms ( Klivans et al. , 2009 ; Awasthi et al. , 2014 ) and was recently reused in Diakonikolas et al . ( 2016 ; 2017 ) for adversarial mean estimation . For instance , the algorithm in Diakonikolas et al . ( 2017 ) follows a similar procedure , but remove a subset of points at a step depending on magnitude of the projection score . Our first main result is presented as follows : Theorem 1 . Suppose { zi } ni=1 ∼ P with zi ∈ Rp for all i , where P has bounded 4th moment and n satisfies n ≥ Cr2 ( Σ ) log 2 ( p/δ ) log ( 1/δ ) , r ( Σ ) def = trace ( Σ ) ||Σ||2 ( 3 ) 1Here and throughout our paper we use the notation � to denote an inequality with universal constants dropped for conciseness . Then , Filterpd when instantiated for T ∗ = �C log ( 1/δ ) � steps returns an estimate �θδ which satisfies with probability at least 1− 4δ , δ ∈ ( 0 , 0.25 ) : ��θδ − µ�2 � OPTn , Σ , δ Remarks : Theorem 1 shows that when n is sufficiently large , Filterpd returns a mean estimate that achieves the optimal sub-Gaussian deviation bound . This algorithm is also extremely practical as compared to existing algorithms ( for e.g. , Lei et al . ( 2020 ) ) and engenders development of scalable variants , which we later describe in Section 4 . We defer the proofs of Theorem 1 to the appendix .
The paper studies the problem of high-probability mean estimation for heavy-tailed distributions, i.e., constructing a high-probability confidence intervals for the mean, when the underlying distribution has only finite low-degree moments. The paper motivates this problem from the view-point of machine learning algorithms, where the gradients are heavy-tailed. Especially in deep generative networks, the paper highlights the heavy-tailed nature of gradients via experiments. On a theoretical side, the paper derives bounds for mean estimation when the distribution has bounded fourth-moments.
SP:cc400541c428521afdffeede69807daf3180cb17
Theoretical bounds on estimation error for meta-learning
1 INTRODUCTION . Many practical machine learning applications deal with distributional shift from training to testing . One example is few-shot classification ( Ravi & Larochelle , 2016 ; Vinyals et al. , 2016 ) , where new classes need to be learned at test time based on only a few examples for each novel class . Recently , few-shot classification has seen increased success ; however , theoretical properties of this problem remain poorly understood . In this paper we analyze the meta-learning setting , where the learner is given access to samples from a set of meta-training distributions , or tasks . At test-time , the learner is exposed to only a small number of samples from some novel task . The meta-learner aims to uncover a useful inductive bias from the original samples , which allows them to learn a new task more efficiently.1 While some progress has been made towards understanding the generalization performance of specific meta-learning algorithms ( Amit & Meir , 2017 ; Khodak et al. , 2019 ; Bullins et al. , 2019 ; Denevi et al. , 2019 ; Cao et al. , 2019 ) , little is known about the difficulty of the meta-learning problem in general . Existing work has studied generalization upper-bounds for novel data distributions ( Ben-David et al. , 2010 ; Amit & Meir , 2017 ) , yet to our knowledge , the inherent difficulty of these tasks relative to the i.i.d case has not been characterized . In this work , we derive novel bounds for meta learners . We first present a general information theoretic lower bound , Theorem 1 , that we use to derive bounds in particular settings . Using this result , we derive lower bounds in terms of the number of training tasks , data per training task , and data available in a novel target task . Additionally , we provide a specialized analysis for the case where the space of learning tasks is only partially observed , proving that infinite training tasks or data per training task are insufficient to achieve zero minimax risk ( Corollary 2 ) . We then derive upper and lower bounds for a particular meta-learning setting . In recent work , Grant et al . ( 2018 ) recast the popular meta-learning algorithm MAML ( Finn et al. , 2017 ) in terms of inference in a Bayesian hierarchical model . Following this , we provide a theoretical analysis of a hierarchical Bayesian model for meta-linear-regression . We compute sample complexity bounds for posterior inference under Empirical Bayes ( Robbins , 1956 ) in this model and compare them to our predicted lower-bounds in the minimax framework . Furthermore , through asymptotic analysis of the error rate of the MAP estimator , we identify crucial features of the meta-learning environment which are necessary for novel task generalization . 1Note that this definition encompasses few-shot learning . Our primary contributions can be summarized as follows : • We introduce novel lower bounds on minimax risk of parameter estimation in meta-learning . • Through these bounds , we compare the relative utility of samples from meta-training tasks and the novel task and emphasize the importance of the relationship between the tasks . • We provide novel upper bounds on the error rate for estimation in a hierarchical meta-linearregression problem , which we verify through an empirical evaluation . 2 RELATED WORK . An early version of this work ( Lucas et al. , 2019 ) presented a restricted version of Theorem 1 . The current version includes significantly more content , including more general lower bounds and corresponding upper bounds in a hierarchical Bayesian model of meta-learning ( Section 5 ) . Baxter ( 2000 ) introduced a formulation for inductive bias learning where the learner is embedded in an environment of multiple tasks . The learner must find a hypothesis space which enables good generalization on average tasks within the environment , using finite samples . In our setting , the learner is not explicitly tasked with finding a reduced hypothesis space but instead learns using a general two-stage approach , which matches the standard meta-learning paradigm ( Vilalta & Drissi , 2002 ) . In the first stage an inductive bias is extracted from the data , and in the second stage the learner estimates using data from a novel task distribution . Further , we focus on bounding minimax risk of meta learners . Under minimax risk , an optimal learner achieves minimum error on the hardest learning problem in the environment . While average case risk of meta learners is more commonly studied , recent work has turned attention towards the minimax setting ( Kpotufe & Martinet , 2018 ; Hanneke & Kpotufe , 2019 ; 2020 ; Mousavi Kalan et al. , 2020 ; Mehta et al. , 2012 ) . The worst-case error in meta-learning is particularly important in safety-critical systems , for example in medical diagnosis . Mousavi Kalan et al . ( 2020 ) study the minimax risk of transfer learning . In their setting , the learner is provided with a large amount of data from a single source task and is tasked with generalizing to a target task with a limited amount of data . They assume relatedness between tasks by imposing closeness in parameter-space ( whereas in our setting , we assume closeness in distribution via KL divergence ) . They prove only lower bounds , but notably generalize beyond the linear setting towards single layer neural networks . There is a large volume of prior work studying upper-bounds on generalization error in multi-task environments ( Ben-David & Borbely , 2008 ; Ben-David et al. , 2010 ; Pentina & Lampert , 2014 ; Amit & Meir , 2017 ; Mehta et al. , 2012 ) . While the approaches in these works vary , one common factor is the need to characterize task-relatedness . Broadly , these approaches either assume a shared distribution for sampling tasks ( Baxter , 2000 ; Pentina & Lampert , 2014 ; Amit & Meir , 2017 ) , or a measure of distance between distributions ( Ben-David & Borbely , 2008 ; Ben-David et al. , 2010 ; Mohri & Medina , 2012 ) . Our lower-bounds utilize a weak form of task relatedness , assuming that the environment contains a finite set that is suitably separated in parameter space but close in KL divergence—this set of assumptions also arises often when computing i.i.d minimax lower bounds ( Loh , 2017 ) . One practical approach to meta-learning is learning a linear mapping on top of a learned feature space . Prototypical Networks ( Snell et al. , 2017 ) effectively learn a discriminative embedding function and performs linear classification on top using the novel task data . Analyzing these approaches is challenging due to metric-learning inspired objectives ( that require non-i.i.d sampling ) and the simultaneous learning of feature mappings and top-level linear functions . Though some progress has been made ( Jin et al. , 2009 ; Saunshi et al. , 2019 ; Wang et al. , 2019 ; Du et al. , 2020 ) . Maurer ( 2009 ) , for example , explores linear models fitted over a shared linear feature map in a Hilbert space . Our results can be applied in these settings if a suitable packing of the representation space is defined . Other approaches to meta-learning aim to parameterize learning algorithms themselves . Traditionally , this has been achieved by hyper-parameter tuning ( Rasmussen & Nickisch , 2010 ; MacKay et al. , 2019 ) but recent fully parameterized optimizers also show promising performance in deep neural network optimization ( Andrychowicz et al. , 2016 ) , few-shot learning ( Ravi & Larochelle , 2016 ) , unsupervised learning ( Metz et al. , 2019 ) , and reinforcement learning ( Duan et al. , 2016 ) . Yet another approach learns the initialization of task-specific parameters , that are further adapted through regular gradient descent . Model-Agnostic Meta-Learning ( Finn et al. , 2017 ) , or MAML , augments the global parameters with a meta-initialization of the weight parameters . Grant et al . ( 2018 ) recast MAML in terms of inference in a Bayesian hierarchical model . In Section 5 , we consider learning in a hierarchical environment of linear models and provide both lower and upper bounds on the error of estimating the parameters of a novel linear regression problem . Lower bounding estimation error is a critical component of understanding learning problems ( and algorithms ) . Accordingly , there is a large body of literature producing such lower bounds ( Khas ’ minskii , 1979 ; Yang & Barron , 1999 ; Loh , 2017 ) . We focus on producing lower-bounds for parameter estimation using local packing sets , but expect that extending these results to density estimation or non-parametric estimation is feasible . 3 NOVEL TASK ENVIRONMENT RISK . Most existing theoretical work studying out-of-distribution generalization focuses on providing upper-bounds on generalization performance ( Ben-David et al. , 2010 ; Pentina & Lampert , 2014 ; Amit & Meir , 2017 ) . We begin by instead exploring the converse : what is the best performance we can hope to achieve on any given task in the environment ? After introducing notation and minimax risks , we then show how these ideas can be applied , using meta linear regression as an example . A full reference table for notation can be found in Appendix A and a short summary is given here . We consider algorithms that learn in an environment ( Z , P ) , with data domain Z = X × Y and P a space of distributions with support Z . In the typical i.i.d setting , the algorithm is provided training data S ∈ Zk , consisting of k i.i.d samples from P ∈ P . In the standard multi-task setting , we sample training data from a set of training tasks { P1 , . . . , PM+1 } ⊂ P . We extend this to a meta-learning , or novel-task setting by first drawing S1 : M : n training data points from the first M distributions , for a total of nM samples . We call this the meta-training set . We then draw a small sample of novel data , called a support set , SM+1 ∈ Zk , from PM+1 . Consider a symmetric loss function ` ( a , b ) = ψ ( ρ ( a , b ) ) for non-decreasing ψ and arbitrary metric ρ . We seek to estimate the output of θ : P → Ω , a functional that maps distributions to a metric space Ω . For example , θ ( P ) may describe the coefficient vector of a high-dimensional hyperplane when P is a space of linear models , and ρ may be the Euclidean distance . The i.i.d minimax risk Before studying the meta-learning setting , we first begin with a definition of the i.i.d minimax risk that measures the worst-case error of the best possible estimator , R∗ = inf θ̂ sup P∈P ES∼Pk [ ` ( θ̂ ( S ) , θP ) ] . ( 1 ) For notational convenience , we denote the output of θ ( P ) by θP . The estimator for θ is denoted , θ̂ : Zk → Ω , and maps k samples from P to an estimate of θP . Novel-task minimax risk In the novel-task setting , we wish to estimate θPM+1 , the parameters of the novel task distribution PM+1 . We consider two-stage estimators for θPM+1 . In the first stage , the meta-learner uses a learning algorithm f : S1 : M 7→ θ̂S1 : M , that maps the meta-training set to an estimation algorithm , θ̂S1 : M : Zk → Ω . In the second stage , the learner computes θ̂S1 : M ( SM+1 ) , the estimate of θPM+1 . The novel-task minimax risk is given by , R∗P ( β ) = inf f sup P1 , ... , PM+1∈QβP E S1 : M∼Pn1 : M SM+1∼PkM+1 [ ` ( ( f ( S1 : M ) ) ( SM+1 ) , θPM+1 ) ] , ( 2 ) where QβP = { ( P1 , . . . , PM+1 ) ∈ P : DKL ( PM+1‖Pi ) ≤ β , for i = 1 , . . . , M } . This ensures a degree of relatedness between the novel and meta-training tasks . The estimator for θM+1 now depends additionally on theMn samples in S1 : M , where only k Mn samples from PM+1 are available to the learner . Thus , R∗P addresses the domain shift expected at test-time in the meta-learning setting and allows the learner to use data from multiple tasks . The goal of f is to learn an inductive bias from S1 : M such that a good estimate is possible with only k data points from PM+1 . In this setting , k is equivalent to the number of shots in few-shot learning . An example with meta-linear regression We present here a short summary based on meta linear regression , which we will analyze in more detail in Section 5 . In Figure 1 , we show observed data samples from a family of polynomial regression models . Our aim is to output an algorithm which recovers the parameters of a new polynomial function from limited observations–we choose a MAP estimator which is described fully in Section 5 . In the bottom right , we are given only 5 data points from a novel task distribution and estimate the parameters of the model with both the MLE and MAP estimators — the MLE overfits the support set while the MAP estimator is close to the true function . In terms of the terminology used above , the set , P = { pθ ( y ) = N ( x > θ , σ2 ) : θ ∈ Rd , x = [ 1 , x , . . . , xd−1 ] } , is the space of polynomial regression models , parameterized by θ . For this problem , we take ` ( θ̂ , θ ) = ‖θ̂ − θ‖22 . In Figure 1 , tasks are generated with p ( θ ) = N ( τ , σ2θ ) , for unknown , sparse , τ ∈ Rd . Thus , each model is a polynomial function with few large coefficients . The algorithm f , first takes samples from P1 , P2 , P3 and computes an estimate , τ̂ . This estimate of τ is then used to compute θ̂ ( SM+1 ; τ̂ ) = argmaxθ4 p ( θ4|τ̂ , SM+1 ) . Note that this approach is able to learn the correct inductive bias from the data , without requiring a carefully designed regularizer . The lower bounds we derive in Section 4 can be applied to problems of this general type , and the upper and lower bounds in Section 5 apply specifically to meta-learning linear regression .
The paper studies the information-theoretic lower bounds in the minimax setting of meta-learning. The paper also discusses upper and lower bounds in the hierarchical Bayesian framework of meta linear regression. The novelty of the paper is two-fold: a) it proves a novel meta-learning local packing result to compute the conditional information between training task samples and the novel task data distribution and b) it compares the lower bound of the risk to the risk of posterior estimate in meta linear regression. In addition, the authors verify the dependence of risk on various parameters in 2 different experiments.
SP:ea57214b79bbaaa7538597610944256e6ac1fbe4
Theoretical bounds on estimation error for meta-learning
1 INTRODUCTION . Many practical machine learning applications deal with distributional shift from training to testing . One example is few-shot classification ( Ravi & Larochelle , 2016 ; Vinyals et al. , 2016 ) , where new classes need to be learned at test time based on only a few examples for each novel class . Recently , few-shot classification has seen increased success ; however , theoretical properties of this problem remain poorly understood . In this paper we analyze the meta-learning setting , where the learner is given access to samples from a set of meta-training distributions , or tasks . At test-time , the learner is exposed to only a small number of samples from some novel task . The meta-learner aims to uncover a useful inductive bias from the original samples , which allows them to learn a new task more efficiently.1 While some progress has been made towards understanding the generalization performance of specific meta-learning algorithms ( Amit & Meir , 2017 ; Khodak et al. , 2019 ; Bullins et al. , 2019 ; Denevi et al. , 2019 ; Cao et al. , 2019 ) , little is known about the difficulty of the meta-learning problem in general . Existing work has studied generalization upper-bounds for novel data distributions ( Ben-David et al. , 2010 ; Amit & Meir , 2017 ) , yet to our knowledge , the inherent difficulty of these tasks relative to the i.i.d case has not been characterized . In this work , we derive novel bounds for meta learners . We first present a general information theoretic lower bound , Theorem 1 , that we use to derive bounds in particular settings . Using this result , we derive lower bounds in terms of the number of training tasks , data per training task , and data available in a novel target task . Additionally , we provide a specialized analysis for the case where the space of learning tasks is only partially observed , proving that infinite training tasks or data per training task are insufficient to achieve zero minimax risk ( Corollary 2 ) . We then derive upper and lower bounds for a particular meta-learning setting . In recent work , Grant et al . ( 2018 ) recast the popular meta-learning algorithm MAML ( Finn et al. , 2017 ) in terms of inference in a Bayesian hierarchical model . Following this , we provide a theoretical analysis of a hierarchical Bayesian model for meta-linear-regression . We compute sample complexity bounds for posterior inference under Empirical Bayes ( Robbins , 1956 ) in this model and compare them to our predicted lower-bounds in the minimax framework . Furthermore , through asymptotic analysis of the error rate of the MAP estimator , we identify crucial features of the meta-learning environment which are necessary for novel task generalization . 1Note that this definition encompasses few-shot learning . Our primary contributions can be summarized as follows : • We introduce novel lower bounds on minimax risk of parameter estimation in meta-learning . • Through these bounds , we compare the relative utility of samples from meta-training tasks and the novel task and emphasize the importance of the relationship between the tasks . • We provide novel upper bounds on the error rate for estimation in a hierarchical meta-linearregression problem , which we verify through an empirical evaluation . 2 RELATED WORK . An early version of this work ( Lucas et al. , 2019 ) presented a restricted version of Theorem 1 . The current version includes significantly more content , including more general lower bounds and corresponding upper bounds in a hierarchical Bayesian model of meta-learning ( Section 5 ) . Baxter ( 2000 ) introduced a formulation for inductive bias learning where the learner is embedded in an environment of multiple tasks . The learner must find a hypothesis space which enables good generalization on average tasks within the environment , using finite samples . In our setting , the learner is not explicitly tasked with finding a reduced hypothesis space but instead learns using a general two-stage approach , which matches the standard meta-learning paradigm ( Vilalta & Drissi , 2002 ) . In the first stage an inductive bias is extracted from the data , and in the second stage the learner estimates using data from a novel task distribution . Further , we focus on bounding minimax risk of meta learners . Under minimax risk , an optimal learner achieves minimum error on the hardest learning problem in the environment . While average case risk of meta learners is more commonly studied , recent work has turned attention towards the minimax setting ( Kpotufe & Martinet , 2018 ; Hanneke & Kpotufe , 2019 ; 2020 ; Mousavi Kalan et al. , 2020 ; Mehta et al. , 2012 ) . The worst-case error in meta-learning is particularly important in safety-critical systems , for example in medical diagnosis . Mousavi Kalan et al . ( 2020 ) study the minimax risk of transfer learning . In their setting , the learner is provided with a large amount of data from a single source task and is tasked with generalizing to a target task with a limited amount of data . They assume relatedness between tasks by imposing closeness in parameter-space ( whereas in our setting , we assume closeness in distribution via KL divergence ) . They prove only lower bounds , but notably generalize beyond the linear setting towards single layer neural networks . There is a large volume of prior work studying upper-bounds on generalization error in multi-task environments ( Ben-David & Borbely , 2008 ; Ben-David et al. , 2010 ; Pentina & Lampert , 2014 ; Amit & Meir , 2017 ; Mehta et al. , 2012 ) . While the approaches in these works vary , one common factor is the need to characterize task-relatedness . Broadly , these approaches either assume a shared distribution for sampling tasks ( Baxter , 2000 ; Pentina & Lampert , 2014 ; Amit & Meir , 2017 ) , or a measure of distance between distributions ( Ben-David & Borbely , 2008 ; Ben-David et al. , 2010 ; Mohri & Medina , 2012 ) . Our lower-bounds utilize a weak form of task relatedness , assuming that the environment contains a finite set that is suitably separated in parameter space but close in KL divergence—this set of assumptions also arises often when computing i.i.d minimax lower bounds ( Loh , 2017 ) . One practical approach to meta-learning is learning a linear mapping on top of a learned feature space . Prototypical Networks ( Snell et al. , 2017 ) effectively learn a discriminative embedding function and performs linear classification on top using the novel task data . Analyzing these approaches is challenging due to metric-learning inspired objectives ( that require non-i.i.d sampling ) and the simultaneous learning of feature mappings and top-level linear functions . Though some progress has been made ( Jin et al. , 2009 ; Saunshi et al. , 2019 ; Wang et al. , 2019 ; Du et al. , 2020 ) . Maurer ( 2009 ) , for example , explores linear models fitted over a shared linear feature map in a Hilbert space . Our results can be applied in these settings if a suitable packing of the representation space is defined . Other approaches to meta-learning aim to parameterize learning algorithms themselves . Traditionally , this has been achieved by hyper-parameter tuning ( Rasmussen & Nickisch , 2010 ; MacKay et al. , 2019 ) but recent fully parameterized optimizers also show promising performance in deep neural network optimization ( Andrychowicz et al. , 2016 ) , few-shot learning ( Ravi & Larochelle , 2016 ) , unsupervised learning ( Metz et al. , 2019 ) , and reinforcement learning ( Duan et al. , 2016 ) . Yet another approach learns the initialization of task-specific parameters , that are further adapted through regular gradient descent . Model-Agnostic Meta-Learning ( Finn et al. , 2017 ) , or MAML , augments the global parameters with a meta-initialization of the weight parameters . Grant et al . ( 2018 ) recast MAML in terms of inference in a Bayesian hierarchical model . In Section 5 , we consider learning in a hierarchical environment of linear models and provide both lower and upper bounds on the error of estimating the parameters of a novel linear regression problem . Lower bounding estimation error is a critical component of understanding learning problems ( and algorithms ) . Accordingly , there is a large body of literature producing such lower bounds ( Khas ’ minskii , 1979 ; Yang & Barron , 1999 ; Loh , 2017 ) . We focus on producing lower-bounds for parameter estimation using local packing sets , but expect that extending these results to density estimation or non-parametric estimation is feasible . 3 NOVEL TASK ENVIRONMENT RISK . Most existing theoretical work studying out-of-distribution generalization focuses on providing upper-bounds on generalization performance ( Ben-David et al. , 2010 ; Pentina & Lampert , 2014 ; Amit & Meir , 2017 ) . We begin by instead exploring the converse : what is the best performance we can hope to achieve on any given task in the environment ? After introducing notation and minimax risks , we then show how these ideas can be applied , using meta linear regression as an example . A full reference table for notation can be found in Appendix A and a short summary is given here . We consider algorithms that learn in an environment ( Z , P ) , with data domain Z = X × Y and P a space of distributions with support Z . In the typical i.i.d setting , the algorithm is provided training data S ∈ Zk , consisting of k i.i.d samples from P ∈ P . In the standard multi-task setting , we sample training data from a set of training tasks { P1 , . . . , PM+1 } ⊂ P . We extend this to a meta-learning , or novel-task setting by first drawing S1 : M : n training data points from the first M distributions , for a total of nM samples . We call this the meta-training set . We then draw a small sample of novel data , called a support set , SM+1 ∈ Zk , from PM+1 . Consider a symmetric loss function ` ( a , b ) = ψ ( ρ ( a , b ) ) for non-decreasing ψ and arbitrary metric ρ . We seek to estimate the output of θ : P → Ω , a functional that maps distributions to a metric space Ω . For example , θ ( P ) may describe the coefficient vector of a high-dimensional hyperplane when P is a space of linear models , and ρ may be the Euclidean distance . The i.i.d minimax risk Before studying the meta-learning setting , we first begin with a definition of the i.i.d minimax risk that measures the worst-case error of the best possible estimator , R∗ = inf θ̂ sup P∈P ES∼Pk [ ` ( θ̂ ( S ) , θP ) ] . ( 1 ) For notational convenience , we denote the output of θ ( P ) by θP . The estimator for θ is denoted , θ̂ : Zk → Ω , and maps k samples from P to an estimate of θP . Novel-task minimax risk In the novel-task setting , we wish to estimate θPM+1 , the parameters of the novel task distribution PM+1 . We consider two-stage estimators for θPM+1 . In the first stage , the meta-learner uses a learning algorithm f : S1 : M 7→ θ̂S1 : M , that maps the meta-training set to an estimation algorithm , θ̂S1 : M : Zk → Ω . In the second stage , the learner computes θ̂S1 : M ( SM+1 ) , the estimate of θPM+1 . The novel-task minimax risk is given by , R∗P ( β ) = inf f sup P1 , ... , PM+1∈QβP E S1 : M∼Pn1 : M SM+1∼PkM+1 [ ` ( ( f ( S1 : M ) ) ( SM+1 ) , θPM+1 ) ] , ( 2 ) where QβP = { ( P1 , . . . , PM+1 ) ∈ P : DKL ( PM+1‖Pi ) ≤ β , for i = 1 , . . . , M } . This ensures a degree of relatedness between the novel and meta-training tasks . The estimator for θM+1 now depends additionally on theMn samples in S1 : M , where only k Mn samples from PM+1 are available to the learner . Thus , R∗P addresses the domain shift expected at test-time in the meta-learning setting and allows the learner to use data from multiple tasks . The goal of f is to learn an inductive bias from S1 : M such that a good estimate is possible with only k data points from PM+1 . In this setting , k is equivalent to the number of shots in few-shot learning . An example with meta-linear regression We present here a short summary based on meta linear regression , which we will analyze in more detail in Section 5 . In Figure 1 , we show observed data samples from a family of polynomial regression models . Our aim is to output an algorithm which recovers the parameters of a new polynomial function from limited observations–we choose a MAP estimator which is described fully in Section 5 . In the bottom right , we are given only 5 data points from a novel task distribution and estimate the parameters of the model with both the MLE and MAP estimators — the MLE overfits the support set while the MAP estimator is close to the true function . In terms of the terminology used above , the set , P = { pθ ( y ) = N ( x > θ , σ2 ) : θ ∈ Rd , x = [ 1 , x , . . . , xd−1 ] } , is the space of polynomial regression models , parameterized by θ . For this problem , we take ` ( θ̂ , θ ) = ‖θ̂ − θ‖22 . In Figure 1 , tasks are generated with p ( θ ) = N ( τ , σ2θ ) , for unknown , sparse , τ ∈ Rd . Thus , each model is a polynomial function with few large coefficients . The algorithm f , first takes samples from P1 , P2 , P3 and computes an estimate , τ̂ . This estimate of τ is then used to compute θ̂ ( SM+1 ; τ̂ ) = argmaxθ4 p ( θ4|τ̂ , SM+1 ) . Note that this approach is able to learn the correct inductive bias from the data , without requiring a carefully designed regularizer . The lower bounds we derive in Section 4 can be applied to problems of this general type , and the upper and lower bounds in Section 5 apply specifically to meta-learning linear regression .
This paper provides a minimax novel-task risk lower bound for meta learning via information-theoretical techniques, showing the fundamental limits of meta learning. The novel-task minimax risk depends on the number of samples from the meta-training set and novel task, as well as the task similarity. The authors further investigate the meta learning problem on a hierarchical Bayesian model, discuss the lower bound and upper bound with maximum-a-posterior estimator.
SP:ea57214b79bbaaa7538597610944256e6ac1fbe4
No MCMC for me: Amortized sampling for fast and stable training of energy-based models
1 INTRODUCTION . Energy-Based Models ( EBMs ) have recently regained popularity within machine learning , partly inspired by the impressive results of Du & Mordatch ( 2019 ) and Song & Ermon ( 2020 ) on largescale image generation . Beyond image generation , EBMs have also been successfully applied to a wide variety of applications including : out-of-distribution detection ( Grathwohl et al. , 2019 ; Du & Mordatch , 2019 ; Song & Ou , 2018 ) , adversarial robustness ( Grathwohl et al. , 2019 ; Hill et al. , 2020 ; Du & Mordatch , 2019 ) , reliable classification ( Grathwohl et al. , 2019 ; Liu & Abbeel , 2020 ) and semi-supervised learning ( Song & Ou , 2018 ; Zhao et al. ) . Strikingly , these EBM approaches outperform alternative classes of generative models and rival hand-tailored solutions on each task . Despite progress , training EBMs is still a challenging task . As shown in Table 1 , existing training methods are all deficient in at least one important practical aspect . Markov chain Monte Carlo ( MCMC ) methods are slow and unstable during training ( Nijkamp et al. , 2019a ; Grathwohl et al. , 2020 ) . Score matching mechanisms , which minimize alternative divergences are also unstable and most methods can not work with discontinuous nonlinearities ( such as ReLU ) ( Song & Ermon , 2019b ; Hyvärinen , 2005 ; Song et al. , 2020 ; Pang et al. , 2020b ; Grathwohl et al. , 2020 ; Vincent , 2011 ) . Noise contrastive approaches , which learn energy functions through density ratio estimation , typically don ’ t scale well to high-dimensional data ( Gao et al. , 2020 ; Rhodes et al. , 2020 ; Gutmann & Hyvärinen , 2010 ; Ceylan & Gutmann , 2018 ) . ∗Equal Contribution . Code available at github.com/wgrathwohl/VERA In this work , we present a simple method for training EBMs which performs as well as previous methods while being faster and substantially easier to tune . Our method is based on reinterpreting maximum likelihood as a bi-level variational optimization problem , which has been explored in the past for EBM training ( Dai et al. , 2019 ) . This perspective allows us to amortize away MCMC sampling into a GAN-style generator which is encouraged to have high entropy . We accomplish this with a novel approach to entropy regularization based on a fast variational approximation . This leads to the method we call Variational Entropy Regularized Approximate maximum likelihood ( VERA ) . Concretely , we make the following contributions : • We improve the MCMC-based entropy regularizer of Dieng et al . ( 2019 ) with a parallelizable variational approximation . • We show that an entropy-regularized generator can be used to produce a variational bound on the EBM likelihood which can be optimized more easily than MCMC-based estimators . • We demonstrate that models trained in this way achieve much higher likelihoods than methods trained with alternative EBM training procedures . • We show that our approach stabilizes and accelerates the training of recently proposed Joint Energy Models ( Grathwohl et al. , 2019 ) . • We show that the stabilization of our approach allows us to use JEM for semi-supervised learning , outperforming virtual adversarial training when little prior domain knowledge is available ( e.g. , for tabular data ) . 2 ENERGY BASED MODELS . An energy-based model ( EBM ) is any model which parameterizes a density as pθ ( x ) = efθ ( x ) Z ( θ ) ( 1 ) where fθ : RD → R and Z ( θ ) = ∫ efθ ( x ) dx is the normalizing constant which is not explicitly modeled . Any probability distribution can be represented in this way for some fθ . The energy-based parameterization has been used widely for its flexibility , ease of incorporating known structure , and relationship to physical systems common in chemistry , biology , and physics ( Ingraham et al. , 2019 ; Du et al. , 2020 ; Noé et al. , 2019 ) . The above properties make EBMs an appealing model class , but because they are unnormalized many tasks which are simple for alternative model classes become challenging for EBMs . For example , exact samples can not be drawn and likelihoods can not be exactly computed ( or even lowerbounded ) . This makes training EBMs challenging as we can not simply train them to maximize likelihood . The most popular approach to train EBMs is to approximate the gradient of the maximum likelihood objective . This gradient can be written as : ∇θ log pθ ( x ) = ∇θfθ ( x ) − Epθ ( x′ ) [ ∇θfθ ( x ′ ) ] . ( 2 ) MCMC techniques are used to approximately generate samples from pθ ( x ) ( Tieleman , 2008 ) . Practically , this approach suffers from poor stability and computational challenges from sequential sampling . Many tricks have been developed to overcome these issues ( Du & Mordatch , 2019 ) , but they largely still persist . Alternative estimators have been proposed to circumvent these challenges , including score matching ( Hyvärinen , 2005 ) , noise contrastive estimation ( Gutmann & Hyvärinen , 2010 ) , and variants thereof . These suffer from their own challenges in scaling to high dimensional data , and sacrifice the statistical efficiency of maximum likelihood . In Figure 1 we visualize densities learned with our approach and Persistent Contrastive Divergence ( Tieleman , 2008 ) ( PCD ) training . As we see , the sample quality of the PCD models is quite high but the learned density models do not match the true model . This is due to accrued bias in the gradient estimator from approximate MCMC sampling ( Grathwohl et al. , 2020 ) . Prior work ( Nijkamp et al. , 2019b ) has argued that this objective actually encourages the approximate MCMC samples to match the data rather than the density model . Conversely , we see that our approach ( with proper entropy regularization ) recovers a high quality model . 3 VARIATIONAL MAXIMUM LIKELIHOOD . We seek the energy function which maximizes likelihood given in Equation 1 . We examine the intractable component of the log-likelihood , the log partition-function logZ ( θ ) = log ∫ efθ ( x ) dx . We can re-write this quantity as the optimum of logZ ( θ ) = max q Eq ( x ) [ fθ ( x ) ] +H ( q ) ( 3 ) where q is a distribution and H ( q ) = −Eq ( x ) [ log q ( x ) ] denotes its entropy 1 ( see the Appendix A.1 for the derivation ) . Plugging this into our original maximum likelihood statement we obtain : θ̂ = argmax θ [ Epdata ( x ) [ fθ ( x ) ] −maxq [ Eq ( x ) [ fθ ( x ) ] +H ( q ) ] ] ( 4 ) which gives us an alternative method for training EBMs . We introduce an auxiliary sampler qφ which we train online to optimize the inner-loop of Equation 4 . This objective was used for EBM training in Kumar et al . ( 2019 ) ; Abbasnejad et al . ( 2019 ) ; Dai et al . ( 2017 ) , Dai et al . ( 2019 ) ( motivated by Fenchel Duality ( Wainwright & Jordan , 2008 ) ) . Abbasnejad et al . ( 2019 ) use an implicit generative model and Dai et al . ( 2019 ) propose to use a sampler which is inspired by MCMC sampling from pθ ( x ) and whose entropy can be computed exactly . Below we describe our approach which utilizes the same objective with a simpler sampler and a new approach to encourage high entropy . We note that when training pθ ( x ) and q ( x ) online together , the inner maximization will not be fully optimized . This leads our training objective for pθ ( x ) to be an upper bound on log pθ ( x ) . In Section 5.1 we explore the impact of this fact and find that the bound is tight enough to train models that achieve high likelihood on high-dimensional data . 1For continuous spaces , this would be the differential entropy , but we simply use entropy here for brevity . 4 METHOD . We now present a method for training an EBM pθ ( x ) = efθ ( x ) /Z ( θ ) to optimize Equation 4 . We introduce a generator distribution of the form qφ ( x ) = ∫ z qφ ( x|z ) q ( z ) dz such that : qφ ( x|z ) = N ( gψ ( z ) , σ2I ) , q ( z ) = N ( 0 , I ) ( 5 ) where gψ is a neural network with parameters ψ and thus , φ = { ψ , σ2 } . This is similar to the decoder of a variational autoencoder ( Kingma & Welling , 2013 ) . With this architecture it is easy to optimize the first and second terms of Equation 4 with reparameterization , but the entropy term requires more care . 4.1 ENTROPY REGULARIZATION . Estimating entropy or its gradients is a challenging task . Multiple , distinct approaches have been proposed in recent years based on Mutual Information estimation ( Kumar et al. , 2019 ) , variational upper bounds ( Ranganath et al. , 2016 ) , Denoising Autoencoders ( Lim et al. , 2020 ) , and nearest neighbors ( Singh & Póczos , 2016 ) . The above methods require the training of additional auxiliary models or do not scale well to high dimensions . Most relevant to this work are Dieng et al . ( 2019 ) ; Titsias & Ruiz ( 2019 ) which present a method for encouraging generators such as ours to have high entropy by estimating∇φH ( qφ ) .The estimator takes the following form : ∇φH ( qφ ) = ∇φEqφ ( x ) [ log qφ ( x ) ] = ∇φEp ( z ) p ( ) [ log qφ ( x ( z , ) ) ] ( Reparameterize sampling ) = Ep ( z ) p ( ) [ ∇φ log qφ ( x ( z , ) ) ] = Ep ( z ) p ( ) [ ∇x log qφ ( x ( z , ) ) T∇φx ( z , ) ] ( Chain rule ) ( 6 ) where we have written x ( z , ) = gψ ( z ) + σ . All quantities in Equation 6 can be easily computed except for the score-function ∇x log qφ ( x ) . The following estimator for this quantity can be easily derived ( see Appendix A.2 ) : ∇x log qφ ( x ) = Eqφ ( z|x ) [ ∇x log qφ ( x|z ) ] ( 7 ) which requires samples from the posterior qφ ( z|x ) to estimate . Dieng et al . ( 2019 ) ; Titsias & Ruiz ( 2019 ) generate these samples using Hamiltonian Monte Carlo ( HMC ) ( Neal et al. , 2011 ) , a gradientbased MCMC algorithm . As used in Dieng et al . ( 2019 ) , 28 sequential gradient computations must be made per training iteration . Since a key motivation of this work is to circumvent the costly sequential computation of MCMC sampling , this is not a favourable solution . In our work we propose a more efficient solution that we find works just as well empirically .
This paper proposes a new method on training energy-based models with maximum likelihood. Instead of using MCMC approaches to sample from the EBM, authors follow previous work on training neural generators for faster sample generation. In particular, authors consider a special generator where the output is convolved with Gaussian noise. The score function of this generator can be estimated with self-normalized importance sampling, which is then used to estimate the entropy term through the reparameterization trick. Authors demonstrate that their new method is able to train EBMs efficiently, and improves the stability and performance of JEMs compared to MCMC-based training approaches.
SP:80d95638850c9ff81a9b271d28a8aecf238497e6
No MCMC for me: Amortized sampling for fast and stable training of energy-based models
1 INTRODUCTION . Energy-Based Models ( EBMs ) have recently regained popularity within machine learning , partly inspired by the impressive results of Du & Mordatch ( 2019 ) and Song & Ermon ( 2020 ) on largescale image generation . Beyond image generation , EBMs have also been successfully applied to a wide variety of applications including : out-of-distribution detection ( Grathwohl et al. , 2019 ; Du & Mordatch , 2019 ; Song & Ou , 2018 ) , adversarial robustness ( Grathwohl et al. , 2019 ; Hill et al. , 2020 ; Du & Mordatch , 2019 ) , reliable classification ( Grathwohl et al. , 2019 ; Liu & Abbeel , 2020 ) and semi-supervised learning ( Song & Ou , 2018 ; Zhao et al. ) . Strikingly , these EBM approaches outperform alternative classes of generative models and rival hand-tailored solutions on each task . Despite progress , training EBMs is still a challenging task . As shown in Table 1 , existing training methods are all deficient in at least one important practical aspect . Markov chain Monte Carlo ( MCMC ) methods are slow and unstable during training ( Nijkamp et al. , 2019a ; Grathwohl et al. , 2020 ) . Score matching mechanisms , which minimize alternative divergences are also unstable and most methods can not work with discontinuous nonlinearities ( such as ReLU ) ( Song & Ermon , 2019b ; Hyvärinen , 2005 ; Song et al. , 2020 ; Pang et al. , 2020b ; Grathwohl et al. , 2020 ; Vincent , 2011 ) . Noise contrastive approaches , which learn energy functions through density ratio estimation , typically don ’ t scale well to high-dimensional data ( Gao et al. , 2020 ; Rhodes et al. , 2020 ; Gutmann & Hyvärinen , 2010 ; Ceylan & Gutmann , 2018 ) . ∗Equal Contribution . Code available at github.com/wgrathwohl/VERA In this work , we present a simple method for training EBMs which performs as well as previous methods while being faster and substantially easier to tune . Our method is based on reinterpreting maximum likelihood as a bi-level variational optimization problem , which has been explored in the past for EBM training ( Dai et al. , 2019 ) . This perspective allows us to amortize away MCMC sampling into a GAN-style generator which is encouraged to have high entropy . We accomplish this with a novel approach to entropy regularization based on a fast variational approximation . This leads to the method we call Variational Entropy Regularized Approximate maximum likelihood ( VERA ) . Concretely , we make the following contributions : • We improve the MCMC-based entropy regularizer of Dieng et al . ( 2019 ) with a parallelizable variational approximation . • We show that an entropy-regularized generator can be used to produce a variational bound on the EBM likelihood which can be optimized more easily than MCMC-based estimators . • We demonstrate that models trained in this way achieve much higher likelihoods than methods trained with alternative EBM training procedures . • We show that our approach stabilizes and accelerates the training of recently proposed Joint Energy Models ( Grathwohl et al. , 2019 ) . • We show that the stabilization of our approach allows us to use JEM for semi-supervised learning , outperforming virtual adversarial training when little prior domain knowledge is available ( e.g. , for tabular data ) . 2 ENERGY BASED MODELS . An energy-based model ( EBM ) is any model which parameterizes a density as pθ ( x ) = efθ ( x ) Z ( θ ) ( 1 ) where fθ : RD → R and Z ( θ ) = ∫ efθ ( x ) dx is the normalizing constant which is not explicitly modeled . Any probability distribution can be represented in this way for some fθ . The energy-based parameterization has been used widely for its flexibility , ease of incorporating known structure , and relationship to physical systems common in chemistry , biology , and physics ( Ingraham et al. , 2019 ; Du et al. , 2020 ; Noé et al. , 2019 ) . The above properties make EBMs an appealing model class , but because they are unnormalized many tasks which are simple for alternative model classes become challenging for EBMs . For example , exact samples can not be drawn and likelihoods can not be exactly computed ( or even lowerbounded ) . This makes training EBMs challenging as we can not simply train them to maximize likelihood . The most popular approach to train EBMs is to approximate the gradient of the maximum likelihood objective . This gradient can be written as : ∇θ log pθ ( x ) = ∇θfθ ( x ) − Epθ ( x′ ) [ ∇θfθ ( x ′ ) ] . ( 2 ) MCMC techniques are used to approximately generate samples from pθ ( x ) ( Tieleman , 2008 ) . Practically , this approach suffers from poor stability and computational challenges from sequential sampling . Many tricks have been developed to overcome these issues ( Du & Mordatch , 2019 ) , but they largely still persist . Alternative estimators have been proposed to circumvent these challenges , including score matching ( Hyvärinen , 2005 ) , noise contrastive estimation ( Gutmann & Hyvärinen , 2010 ) , and variants thereof . These suffer from their own challenges in scaling to high dimensional data , and sacrifice the statistical efficiency of maximum likelihood . In Figure 1 we visualize densities learned with our approach and Persistent Contrastive Divergence ( Tieleman , 2008 ) ( PCD ) training . As we see , the sample quality of the PCD models is quite high but the learned density models do not match the true model . This is due to accrued bias in the gradient estimator from approximate MCMC sampling ( Grathwohl et al. , 2020 ) . Prior work ( Nijkamp et al. , 2019b ) has argued that this objective actually encourages the approximate MCMC samples to match the data rather than the density model . Conversely , we see that our approach ( with proper entropy regularization ) recovers a high quality model . 3 VARIATIONAL MAXIMUM LIKELIHOOD . We seek the energy function which maximizes likelihood given in Equation 1 . We examine the intractable component of the log-likelihood , the log partition-function logZ ( θ ) = log ∫ efθ ( x ) dx . We can re-write this quantity as the optimum of logZ ( θ ) = max q Eq ( x ) [ fθ ( x ) ] +H ( q ) ( 3 ) where q is a distribution and H ( q ) = −Eq ( x ) [ log q ( x ) ] denotes its entropy 1 ( see the Appendix A.1 for the derivation ) . Plugging this into our original maximum likelihood statement we obtain : θ̂ = argmax θ [ Epdata ( x ) [ fθ ( x ) ] −maxq [ Eq ( x ) [ fθ ( x ) ] +H ( q ) ] ] ( 4 ) which gives us an alternative method for training EBMs . We introduce an auxiliary sampler qφ which we train online to optimize the inner-loop of Equation 4 . This objective was used for EBM training in Kumar et al . ( 2019 ) ; Abbasnejad et al . ( 2019 ) ; Dai et al . ( 2017 ) , Dai et al . ( 2019 ) ( motivated by Fenchel Duality ( Wainwright & Jordan , 2008 ) ) . Abbasnejad et al . ( 2019 ) use an implicit generative model and Dai et al . ( 2019 ) propose to use a sampler which is inspired by MCMC sampling from pθ ( x ) and whose entropy can be computed exactly . Below we describe our approach which utilizes the same objective with a simpler sampler and a new approach to encourage high entropy . We note that when training pθ ( x ) and q ( x ) online together , the inner maximization will not be fully optimized . This leads our training objective for pθ ( x ) to be an upper bound on log pθ ( x ) . In Section 5.1 we explore the impact of this fact and find that the bound is tight enough to train models that achieve high likelihood on high-dimensional data . 1For continuous spaces , this would be the differential entropy , but we simply use entropy here for brevity . 4 METHOD . We now present a method for training an EBM pθ ( x ) = efθ ( x ) /Z ( θ ) to optimize Equation 4 . We introduce a generator distribution of the form qφ ( x ) = ∫ z qφ ( x|z ) q ( z ) dz such that : qφ ( x|z ) = N ( gψ ( z ) , σ2I ) , q ( z ) = N ( 0 , I ) ( 5 ) where gψ is a neural network with parameters ψ and thus , φ = { ψ , σ2 } . This is similar to the decoder of a variational autoencoder ( Kingma & Welling , 2013 ) . With this architecture it is easy to optimize the first and second terms of Equation 4 with reparameterization , but the entropy term requires more care . 4.1 ENTROPY REGULARIZATION . Estimating entropy or its gradients is a challenging task . Multiple , distinct approaches have been proposed in recent years based on Mutual Information estimation ( Kumar et al. , 2019 ) , variational upper bounds ( Ranganath et al. , 2016 ) , Denoising Autoencoders ( Lim et al. , 2020 ) , and nearest neighbors ( Singh & Póczos , 2016 ) . The above methods require the training of additional auxiliary models or do not scale well to high dimensions . Most relevant to this work are Dieng et al . ( 2019 ) ; Titsias & Ruiz ( 2019 ) which present a method for encouraging generators such as ours to have high entropy by estimating∇φH ( qφ ) .The estimator takes the following form : ∇φH ( qφ ) = ∇φEqφ ( x ) [ log qφ ( x ) ] = ∇φEp ( z ) p ( ) [ log qφ ( x ( z , ) ) ] ( Reparameterize sampling ) = Ep ( z ) p ( ) [ ∇φ log qφ ( x ( z , ) ) ] = Ep ( z ) p ( ) [ ∇x log qφ ( x ( z , ) ) T∇φx ( z , ) ] ( Chain rule ) ( 6 ) where we have written x ( z , ) = gψ ( z ) + σ . All quantities in Equation 6 can be easily computed except for the score-function ∇x log qφ ( x ) . The following estimator for this quantity can be easily derived ( see Appendix A.2 ) : ∇x log qφ ( x ) = Eqφ ( z|x ) [ ∇x log qφ ( x|z ) ] ( 7 ) which requires samples from the posterior qφ ( z|x ) to estimate . Dieng et al . ( 2019 ) ; Titsias & Ruiz ( 2019 ) generate these samples using Hamiltonian Monte Carlo ( HMC ) ( Neal et al. , 2011 ) , a gradientbased MCMC algorithm . As used in Dieng et al . ( 2019 ) , 28 sequential gradient computations must be made per training iteration . Since a key motivation of this work is to circumvent the costly sequential computation of MCMC sampling , this is not a favourable solution . In our work we propose a more efficient solution that we find works just as well empirically .
This paper presents a method for improving training of energy-based models. Rather than drawing samples using persistent contrastive divergence / MCMC, this approach parameterizes a separate model, which is trained to directly output samples. This effectively adds an additional KL divergence to the objective. The authors use a particular form of sampling model (a latent Gaussian model), borrowing a few tricks for getting entropy estimates out of the model. Results are demonstrated on a few qualitative setups, but most of the results are centered on improved JEM on sample quality, out-of-distribution detection, and semi-supervised learning. The main benefit of the approach seems to be speed and stability, however, the authors also claim that minimal tuning is needed.
SP:80d95638850c9ff81a9b271d28a8aecf238497e6
Dynamic Feature Selection for Efficient and Interpretable Human Activity Recognition
1 INTRODUCTION . Acquiring predictive features is critical for building trustworthy machine learning systems , but this often comes at a daunting cost . Such a cost can be in the form of energy needed to maintain an ambient sensor ( Ardywibowo et al. , 2019 ; Yang et al. , 2020 ) , time needed to complete an experiment ( Kiefer , 1959 ) , or manpower required to monitor a hospital patient ( Pierskalla & Brailer , 1994 ) . Therefore , it becomes important not only to maintain good performance in the specified task , but also a low cost to gather these features . Indeed , existing Human Activity Recognition ( HAR ) methods typically use a fixed set of sensors , potentially collecting redundant features to discriminate contexts ( Shen & Varshney , 2013 ; Aziz et al. , 2016 ; Ertuǧrul & Kaya , 2017 ; Cheng et al. , 2018 ) . Classic feature selection methods such as the LASSO and its variants can address the performance-cost trade-off by optimizing an objective penalized by a term that helps promote feature sparsity ( Tibshirani , 1996 ; Friedman et al. , 2010 , 2008 ; Zou & Hastie , 2005 ) . Such feature selection formulations are often static , that is , a fixed set of features are selected a priori . However , different features may offer different predictive power under different contexts . For example , a health worker may not need to monitor a recovering patient as frequently compared to a patient with the declining condition ; an experiment performed twice may be redundant ; or a smartphone sensor may be predictive when the user is walking but not when the user is in a car . By adaptively selecting which sensor ( s ) to observe at any given time point , one can further reduce the inherent cost for prediction and achieve a better trade-off between cost and prediction accuracy . In addition to cost-efficiency , an adaptive feature selection formulation can also lead to more interpretable and trustworthy predictions . Specifically , the predictions made by the model are only based on the selected features , providing a clear relationship between input features and model predictions . Existing efforts on interpreting models are usually based on some post-analyses of the predictions , including the approaches in ( 1 ) visualizing higher level representations or reconstructions of inputs based on them ( Li et al. , 2016 ; Mahendran & Vedaldi , 2015 ) , ( 2 ) evaluating the sensitivity of predictions to local perturbations of inputs or the input gradients ( Selvaraju et al. , 2017 ; Ribeiro et al. , 2016 ) , and ( 3 ) extracting parts of inputs as justifications for predictions ( Lei et al. , 2016 ) . Another related but orthogonal direction is model compression of training sparse neural networks with the goal of memory and computational efficiency ( Louizos et al. , 2017 ; Tartaglione et al. , 2018 ; Han et al. , 2015 ) . All these works require collecting all features first and provide post-hoc feature relevance justifications or network pruning . Recent efforts on dynamic feature selection adaptively assign features based on immediate statistics ( Gordon et al. , 2012 ; Bloom et al. , 2013 ; Ardywibowo et al. , 2019 ; Zappi et al. , 2008 ) , ignoring the information a feature may have on future predictions . Others treat feature selection as a Markov Decision Process ( MDP ) and use Reinforcement Learning ( RL ) to solve it ( He & Eisner , 2012 ; Karayev et al. , 2013 ; Kolamunna et al. , 2016 ; Spaan & Lima , 2009 ; Satsangi et al. , 2015 ; Yang et al. , 2020 ) . However , solving the RL objective is not straightforward . Besides being sensitive to hyperparameter settings in general , approximations such as state space discretization and greedy approximations of the combinatorial objective were used to make the RL problem tractable . To this end , we propose a dynamic feature selection method that can be easily integrated into existing deep architectures and trained from end to end , enabling task-driven dynamic feature selection . To achieve this , we define a feature selection module that dynamically selects which features to use at any given time point . We then formulate a sequential combinatorial optimization that minimizes the trade-off between the learning task performance and the number of features selected at each time point . To make this problem tractable , we cast this combinatorial optimization problem into a stochastic optimization formulation . We then adopt a differentiable relaxation of the discrete feature selection variables to make it amenable to stochastic gradient descent based optimization . It therefore can be plugged-in and jointly optimized with state-of-the-art neural networks , achieving task-driven feature selection over time . To show our method ’ s ability to adaptively select features while maintaining good performance , we evaluate it on four time-series activity recognition datasets : the UCI Human Activity Recognition ( HAR ) dataset ( Anguita et al. , 2013 ) , the OPPORTUNITY dataset ( Roggen et al. , 2010 ) , the ExtraSensory dataset ( Vaizman et al. , 2017 ) , as well as the NTU-RGB-D dataset ( Shahroudy et al. , 2016 ) . Several ablation studies and comparisons with other dynamic and static feature selection methods demonstrate the efficacy of our proposed method . Specifically , our dynamic feature selection is able to use as low as 0.28 % of the sensor features while still maintaining good human activity monitoring accuracy . Moreover , our dynamically selected features are shown to be interpretable with direct correspondence with different contexts and activity types . 2 METHODOLOGY . 2.1 THE ` 0-NORM MINIMIZATION PROBLEM Many regularization methods have been developed to solve simultaneous feature selection and model parameter estimation ( Tibshirani , 1996 ; Zou & Hastie , 2005 ; Tibshirani , 1997 ; Sun et al. , 2014 ; Simon et al. , 2011 ) . The ideal penalty for the purpose of feature selection is the ` 0-norm of the model coefficients for all predictors . This norm is equivalent to the number of nonzero terms in all the model coefficients . Given a dataset D containing N independent and identically distributed ( iid ) input-output pairs { ( x1 , y1 ) , . . . , ( xN , yN ) } with each xi containing P features , a hypothesis class of predictor functions f ( · ; θ ) , and a loss function L ( ŷ , y ) between prediction ŷ and true output y , the ` 0-norm regularized optimization problem can be written as follows : min θ 1 N ( N∑ i=1 L ( f ( xi ; θ ) , yi ) ) + λ‖θ‖0 , ( 1 ) where ‖θ‖0 = ∑P j=1 I [ θj 6= 0 ] penalizes the number of nonzero model coefficients . In the models that linearly transform the input features xi , penalizing the weights relating to each feature in xi enables sparse feature subset selection . However , such a selection is static , as it does not adaptively select features that are appropriate for a given context . Moreover , the optimization above is computationally prohibitive as it involves combinatorial optimization to select the subset of nonzero model coefficients corresponding to the input features . In the following , we formulate our adaptive dynamic feature selection problem when learning with multivariate time series . Coupled with training recurrent neural networks , this adaptive feature selection problem is transformed into a sequential context-dependent feature subset selection problem , to which we devise a stochastic relaxation to make the problem tractable . 2.2 DYNAMIC FEATURE SELECTION VIA SEQUENTIAL CONTEXT-DEPENDENT FEATURE SUBSET SELECTION . Instead of finding a subset of nonzero model coefficients , an equivalent formulation can be derived by directly selecting the feature subset . Without loss of generality , let z be a binary vector that indicates whether each feature is selected or not . Then , the original ` 0-norm optimization formulation can be equivalently written as follows : min θ , z 1 N ( N∑ i=1 L ( f ( xi ◦ z ; θ ) , yi ) ) + λ‖z‖0 . ( 2 ) Compared to the original problem , the penalty on the number of selected features is through the ` 0-norm of z . This formulation is more flexible , as z can be made dependent on corresponding input features , output labels , or any contextual information , allowing us to formulate our dynamic feature selection problem when learning with multivariate time series data . Specifically , let the input-output pairs ( xi , yi ) be a pair of time series data of length Ti . At each time t , our model predicts the output yti , as well as the next feature set to select z t i . This optimization problem can be formulated as : min θ , z 1 N ( N∑ i=1 Ti∑ t=1 L ( f ( x0 : t−1i ◦ z 0 : t−1 i ; θ ) , y t i ) ) + λ N∑ i=1 Ti∑ t=1 ‖zti‖0 . ( 3 ) Here , we are tasked to find a set of parameters θ and feature sets zti for each sample i at each time point t to optimize the trade-off between model performance and the number of selected features . The model then uses the parameters and the previously observed features X ti , x 0 : t−1 i ◦ z 0 : t−1 i to infer the next output yti . However , the above formulation remains intractable , as it involves combinatorial optimization to select the feature subsets at each time point , in addition to the joint optimization of the model parameters and variable selection . Naively , one may also need to solve a separate optimization problem to find zti for each time point during the run time . In the following section , we derive a relaxation based on stochastic optimization parameterizing zti ’ s to make the above problem tractable . 2.3 RELAXATION THROUGH STOCHASTIC OPTIMIZATION . Instead of finding the exact feature subsets indexed by zti that achieve the optimal regularized objective , one can treat these zti ’ s as binary random variables and seek to optimize the distribution π ( z|φ ) that generates these random variables . For the ease of exposition , we first focus on the relaxation of the non-adaptive formulation in ( 1 ) as follows : min θ , φ E ( xi , yi ) ∼D [ Ez∼π ( z|φ ) [ L ( f ( xi ◦ z ; θ ) , yi ) + λ‖z‖0 ] ] . ( 4 ) Note that the solution to this problem is equivalent to the original one , as the original combinatorial problem can be recovered by setting π ( z|φ ) = Bern ( φ ) , a Bernoulli distribution parameterized by φ , and restricting φ ∈ { 0 , 1 } . Using this relaxation , the regularization term can now be evaluated analytically : Ez∼π ( z|φ ) [ ‖z‖0 ] = Ez∼Bern ( φ ) [ ‖z‖0 ] = P∑ j=1 π ( z|φ ) j = P∑ j=1 φj , ( 5 ) On the other hand , the outer expectation in ( 4 ) can be approximated using minibatches . Relaxation of binary random variables has been adopted in Louizos et al . ( 2017 ) for network architecture sparsification , and in Yamada et al . ( 2019 ) ; Balın et al . ( 2019 ) for static feature selection . Here , we extend the above relaxation for time series data , where unlike previous works , the binary random variables are parameterized locally and are context-dependent , and features are selected adaptively across time . We first note that our adaptive feature selection formulation in ( 3 ) allows each time point to have its own feature selection distribution πti ( z|φ ) , π ( z|X t−1 i , φ ) conditioned on previously selected observed features X t−1i as defined above . Let πi ( z|φ ) be the set of πti ( z|φ ) for all t ∈ { 1 , . . . , Ti } . The stochastic relaxation of the adaptive feature selection formulation can be written as follows : min θ , φ E ( xi , yi ) ∼D [ Ezi∼πi ( z|φ ) [ Ti∑ t=1 L ( f ( X t−1i ; θ ) , y t i ) ] + λ Ti∑ t=1 P∑ j=1 πti ( z|φ ) j ] . ( 6 )
This paper proposes an RNN model for adaptive dynamic feature selection, for efficient and interpretable human activity recognition (HAR). From the intuition that human activity can be predictable by using a small number of sensors, the paper introduces an l0-norm minimization problem with parameter regularization, and provide a logic on formulating a dynamic feature selection model with relaxations. The difficulty of the discrete optimization problem is solved by differentiable relaxation, which is known as Gumbel-Softmax reparameterization techniques. The formulation is naturally led to an RNN model that uses histories as input with an additional sigmoid unit for adaptive feature selection.
SP:06417327dae11b539a7e6087a8d792ccd729a74a
Dynamic Feature Selection for Efficient and Interpretable Human Activity Recognition
1 INTRODUCTION . Acquiring predictive features is critical for building trustworthy machine learning systems , but this often comes at a daunting cost . Such a cost can be in the form of energy needed to maintain an ambient sensor ( Ardywibowo et al. , 2019 ; Yang et al. , 2020 ) , time needed to complete an experiment ( Kiefer , 1959 ) , or manpower required to monitor a hospital patient ( Pierskalla & Brailer , 1994 ) . Therefore , it becomes important not only to maintain good performance in the specified task , but also a low cost to gather these features . Indeed , existing Human Activity Recognition ( HAR ) methods typically use a fixed set of sensors , potentially collecting redundant features to discriminate contexts ( Shen & Varshney , 2013 ; Aziz et al. , 2016 ; Ertuǧrul & Kaya , 2017 ; Cheng et al. , 2018 ) . Classic feature selection methods such as the LASSO and its variants can address the performance-cost trade-off by optimizing an objective penalized by a term that helps promote feature sparsity ( Tibshirani , 1996 ; Friedman et al. , 2010 , 2008 ; Zou & Hastie , 2005 ) . Such feature selection formulations are often static , that is , a fixed set of features are selected a priori . However , different features may offer different predictive power under different contexts . For example , a health worker may not need to monitor a recovering patient as frequently compared to a patient with the declining condition ; an experiment performed twice may be redundant ; or a smartphone sensor may be predictive when the user is walking but not when the user is in a car . By adaptively selecting which sensor ( s ) to observe at any given time point , one can further reduce the inherent cost for prediction and achieve a better trade-off between cost and prediction accuracy . In addition to cost-efficiency , an adaptive feature selection formulation can also lead to more interpretable and trustworthy predictions . Specifically , the predictions made by the model are only based on the selected features , providing a clear relationship between input features and model predictions . Existing efforts on interpreting models are usually based on some post-analyses of the predictions , including the approaches in ( 1 ) visualizing higher level representations or reconstructions of inputs based on them ( Li et al. , 2016 ; Mahendran & Vedaldi , 2015 ) , ( 2 ) evaluating the sensitivity of predictions to local perturbations of inputs or the input gradients ( Selvaraju et al. , 2017 ; Ribeiro et al. , 2016 ) , and ( 3 ) extracting parts of inputs as justifications for predictions ( Lei et al. , 2016 ) . Another related but orthogonal direction is model compression of training sparse neural networks with the goal of memory and computational efficiency ( Louizos et al. , 2017 ; Tartaglione et al. , 2018 ; Han et al. , 2015 ) . All these works require collecting all features first and provide post-hoc feature relevance justifications or network pruning . Recent efforts on dynamic feature selection adaptively assign features based on immediate statistics ( Gordon et al. , 2012 ; Bloom et al. , 2013 ; Ardywibowo et al. , 2019 ; Zappi et al. , 2008 ) , ignoring the information a feature may have on future predictions . Others treat feature selection as a Markov Decision Process ( MDP ) and use Reinforcement Learning ( RL ) to solve it ( He & Eisner , 2012 ; Karayev et al. , 2013 ; Kolamunna et al. , 2016 ; Spaan & Lima , 2009 ; Satsangi et al. , 2015 ; Yang et al. , 2020 ) . However , solving the RL objective is not straightforward . Besides being sensitive to hyperparameter settings in general , approximations such as state space discretization and greedy approximations of the combinatorial objective were used to make the RL problem tractable . To this end , we propose a dynamic feature selection method that can be easily integrated into existing deep architectures and trained from end to end , enabling task-driven dynamic feature selection . To achieve this , we define a feature selection module that dynamically selects which features to use at any given time point . We then formulate a sequential combinatorial optimization that minimizes the trade-off between the learning task performance and the number of features selected at each time point . To make this problem tractable , we cast this combinatorial optimization problem into a stochastic optimization formulation . We then adopt a differentiable relaxation of the discrete feature selection variables to make it amenable to stochastic gradient descent based optimization . It therefore can be plugged-in and jointly optimized with state-of-the-art neural networks , achieving task-driven feature selection over time . To show our method ’ s ability to adaptively select features while maintaining good performance , we evaluate it on four time-series activity recognition datasets : the UCI Human Activity Recognition ( HAR ) dataset ( Anguita et al. , 2013 ) , the OPPORTUNITY dataset ( Roggen et al. , 2010 ) , the ExtraSensory dataset ( Vaizman et al. , 2017 ) , as well as the NTU-RGB-D dataset ( Shahroudy et al. , 2016 ) . Several ablation studies and comparisons with other dynamic and static feature selection methods demonstrate the efficacy of our proposed method . Specifically , our dynamic feature selection is able to use as low as 0.28 % of the sensor features while still maintaining good human activity monitoring accuracy . Moreover , our dynamically selected features are shown to be interpretable with direct correspondence with different contexts and activity types . 2 METHODOLOGY . 2.1 THE ` 0-NORM MINIMIZATION PROBLEM Many regularization methods have been developed to solve simultaneous feature selection and model parameter estimation ( Tibshirani , 1996 ; Zou & Hastie , 2005 ; Tibshirani , 1997 ; Sun et al. , 2014 ; Simon et al. , 2011 ) . The ideal penalty for the purpose of feature selection is the ` 0-norm of the model coefficients for all predictors . This norm is equivalent to the number of nonzero terms in all the model coefficients . Given a dataset D containing N independent and identically distributed ( iid ) input-output pairs { ( x1 , y1 ) , . . . , ( xN , yN ) } with each xi containing P features , a hypothesis class of predictor functions f ( · ; θ ) , and a loss function L ( ŷ , y ) between prediction ŷ and true output y , the ` 0-norm regularized optimization problem can be written as follows : min θ 1 N ( N∑ i=1 L ( f ( xi ; θ ) , yi ) ) + λ‖θ‖0 , ( 1 ) where ‖θ‖0 = ∑P j=1 I [ θj 6= 0 ] penalizes the number of nonzero model coefficients . In the models that linearly transform the input features xi , penalizing the weights relating to each feature in xi enables sparse feature subset selection . However , such a selection is static , as it does not adaptively select features that are appropriate for a given context . Moreover , the optimization above is computationally prohibitive as it involves combinatorial optimization to select the subset of nonzero model coefficients corresponding to the input features . In the following , we formulate our adaptive dynamic feature selection problem when learning with multivariate time series . Coupled with training recurrent neural networks , this adaptive feature selection problem is transformed into a sequential context-dependent feature subset selection problem , to which we devise a stochastic relaxation to make the problem tractable . 2.2 DYNAMIC FEATURE SELECTION VIA SEQUENTIAL CONTEXT-DEPENDENT FEATURE SUBSET SELECTION . Instead of finding a subset of nonzero model coefficients , an equivalent formulation can be derived by directly selecting the feature subset . Without loss of generality , let z be a binary vector that indicates whether each feature is selected or not . Then , the original ` 0-norm optimization formulation can be equivalently written as follows : min θ , z 1 N ( N∑ i=1 L ( f ( xi ◦ z ; θ ) , yi ) ) + λ‖z‖0 . ( 2 ) Compared to the original problem , the penalty on the number of selected features is through the ` 0-norm of z . This formulation is more flexible , as z can be made dependent on corresponding input features , output labels , or any contextual information , allowing us to formulate our dynamic feature selection problem when learning with multivariate time series data . Specifically , let the input-output pairs ( xi , yi ) be a pair of time series data of length Ti . At each time t , our model predicts the output yti , as well as the next feature set to select z t i . This optimization problem can be formulated as : min θ , z 1 N ( N∑ i=1 Ti∑ t=1 L ( f ( x0 : t−1i ◦ z 0 : t−1 i ; θ ) , y t i ) ) + λ N∑ i=1 Ti∑ t=1 ‖zti‖0 . ( 3 ) Here , we are tasked to find a set of parameters θ and feature sets zti for each sample i at each time point t to optimize the trade-off between model performance and the number of selected features . The model then uses the parameters and the previously observed features X ti , x 0 : t−1 i ◦ z 0 : t−1 i to infer the next output yti . However , the above formulation remains intractable , as it involves combinatorial optimization to select the feature subsets at each time point , in addition to the joint optimization of the model parameters and variable selection . Naively , one may also need to solve a separate optimization problem to find zti for each time point during the run time . In the following section , we derive a relaxation based on stochastic optimization parameterizing zti ’ s to make the above problem tractable . 2.3 RELAXATION THROUGH STOCHASTIC OPTIMIZATION . Instead of finding the exact feature subsets indexed by zti that achieve the optimal regularized objective , one can treat these zti ’ s as binary random variables and seek to optimize the distribution π ( z|φ ) that generates these random variables . For the ease of exposition , we first focus on the relaxation of the non-adaptive formulation in ( 1 ) as follows : min θ , φ E ( xi , yi ) ∼D [ Ez∼π ( z|φ ) [ L ( f ( xi ◦ z ; θ ) , yi ) + λ‖z‖0 ] ] . ( 4 ) Note that the solution to this problem is equivalent to the original one , as the original combinatorial problem can be recovered by setting π ( z|φ ) = Bern ( φ ) , a Bernoulli distribution parameterized by φ , and restricting φ ∈ { 0 , 1 } . Using this relaxation , the regularization term can now be evaluated analytically : Ez∼π ( z|φ ) [ ‖z‖0 ] = Ez∼Bern ( φ ) [ ‖z‖0 ] = P∑ j=1 π ( z|φ ) j = P∑ j=1 φj , ( 5 ) On the other hand , the outer expectation in ( 4 ) can be approximated using minibatches . Relaxation of binary random variables has been adopted in Louizos et al . ( 2017 ) for network architecture sparsification , and in Yamada et al . ( 2019 ) ; Balın et al . ( 2019 ) for static feature selection . Here , we extend the above relaxation for time series data , where unlike previous works , the binary random variables are parameterized locally and are context-dependent , and features are selected adaptively across time . We first note that our adaptive feature selection formulation in ( 3 ) allows each time point to have its own feature selection distribution πti ( z|φ ) , π ( z|X t−1 i , φ ) conditioned on previously selected observed features X t−1i as defined above . Let πi ( z|φ ) be the set of πti ( z|φ ) for all t ∈ { 1 , . . . , Ti } . The stochastic relaxation of the adaptive feature selection formulation can be written as follows : min θ , φ E ( xi , yi ) ∼D [ Ezi∼πi ( z|φ ) [ Ti∑ t=1 L ( f ( X t−1i ; θ ) , y t i ) ] + λ Ti∑ t=1 P∑ j=1 πti ( z|φ ) j ] . ( 6 )
The authors provide a novel combination of known architectures to an important use case of reducing the density of required measurements in sensor-fusion based temporal multi-class inference tasks. This has implications in energy consumptions of wearable sensors. but could even generalise to measurement timings in clinical care to make the work of nurses more efficient, and reduce the stress caused by some medical procedures..
SP:06417327dae11b539a7e6087a8d792ccd729a74a
Evaluating Online Continual Learning with CALM
1 INTRODUCTION . Machines , like humans , can learn to perform multiple different tasks from feedback alone ( Caruana , 1997 ) . On the other hand , humans , but not machines , can benefit from settings in which tasks are presented repeatedly for multiple trials before switching to the next one ( Flesch et al. , 2018 ) , whereas machines require examples to be presented in a shuffled ( i.i.d ) order to learn effectively . Otherwise , they suffer from an effect known as “ catastrophic forgetting ” or “ catastrophic interference ” ( McCloskey & Cohen , 1989 ; Ratcliff , 1990 ) . While there has been a considerable amount of work focused on solving this problem , an endeavour that also goes by the name of ‘ Continual ’ , ‘ Incremental ’ or ‘ Life-long ’ Learning , a large part of it is evaluated on settings in which there is an explicit delimitation signal for every new task presented to the model ( Kirkpatrick et al. , 2017 ; Zenke et al. , 2017 ; Sodhani et al. , 2018 ; Serra et al. , 2018 ; Lopez-Paz & Ranzato , 2017 ; Fernando et al. , 2017 ; Lee et al. , 2017 ; Rusu et al. , 2016 ; Li & Hoiem , 2018 ; Aljundi et al. , 2017 ; Adel et al. , 2020 ; Titsias et al. , 2020 ; Ebrahimi et al. , 2020 ; von Oswald et al. , 2020 ; Li et al. , 2020 ; Yoon et al. , 2020 ) . However , humans do not need any such signalling at all . Consider , for example , the case of a child growing up in a multi-lingual environment . Even though it is not entirely clear whether the child would rely on environmental cues ( for instance , the identity of the speaker ) to distinguish different input languages or not ( De Houwer , 2017 ) , any mechanism must be necessarily inferred from the context . Moreover , even the concept of “ task ” could be vacuous , as it could be represented by shifting data distributions ( Lesort et al. , 2020 ) . Even though the emerging field of Online Continual Learning ( Parisi & Lomonaco , 2020 ; Aljundi et al. , 2019a ) or Task-Free Continual Learning ( Aljundi et al. , 2019b ; Lee et al. , 2020 ) has started to propose solutions to these problems , commonly available benchmarks make assumptions that are far from the real world conditions , such as lacking latent similarity structure on the data stream ( e.g . orthogonal permutations of an image pixels ) or assuming temporal independence between different examples ( e.g . an image of a chair can be classified as “ chair ” independently of any previous examples ) . Consider , instead , the challenge of natural language learning which requires making sense of a highly correlated and temporally interdependent data stream . We argue that the notable scarcity of benchmarks featuring temporally correlated sequences of examples , with short and long-term dependencies , latent similarities between different classes of examples , and no explicit delimitation when transitioning between different classes has left a blind spot in the Online Continual Learning community , which we address here . Moreover , almost none of the commonly used benchmarks deals with language , further limiting the amount of research that extends to this modality . Here , we make a two-fold contribution towards studying online continual learning in neural networks in a linguistic setting . First , we bring CALM ( Class-Agnostic Continual Language Modelling ) to the community , a continual language modelling evaluation framework containing text that alternates between different classes of input ( e.g . different languages or domains ) with latent similarities to which the models could adapt . We introduce two variants . The first is a characterbased language modelling benchmark featuring five different languages that randomly switch between one another . The second one is a word-based language modelling task , where the text alternates between four different domains . No segmentation signal is given when a switch happens , thus requiring models to learn to adapt to these changes . We also propose novel metrics that capture the impact of catastrophic forgetting in an online learning setting by measuring how efficiently can models adapt to class switches . In line with Aljundi et al . ( 2019b ) , we note that when a distribution shift occurs , a neural network that suffers from catastrophic forgetting will display a spike in the loss signal , even when the distribution had been observed in the past ( see Figure 1a ) . Thus , we propose catastrophic forgetting metrics based on characterizing the size of these peaks . The benchmark is provided as a Python library that can be easily imported into a PyTorch project.1 Second , we evaluate multiple baselines based on expert architectures and propose a novel albeit simple mechanism that we call plastic gates , which we show to improve the performance of Products of Experts . Our post-hoc analysis shows that this mechanism is effective in producing a gating strategy that helps to circumvent catastrophic interference while also uncovering latent similarities in the input classes . 2 RELATED WORK . The field of Continual Learning , Incremental Learning or Lifelong Learning has grown to encompass a large body of work , which is better summarized in respective reviews ( Parisi et al. , 2019 ; Lesort et al. , 2020 ) . An overwhelming majority of this work concerns image classification problems or object recognition . Some evaluation datasets are derived from traditional machine learning datasets by manipulating the input examples in more or less artificial ways –like Permuted MNIST ( Kirkpatrick et al. , 2017 ) or Rotated MNIST ( Lopez-Paz & Ranzato , 2017 ) – while others keep examples unchanged but present them in a specific non-i.i.d . order , like for instance , iCIFAR100 ( Rebuffi et al. , 2017 ) or split-MNIST ( Zenke et al. , 2017 ) . All of these datasets comprise single-input classification problems in which there are no temporal dependencies nor correlations between two consecutive examples . To better approximate the conditions of real-world experiences , Fanello et al . ( 2013 ) , Lomonaco & Maltoni ( 2017 ) and Roady et al . ( 2020 ) introduced iCubWorld , CORe50 , and Stream-51 respectively , which comprise short videos of objects from different angles ( further including naturalistic scenes in the latter case ) . These datasets address the problem of correlated examples , but not of temporal dependencies , which we do address in this work . Li et al . ( 2020 ) and de Masson d ’ Autume et al . ( 2019 ) proposed the only benchmarks dealing with language that we know of , in which the former adopts a sequence to sequence paradigm to study incremental learning of new vocabulary items on simplified or artificial datasets , while the latter adapted existing text classification and QA benchmarks analogously to above-mentioned work in image classification . Our work instead uses naturalistic textual data containing natural latent similarities between distributions that can drive information transfer or forgetting . By and large , work directed to address catastrophic forgetting in neural networks presumes the existence of a task identifier to signal different learning units . However , recent work has aimed at tackling catastrophic forgetting even in conditions in which no task boundaries are provided ( Aljundi et al. , 2019b ; Lee et al. , 2020 ) , going under the name of “ Task-Free Continual Learning ” or “ Online Continual Learning ” ( Parisi & Lomonaco , 2020 ; Aljundi et al. , 2019a ) . Of these works , only Aljundi et al . ( 2019b ) uses naturalistic data to classify actors appearing in soap-opera episodes ( Aljundi et al. , 2016 ) , while others resort to artificially modified datasets like split or permuted MNIST . Here , we complement this resource with a text-based benchmark for Task-Free Continual Learning , while arguing for more work on more naturalistic non-i.i.d . datasets . Another aspect of Continual Learning deals with how models are evaluated . Most often , this is done by measuring accuracy on a dedicated test set ( Lopez-Paz & Ranzato , 2017 ; Díaz-Rodríguez et al. , 2018 ; Hayes et al. , 2018 ; Chaudhry et al. , 2018 ; de Masson d ’ Autume et al. , 2019 ) . However this 1Code and materials included in the supplementary materials will be made publicly available upon acceptance . evaluation protocol is tailored for batch learning conditions , in which a model is fit to a training dataset , and then stops learning . Here , instead , we argue in favour of situated evaluation protocols adapted to far-from-equilibrium learning conditions ( Holland , 1992 ) by adopting an Online Learning framework ( Hoi et al. , 2018 ) , which is also known as the prequential approach ( Dawid , 1984 ; Gama et al. , 2013 ) . On the modelling side , this work explores Mixture of Experts ( Jacobs et al. , 1991 ) and Product of Experts ( Hinton , 1999 ) architectures . Variations thereof are at the base of many architectural proposals for addressing catastrophic forgetting ( Rusu et al. , 2016 ; Li & Hoiem , 2018 ; Aljundi et al. , 2017 ; Lee et al. , 2020 ) . However , often they are accompanied by other mechanisms , such as the growth of new modules , freezing of weights or generative modelling of the input . Here we examine the simplest enactments of these architectures and propose an easy-to-implement gating mechanism which can be learned online and provides a strong baseline for more complex architectures . Finally , our study falls within the line of language modelling using neural network models ( Bengio et al. , 2003 ; Mikolov et al. , 2010 ) . In this context , adaptation to the recent past has been studied in the context of cache models ( Grave et al. , 2017 ; Merity et al. , 2017 ) . There , a non-parametric model deals with capturing high-frequency recent statistics while a parametric model captures the more stable aspects of the distribution . These solutions , however , are not well-adapted for cases in which the whole distribution changes over time . Moreover , language modelling is generally studied in a train-test split , where a model is fitted to the training data and asked to generalize over the unseen test data . Here , instead , we study how a model can adapt to incoming data in an online fashion . 3 THE CALM BENCHMARK . We designed a benchmark for evaluating Online Continual Learning algorithms having in mind the following three desiderata : 1 ) naturally correlated sequential data , 2 ) task agnosticism and 3 ) temporally situated evaluation . Parisi & Lomonaco ( 2020 ) discusses the first two . The first requires that on the one hand , data is observed in a potentially infinite data stream with high-dimensional , non-stationary , and temporally correlated examples . The second , that learning systems should not be fed external task boundaries to help them learn in these conditions . Furthermore , we also introduce a third desideratum , by which we ask models to be evaluated in-situ on each example presented to the model , following the classical Online Learning setting ( Hoi et al. , 2018 ; Sahoo et al. , 2018 ) . We thus propose an Online Continual Learning benchmark featuring a language modelling objective where the data stream can switch between different distributions . Because switches are not announced to the model , this is a “ Single-Incremental-Task “ or “ No task label ” scenario under the framework proposed by Lesort et al . ( 2020 ) . More precisely , consider a sequence of observations xt ∈ X that are fed to a model M parametrized by Θt , which makes the prediction ŷt ∈ Y . Then , the true target yt ∈ Y will be revealed and the loss Lt = L ( ŷt , yt ) is observed and later used to compute the model ’ s performance from a given time S until time T as the average loss in that span L̄TS = 1 T−S ∑T t=S Lt for evaluation purposes . Only after reporting the loss can the model be trained based on the received feedback , preventing data leakage . In practice , these examples are presented as mini-batches ( Xt , Yt ) ∈ X b×w × Yb×w containing b parallel streams , and chunked into small windows of length w for efficiency considerations related to the training of neural networks ( Parisi & Lomonaco , 2020 ) . The data stream is composed of N sequences of consecutive mini-batches of length T1 , T2 , . . . , TN , and starting at positions Si = ∑i−1 j=1 Tj . In turn , each of these sequences belong to one of n different classes [ D1 , . . . , Dn ] , presented in random order . To characterize the effect of forgetting we note that a model that becomes disadapted to a given distribution will display a spike in the loss after the stream switches to this distribution , even if it has been observed before ( see Figure 1a ) . For a model to be resilient to catastrophic forgetting , it must adapt quickly to every new distribution , which can be characterized by the height and width of these peaks . We thus propose the following metrics to complement the standard online performance : • Loss after switch : Tracks the loss for the first k times-steps after a switch occurs to quantify the height of the peak . Formally , L @ sw = 1N ∑N i=1 L̄ Si+k Si • Recovery time after switch : Counts the number of time-steps that it takes the model to reach the mean loss observed for the last seen sequence of the current class . In this way , we can quantify the length of the peak .
This paper’s main contributions are (i) to propose two new benchmarks for online continual learning in the context of language modelling and (ii) evaluate the performance of a number of composition-of-experts-based models on the new datasets using a number of metrics. The multilingual benchmark, derived from an existing multilingual news corpus, consists of sequences of characters where the language is periodically switched, and the MultiDomain benchmark consists of sequences of English words where the corpus is periodically switched. The comparative performances of the various baselines on the two datasets, as well as an analysis of the mixture weights in one of the models during training, are used to provide insights into the qualitative differences between the datasets.
SP:2dbd99bd7ef55248d5d6fcca7ae2866218173949
Evaluating Online Continual Learning with CALM
1 INTRODUCTION . Machines , like humans , can learn to perform multiple different tasks from feedback alone ( Caruana , 1997 ) . On the other hand , humans , but not machines , can benefit from settings in which tasks are presented repeatedly for multiple trials before switching to the next one ( Flesch et al. , 2018 ) , whereas machines require examples to be presented in a shuffled ( i.i.d ) order to learn effectively . Otherwise , they suffer from an effect known as “ catastrophic forgetting ” or “ catastrophic interference ” ( McCloskey & Cohen , 1989 ; Ratcliff , 1990 ) . While there has been a considerable amount of work focused on solving this problem , an endeavour that also goes by the name of ‘ Continual ’ , ‘ Incremental ’ or ‘ Life-long ’ Learning , a large part of it is evaluated on settings in which there is an explicit delimitation signal for every new task presented to the model ( Kirkpatrick et al. , 2017 ; Zenke et al. , 2017 ; Sodhani et al. , 2018 ; Serra et al. , 2018 ; Lopez-Paz & Ranzato , 2017 ; Fernando et al. , 2017 ; Lee et al. , 2017 ; Rusu et al. , 2016 ; Li & Hoiem , 2018 ; Aljundi et al. , 2017 ; Adel et al. , 2020 ; Titsias et al. , 2020 ; Ebrahimi et al. , 2020 ; von Oswald et al. , 2020 ; Li et al. , 2020 ; Yoon et al. , 2020 ) . However , humans do not need any such signalling at all . Consider , for example , the case of a child growing up in a multi-lingual environment . Even though it is not entirely clear whether the child would rely on environmental cues ( for instance , the identity of the speaker ) to distinguish different input languages or not ( De Houwer , 2017 ) , any mechanism must be necessarily inferred from the context . Moreover , even the concept of “ task ” could be vacuous , as it could be represented by shifting data distributions ( Lesort et al. , 2020 ) . Even though the emerging field of Online Continual Learning ( Parisi & Lomonaco , 2020 ; Aljundi et al. , 2019a ) or Task-Free Continual Learning ( Aljundi et al. , 2019b ; Lee et al. , 2020 ) has started to propose solutions to these problems , commonly available benchmarks make assumptions that are far from the real world conditions , such as lacking latent similarity structure on the data stream ( e.g . orthogonal permutations of an image pixels ) or assuming temporal independence between different examples ( e.g . an image of a chair can be classified as “ chair ” independently of any previous examples ) . Consider , instead , the challenge of natural language learning which requires making sense of a highly correlated and temporally interdependent data stream . We argue that the notable scarcity of benchmarks featuring temporally correlated sequences of examples , with short and long-term dependencies , latent similarities between different classes of examples , and no explicit delimitation when transitioning between different classes has left a blind spot in the Online Continual Learning community , which we address here . Moreover , almost none of the commonly used benchmarks deals with language , further limiting the amount of research that extends to this modality . Here , we make a two-fold contribution towards studying online continual learning in neural networks in a linguistic setting . First , we bring CALM ( Class-Agnostic Continual Language Modelling ) to the community , a continual language modelling evaluation framework containing text that alternates between different classes of input ( e.g . different languages or domains ) with latent similarities to which the models could adapt . We introduce two variants . The first is a characterbased language modelling benchmark featuring five different languages that randomly switch between one another . The second one is a word-based language modelling task , where the text alternates between four different domains . No segmentation signal is given when a switch happens , thus requiring models to learn to adapt to these changes . We also propose novel metrics that capture the impact of catastrophic forgetting in an online learning setting by measuring how efficiently can models adapt to class switches . In line with Aljundi et al . ( 2019b ) , we note that when a distribution shift occurs , a neural network that suffers from catastrophic forgetting will display a spike in the loss signal , even when the distribution had been observed in the past ( see Figure 1a ) . Thus , we propose catastrophic forgetting metrics based on characterizing the size of these peaks . The benchmark is provided as a Python library that can be easily imported into a PyTorch project.1 Second , we evaluate multiple baselines based on expert architectures and propose a novel albeit simple mechanism that we call plastic gates , which we show to improve the performance of Products of Experts . Our post-hoc analysis shows that this mechanism is effective in producing a gating strategy that helps to circumvent catastrophic interference while also uncovering latent similarities in the input classes . 2 RELATED WORK . The field of Continual Learning , Incremental Learning or Lifelong Learning has grown to encompass a large body of work , which is better summarized in respective reviews ( Parisi et al. , 2019 ; Lesort et al. , 2020 ) . An overwhelming majority of this work concerns image classification problems or object recognition . Some evaluation datasets are derived from traditional machine learning datasets by manipulating the input examples in more or less artificial ways –like Permuted MNIST ( Kirkpatrick et al. , 2017 ) or Rotated MNIST ( Lopez-Paz & Ranzato , 2017 ) – while others keep examples unchanged but present them in a specific non-i.i.d . order , like for instance , iCIFAR100 ( Rebuffi et al. , 2017 ) or split-MNIST ( Zenke et al. , 2017 ) . All of these datasets comprise single-input classification problems in which there are no temporal dependencies nor correlations between two consecutive examples . To better approximate the conditions of real-world experiences , Fanello et al . ( 2013 ) , Lomonaco & Maltoni ( 2017 ) and Roady et al . ( 2020 ) introduced iCubWorld , CORe50 , and Stream-51 respectively , which comprise short videos of objects from different angles ( further including naturalistic scenes in the latter case ) . These datasets address the problem of correlated examples , but not of temporal dependencies , which we do address in this work . Li et al . ( 2020 ) and de Masson d ’ Autume et al . ( 2019 ) proposed the only benchmarks dealing with language that we know of , in which the former adopts a sequence to sequence paradigm to study incremental learning of new vocabulary items on simplified or artificial datasets , while the latter adapted existing text classification and QA benchmarks analogously to above-mentioned work in image classification . Our work instead uses naturalistic textual data containing natural latent similarities between distributions that can drive information transfer or forgetting . By and large , work directed to address catastrophic forgetting in neural networks presumes the existence of a task identifier to signal different learning units . However , recent work has aimed at tackling catastrophic forgetting even in conditions in which no task boundaries are provided ( Aljundi et al. , 2019b ; Lee et al. , 2020 ) , going under the name of “ Task-Free Continual Learning ” or “ Online Continual Learning ” ( Parisi & Lomonaco , 2020 ; Aljundi et al. , 2019a ) . Of these works , only Aljundi et al . ( 2019b ) uses naturalistic data to classify actors appearing in soap-opera episodes ( Aljundi et al. , 2016 ) , while others resort to artificially modified datasets like split or permuted MNIST . Here , we complement this resource with a text-based benchmark for Task-Free Continual Learning , while arguing for more work on more naturalistic non-i.i.d . datasets . Another aspect of Continual Learning deals with how models are evaluated . Most often , this is done by measuring accuracy on a dedicated test set ( Lopez-Paz & Ranzato , 2017 ; Díaz-Rodríguez et al. , 2018 ; Hayes et al. , 2018 ; Chaudhry et al. , 2018 ; de Masson d ’ Autume et al. , 2019 ) . However this 1Code and materials included in the supplementary materials will be made publicly available upon acceptance . evaluation protocol is tailored for batch learning conditions , in which a model is fit to a training dataset , and then stops learning . Here , instead , we argue in favour of situated evaluation protocols adapted to far-from-equilibrium learning conditions ( Holland , 1992 ) by adopting an Online Learning framework ( Hoi et al. , 2018 ) , which is also known as the prequential approach ( Dawid , 1984 ; Gama et al. , 2013 ) . On the modelling side , this work explores Mixture of Experts ( Jacobs et al. , 1991 ) and Product of Experts ( Hinton , 1999 ) architectures . Variations thereof are at the base of many architectural proposals for addressing catastrophic forgetting ( Rusu et al. , 2016 ; Li & Hoiem , 2018 ; Aljundi et al. , 2017 ; Lee et al. , 2020 ) . However , often they are accompanied by other mechanisms , such as the growth of new modules , freezing of weights or generative modelling of the input . Here we examine the simplest enactments of these architectures and propose an easy-to-implement gating mechanism which can be learned online and provides a strong baseline for more complex architectures . Finally , our study falls within the line of language modelling using neural network models ( Bengio et al. , 2003 ; Mikolov et al. , 2010 ) . In this context , adaptation to the recent past has been studied in the context of cache models ( Grave et al. , 2017 ; Merity et al. , 2017 ) . There , a non-parametric model deals with capturing high-frequency recent statistics while a parametric model captures the more stable aspects of the distribution . These solutions , however , are not well-adapted for cases in which the whole distribution changes over time . Moreover , language modelling is generally studied in a train-test split , where a model is fitted to the training data and asked to generalize over the unseen test data . Here , instead , we study how a model can adapt to incoming data in an online fashion . 3 THE CALM BENCHMARK . We designed a benchmark for evaluating Online Continual Learning algorithms having in mind the following three desiderata : 1 ) naturally correlated sequential data , 2 ) task agnosticism and 3 ) temporally situated evaluation . Parisi & Lomonaco ( 2020 ) discusses the first two . The first requires that on the one hand , data is observed in a potentially infinite data stream with high-dimensional , non-stationary , and temporally correlated examples . The second , that learning systems should not be fed external task boundaries to help them learn in these conditions . Furthermore , we also introduce a third desideratum , by which we ask models to be evaluated in-situ on each example presented to the model , following the classical Online Learning setting ( Hoi et al. , 2018 ; Sahoo et al. , 2018 ) . We thus propose an Online Continual Learning benchmark featuring a language modelling objective where the data stream can switch between different distributions . Because switches are not announced to the model , this is a “ Single-Incremental-Task “ or “ No task label ” scenario under the framework proposed by Lesort et al . ( 2020 ) . More precisely , consider a sequence of observations xt ∈ X that are fed to a model M parametrized by Θt , which makes the prediction ŷt ∈ Y . Then , the true target yt ∈ Y will be revealed and the loss Lt = L ( ŷt , yt ) is observed and later used to compute the model ’ s performance from a given time S until time T as the average loss in that span L̄TS = 1 T−S ∑T t=S Lt for evaluation purposes . Only after reporting the loss can the model be trained based on the received feedback , preventing data leakage . In practice , these examples are presented as mini-batches ( Xt , Yt ) ∈ X b×w × Yb×w containing b parallel streams , and chunked into small windows of length w for efficiency considerations related to the training of neural networks ( Parisi & Lomonaco , 2020 ) . The data stream is composed of N sequences of consecutive mini-batches of length T1 , T2 , . . . , TN , and starting at positions Si = ∑i−1 j=1 Tj . In turn , each of these sequences belong to one of n different classes [ D1 , . . . , Dn ] , presented in random order . To characterize the effect of forgetting we note that a model that becomes disadapted to a given distribution will display a spike in the loss after the stream switches to this distribution , even if it has been observed before ( see Figure 1a ) . For a model to be resilient to catastrophic forgetting , it must adapt quickly to every new distribution , which can be characterized by the height and width of these peaks . We thus propose the following metrics to complement the standard online performance : • Loss after switch : Tracks the loss for the first k times-steps after a switch occurs to quantify the height of the peak . Formally , L @ sw = 1N ∑N i=1 L̄ Si+k Si • Recovery time after switch : Counts the number of time-steps that it takes the model to reach the mean loss observed for the last seen sequence of the current class . In this way , we can quantify the length of the peak .
The paper proposes two benchmarks for continual language modeling: one evaluating character-level multilingual drift between languages which share similar characters and second evaluating word-level drift between English corpora of different domains. The setup is online in the sense of evaluation: they evaluate on the new sentences and then train over them (unlike image datasets), and catastrophic forgetting is hence characterised as having higher error than was in the past when there is a switch between the domains/languages. Hence, the loss functions measuring forgetting quantify the height and length of the rise in error. They compare a mixture of expert baselines with gating by different gating methods on this setup.
SP:2dbd99bd7ef55248d5d6fcca7ae2866218173949
Luring of transferable adversarial perturbations in the black-box paradigm
1 INTRODUCTION . Neural networks based systems have been shown to be vulnerable to adversarial examples ( Szegedy et al. , 2014 ) , i.e . maliciously modified inputs that fool a model at inference time . Many directions have been explored to explain and characterize this phenomenon ( Schmidt et al. , 2018 ; Ford et al. , 2019 ; Ilyas et al. , 2019 ; Shafahi et al. , 2019 ) that became a growing concern and a major brake on the deployment of Machine Learning ( ML ) models . In response , many defenses have been proposed to protect the integrity of ML systems , predominantly focused on an adversary in the white-box setting ( Madry et al. , 2018 ; Zhang et al. , 2019 ; Cohen et al. , 2019 ; Hendrycks et al. , 2019 ; Carmon et al. , 2019 ) . In this work , we design an innovative way to limit the transferability of adversarial perturbation towards a model , opening a new direction for robustness in the realistic black-box setting ( Papernot et al. , 2017 ) . As ML-based online API are likely to become increasingly widespread , and regarding the massive deployment of edge models in a large variety of devices , several instances of a model may be deployed in systems with different environment and security properties . Thus , the black-box paradigm needs to be extensively studied to efficiently protect systems in many critical domains . Considering a target model M that a defender aims at protecting against adversarial examples , we propose a method which allows to build the model T , an augmented version of M , such that adversarial examples do not transfer from T to M . Importantly , training T only requires to have access to M , meaning that no labeled data set is required , so that our approach can be implemented at a low cost for any already trained model . T is built by augmenting M with an additional component P ( with T = M ◦ P ) taking the form of a neural network trained with a specific loss function with logit-based constraints . From the observation that transferability of adversarial perturbations between two models occurs because they rely on similar non-robust features ( Ilyas et al. , 2019 ) , we design P such that ( 1 ) the augmented network exploits useful features of M and that ( 2 ) non-robust features of T and M are either different or require different perturbations to reach misclassification towards the same class . Our deception-based method is conceptually new as it does not aim at making M relying more on robust-features as with proactive schemes ( Madry et al. , 2018 ; Zhang et al. , 2019 ) , nor tries to anticipate perturbations which directly target the non-robust features ofM as with reactive strategies ( Meng & Chen , 2017 ; Hwang et al. , 2019 ) . Our contributions are as follows : • We present an innovative approach to thwart transferability between two models , which we name the luring effect . This phenomenon , as conceptually novel , opens a new direction for adversarial research . • We propose an implementation of the luring effect which fits any pre-trained model and does not require a label data set . An additional neural network is pasted to the target model and trained with a specific loss function that acts on the logits sequence order . • We experimentally characterize the luring effect and discuss its potentiality for black-box defense strategies on MNIST , SVHN and CIFAR10 , and analyze the scalability on ImageNet ( ILSVRC2012 ) . For reproducibility purposes , the code is available at https : //anonymous.4open . science/r/3c64e745-927d-4f51-b187-583e64586ff6/ . 2 LURING ADVERSARIAL PERTURBATIONS . 2.1 NOTATIONS . We consider a classification task where input-label pairs ( x , y ) ∈ X × Y are sampled from a distribution D. |Y| = C is the cardinality of the labels space . A neural network model Mφ : X → Y , with parameters φ , classifies an input x ∈ X to a label M ( x ) ∈ Y . The pre-softmax output function of Mφ ( the logits ) is denoted as hM : X → RC . For the sake of readability , the model Mφ is simply noted as M , except when necessary . 2.2 CONTEXT : ADVERSARIAL EXAMPLES IN THE BLACK-BOX SETTING . Black-box settings are realistic use-cases since many models are deployed ( in the cloud or embedded in mobile devices ) within secure environments and accessible through open or restrictive API . Contrary to the white-box paradigm where the adversary is allowed to use existing gradient-based attacks ( Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ; Chen et al. , 2018 ; Dong et al. , 2018 ; Madry et al. , 2018 ; Wang et al. , 2019 ) , an attacker in a black-box setting only accesses the output label , confidence scores or logits from the target model . He can still take advantage of gradient-free methods ( Uesato et al. , 2018 ; Guo et al. , 2019 ; Su et al. , 2019 ; Brendel et al. , 2018 ; Ilyas et al. , 2018 ; Chen et al. , 2020 ) but , practically , the number of queries requires to mount the attack is prohibitive and may be flagged as suspicious ( Chen et al. , 2019 ; Li et al. , 2020 ) . In that case , the adversary may take advantage of the transferability property ( Papernot et al. , 2017 ) by crafting adversarial examples on a substitute model and then transfering them to the target model . 2.3 OBJECTIVES AND DESIGN . Our objective is to find a novel way to make models more robust against transferable black-box adversarial perturbation without expensive ( and sometimes prohibitive ) training cost required by many white-box defense methods . Our main idea is based on classical deception-based approaches for network security ( e.g . honeypots ) and can be summarized as follow : rather than try to prevent an attack , let ’ s fool the attacker . Our approach relies on a network P : X → X , pasted to the already trained target network M before the input layer , such as the resulting augmented model will answer T ( x ) = M ◦ P ( x ) when fed with input x . The additional component P is designed and trained to reach a twofold objective : • Prediction neutrality : adding P does not alter the decision for a clean example x , i.e . T ( x ) = M ◦ P ( x ) = M ( x ) ; • Adversarial luring : according to an adversarial example x′ crafted to fool T , M does not output the same label as T ( i.e . M ◦P ( x′ ) 6= M ( x′ ) ) and , in the best case , x′ is inefficient ( i.e . M ( x′ ) = y ) . To explain the intuition of our method , we follow the feature-based framework proposed in Ilyas et al . ( 2019 ) where a feature f is a function from X to R , that M has learned to perform its predictions . Considering a binary classification task , f is said to be ρ-useful ( ρ > 0 ) if it satisfies Equation 1a and is γ-useful robust if under the worst perturbation δ chosen in a predefined set of allowed perturbations ∆ , f stays γ-useful under this perturbation ( Equation 1b ) . A ρ-useful feature f is said to be a non-robust feature if f is not robust for any γ ≥ 0 . ( a ) E ( x , y ) ∼D [ y · f ( x ) ] > ρ ( b ) E ( x , y ) ∼D [ inf δ∈∆ y · f ( x+ δ ) ] > γ ( 1 ) An adversary which aims at fooling a model will thus perform perturbations to the inputs to influence the useful features which are not robust with respect to the perturbation he is allowed to apply . We denote F∗M the set of ρ-useful features learned by M . We consider a set of allowed perturbations ∆ and γ > 0 such that we note F∗ , RM and F ∗ , NR M respectively the set of γ-robust and non-robust features learned by M ( relatively to ∆ ) . An adversary that aims at fooling M ◦P will alter function compositions of the form f ◦ P with f ∈ F∗M . These function compositions are the non-robust useful features of M ◦ P , whose set is denoted F∗ , NRM◦P . Based on the observations that transferability of adversarial perturbations between two models occurs because these models rely on similar non-robust features ( Ilyas et al. , 2019 ) , we consider f ◦ P ∈ F∗ , NRM◦P , and we derive two possibilities which ensure the lowest transferability between M ◦ P and M , regarding the robustness of f . If f is robust , f ∈ F∗ , RM , that means the adversarial perturbations from ∆ is sufficient to flip the augmented feature f ◦ P but is not efficient to directly impact f . This case is the optimal one , since the adversarial example is unsuccessful on the target model ( M ◦P ( x′ ) 6= y and M ( x′ ) = y ) . On the other hand , if f ∈ F∗ , NRM ( i.e . both f and f ◦ P are non-robust ) , restraining the transferability means that the additional model P impacts the way useful features vary with respect to input alterations so that the adversarial perturbation lead to two different labels . We encompass these two cases ( illustrated in Figure 1 ) within what we name the luring effect . The adversary is tricked into modifying input values in some way to flip useful and non-robust features of M ◦ P and these modifications are either without effect on the useful features of M , or flip the non-robust features of M in a different way ( and therefore are detectable , as presented in Section 4 ) . 2.4 TRAINING THE LURING COMPONENT . To reach our two objectives ( prediction neutrality and adversarial luring ) , we propose to train P with constraints based on the predicted labels order . For x ∈ X , let α and β be the labels corresponding respectively to the first and second highest confidence score given to x byM . The training of P is achieved with a new loss function that constraints α to ( still ) be the first class predicted by M ◦P ( prediction neutrality ) and that makes the logits gap between α and β the highest as possible for M ◦ P ( adversarial luring ) . To understand the intuition behind this loss function , let ’ s formalize the concepts learned by M and M ◦ P . The prediction given by M corresponds to ” class α is predicted , class β is the second possible class ” . Once P has been trained following this loss function , the prediction given byM ◦P corresponds to ” class α is predicted , the higher confidence given to class α , the smaller confidence given to class β ” . Concepts learned byM andM ◦P share the same goal of prediction , i.e . ” class α ” is predicted , but the relation between class α and class β is forced to be the most different as possible . As learned concepts are essentially different , then useful features learned by M and M ◦P to reach these concepts are necessarily different , and consequently display different types of sensitivity to the same input pixel modifications . In other words , as the direction of confidence towards classes is forced to be structurally different for M ◦ P and M , we hypothesize that useful features of the two classifiers should be different and behave differently to adversarial perturbations . The luring loss , designed to induce this behavior , is given in Equation 2 and the complete training procedure is detailed in Algorithm 1 . The parameters of P are denoted by θ , x ∈ X is an input and M is the target model . M has already been trained and its parameters are frozen during the process . hM ( x ) and hM◦P ( x ) denote respectively the logits of M and M ◦ P for input x. hMi ( x ) and hM◦Pi ( x ) correspond respectively to the values of h M ( x ) and hM◦P ( x ) for class i . The classes a and b correspond to the second maximum value of hM and hM◦P respectively . L ( x , M ( x ) ) =− λ ( hM◦PM ( x ) ( x ) − h M◦P a ( x ) ) +max ( 0 , hM◦Pb ( x ) − h M◦P M ( x ) ( x ) ) ( 2 ) The first term of Equation 2 optimizes the gap between the logits of M ◦ P corresponding to the first and second biggest unscaled confidence score ( logits ) given by M ( i.e . M ( x ) and a ) . This part formalizes the goal of changing the direction of confidence betweenM ◦P andM . The second term is compulsory to reach a good classification since the first part alone does not ensure that hM◦PM ( x ) ( x ) is the highest logit value ( prediction neutrality ) . The parameter λ > 0 , called the luring coefficient , allows to control the trade-off between ensuring good accuracy and shifting confidence direction . Algorithm 1 Training of the luring component Input : trained model M , training steps K , learning rate η , batch size B , luring coefficient λ Output : luring component P , with parameters θ 1 : hM◦Pc ( x ) denotes the logits of M ◦ P for input x and class c 2 : Randomly initialize the parameters θ of P 3 : for step = 1 . . .K : do 4 : { x1 , x2 , . . . , xB } : batch of training set examples 5 : for i = 1 . . . B : do 6 : ( a , b ) ← ( class of the 2nd max value of hM ( xi ) , class of the 2nd max value of hM◦P ( xi ) ) 7 : L ( xi , M ( xi ) ) ←−λ ( hM◦PM ( xi ) ( xi ) − h M◦P a ( xi ) ) +max ( 0 , h M◦P b ( xi ) − h M◦P M ( xi ) ( xi ) ) 8 : end for 9 : θ← θ − η ∑B i=1∇θL ( xi , M ( xi ) ) /B 10 : end for 11 : return P
The paper proposes a new framework for addressing the problem of adversaries in black box settings in order to improve model robustness. Leveraging classical deception frameworks used in network security, the authors propose to fool the attacker by training what they call a `luring component’ that is augmented to an already trained model such that the new model does not later good samples and targets the adversaries to achieve the desired result. Additionally, the proposed framework does not need access to labeled data and can be applied to any pre-trained model. Promising results are demonstrated on multiple datasets like MNIST and CIFAR 10, etc.
SP:e59dce35ddf8c0356e92c60959da89c7f4ce20de
Luring of transferable adversarial perturbations in the black-box paradigm
1 INTRODUCTION . Neural networks based systems have been shown to be vulnerable to adversarial examples ( Szegedy et al. , 2014 ) , i.e . maliciously modified inputs that fool a model at inference time . Many directions have been explored to explain and characterize this phenomenon ( Schmidt et al. , 2018 ; Ford et al. , 2019 ; Ilyas et al. , 2019 ; Shafahi et al. , 2019 ) that became a growing concern and a major brake on the deployment of Machine Learning ( ML ) models . In response , many defenses have been proposed to protect the integrity of ML systems , predominantly focused on an adversary in the white-box setting ( Madry et al. , 2018 ; Zhang et al. , 2019 ; Cohen et al. , 2019 ; Hendrycks et al. , 2019 ; Carmon et al. , 2019 ) . In this work , we design an innovative way to limit the transferability of adversarial perturbation towards a model , opening a new direction for robustness in the realistic black-box setting ( Papernot et al. , 2017 ) . As ML-based online API are likely to become increasingly widespread , and regarding the massive deployment of edge models in a large variety of devices , several instances of a model may be deployed in systems with different environment and security properties . Thus , the black-box paradigm needs to be extensively studied to efficiently protect systems in many critical domains . Considering a target model M that a defender aims at protecting against adversarial examples , we propose a method which allows to build the model T , an augmented version of M , such that adversarial examples do not transfer from T to M . Importantly , training T only requires to have access to M , meaning that no labeled data set is required , so that our approach can be implemented at a low cost for any already trained model . T is built by augmenting M with an additional component P ( with T = M ◦ P ) taking the form of a neural network trained with a specific loss function with logit-based constraints . From the observation that transferability of adversarial perturbations between two models occurs because they rely on similar non-robust features ( Ilyas et al. , 2019 ) , we design P such that ( 1 ) the augmented network exploits useful features of M and that ( 2 ) non-robust features of T and M are either different or require different perturbations to reach misclassification towards the same class . Our deception-based method is conceptually new as it does not aim at making M relying more on robust-features as with proactive schemes ( Madry et al. , 2018 ; Zhang et al. , 2019 ) , nor tries to anticipate perturbations which directly target the non-robust features ofM as with reactive strategies ( Meng & Chen , 2017 ; Hwang et al. , 2019 ) . Our contributions are as follows : • We present an innovative approach to thwart transferability between two models , which we name the luring effect . This phenomenon , as conceptually novel , opens a new direction for adversarial research . • We propose an implementation of the luring effect which fits any pre-trained model and does not require a label data set . An additional neural network is pasted to the target model and trained with a specific loss function that acts on the logits sequence order . • We experimentally characterize the luring effect and discuss its potentiality for black-box defense strategies on MNIST , SVHN and CIFAR10 , and analyze the scalability on ImageNet ( ILSVRC2012 ) . For reproducibility purposes , the code is available at https : //anonymous.4open . science/r/3c64e745-927d-4f51-b187-583e64586ff6/ . 2 LURING ADVERSARIAL PERTURBATIONS . 2.1 NOTATIONS . We consider a classification task where input-label pairs ( x , y ) ∈ X × Y are sampled from a distribution D. |Y| = C is the cardinality of the labels space . A neural network model Mφ : X → Y , with parameters φ , classifies an input x ∈ X to a label M ( x ) ∈ Y . The pre-softmax output function of Mφ ( the logits ) is denoted as hM : X → RC . For the sake of readability , the model Mφ is simply noted as M , except when necessary . 2.2 CONTEXT : ADVERSARIAL EXAMPLES IN THE BLACK-BOX SETTING . Black-box settings are realistic use-cases since many models are deployed ( in the cloud or embedded in mobile devices ) within secure environments and accessible through open or restrictive API . Contrary to the white-box paradigm where the adversary is allowed to use existing gradient-based attacks ( Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ; Chen et al. , 2018 ; Dong et al. , 2018 ; Madry et al. , 2018 ; Wang et al. , 2019 ) , an attacker in a black-box setting only accesses the output label , confidence scores or logits from the target model . He can still take advantage of gradient-free methods ( Uesato et al. , 2018 ; Guo et al. , 2019 ; Su et al. , 2019 ; Brendel et al. , 2018 ; Ilyas et al. , 2018 ; Chen et al. , 2020 ) but , practically , the number of queries requires to mount the attack is prohibitive and may be flagged as suspicious ( Chen et al. , 2019 ; Li et al. , 2020 ) . In that case , the adversary may take advantage of the transferability property ( Papernot et al. , 2017 ) by crafting adversarial examples on a substitute model and then transfering them to the target model . 2.3 OBJECTIVES AND DESIGN . Our objective is to find a novel way to make models more robust against transferable black-box adversarial perturbation without expensive ( and sometimes prohibitive ) training cost required by many white-box defense methods . Our main idea is based on classical deception-based approaches for network security ( e.g . honeypots ) and can be summarized as follow : rather than try to prevent an attack , let ’ s fool the attacker . Our approach relies on a network P : X → X , pasted to the already trained target network M before the input layer , such as the resulting augmented model will answer T ( x ) = M ◦ P ( x ) when fed with input x . The additional component P is designed and trained to reach a twofold objective : • Prediction neutrality : adding P does not alter the decision for a clean example x , i.e . T ( x ) = M ◦ P ( x ) = M ( x ) ; • Adversarial luring : according to an adversarial example x′ crafted to fool T , M does not output the same label as T ( i.e . M ◦P ( x′ ) 6= M ( x′ ) ) and , in the best case , x′ is inefficient ( i.e . M ( x′ ) = y ) . To explain the intuition of our method , we follow the feature-based framework proposed in Ilyas et al . ( 2019 ) where a feature f is a function from X to R , that M has learned to perform its predictions . Considering a binary classification task , f is said to be ρ-useful ( ρ > 0 ) if it satisfies Equation 1a and is γ-useful robust if under the worst perturbation δ chosen in a predefined set of allowed perturbations ∆ , f stays γ-useful under this perturbation ( Equation 1b ) . A ρ-useful feature f is said to be a non-robust feature if f is not robust for any γ ≥ 0 . ( a ) E ( x , y ) ∼D [ y · f ( x ) ] > ρ ( b ) E ( x , y ) ∼D [ inf δ∈∆ y · f ( x+ δ ) ] > γ ( 1 ) An adversary which aims at fooling a model will thus perform perturbations to the inputs to influence the useful features which are not robust with respect to the perturbation he is allowed to apply . We denote F∗M the set of ρ-useful features learned by M . We consider a set of allowed perturbations ∆ and γ > 0 such that we note F∗ , RM and F ∗ , NR M respectively the set of γ-robust and non-robust features learned by M ( relatively to ∆ ) . An adversary that aims at fooling M ◦P will alter function compositions of the form f ◦ P with f ∈ F∗M . These function compositions are the non-robust useful features of M ◦ P , whose set is denoted F∗ , NRM◦P . Based on the observations that transferability of adversarial perturbations between two models occurs because these models rely on similar non-robust features ( Ilyas et al. , 2019 ) , we consider f ◦ P ∈ F∗ , NRM◦P , and we derive two possibilities which ensure the lowest transferability between M ◦ P and M , regarding the robustness of f . If f is robust , f ∈ F∗ , RM , that means the adversarial perturbations from ∆ is sufficient to flip the augmented feature f ◦ P but is not efficient to directly impact f . This case is the optimal one , since the adversarial example is unsuccessful on the target model ( M ◦P ( x′ ) 6= y and M ( x′ ) = y ) . On the other hand , if f ∈ F∗ , NRM ( i.e . both f and f ◦ P are non-robust ) , restraining the transferability means that the additional model P impacts the way useful features vary with respect to input alterations so that the adversarial perturbation lead to two different labels . We encompass these two cases ( illustrated in Figure 1 ) within what we name the luring effect . The adversary is tricked into modifying input values in some way to flip useful and non-robust features of M ◦ P and these modifications are either without effect on the useful features of M , or flip the non-robust features of M in a different way ( and therefore are detectable , as presented in Section 4 ) . 2.4 TRAINING THE LURING COMPONENT . To reach our two objectives ( prediction neutrality and adversarial luring ) , we propose to train P with constraints based on the predicted labels order . For x ∈ X , let α and β be the labels corresponding respectively to the first and second highest confidence score given to x byM . The training of P is achieved with a new loss function that constraints α to ( still ) be the first class predicted by M ◦P ( prediction neutrality ) and that makes the logits gap between α and β the highest as possible for M ◦ P ( adversarial luring ) . To understand the intuition behind this loss function , let ’ s formalize the concepts learned by M and M ◦ P . The prediction given by M corresponds to ” class α is predicted , class β is the second possible class ” . Once P has been trained following this loss function , the prediction given byM ◦P corresponds to ” class α is predicted , the higher confidence given to class α , the smaller confidence given to class β ” . Concepts learned byM andM ◦P share the same goal of prediction , i.e . ” class α ” is predicted , but the relation between class α and class β is forced to be the most different as possible . As learned concepts are essentially different , then useful features learned by M and M ◦P to reach these concepts are necessarily different , and consequently display different types of sensitivity to the same input pixel modifications . In other words , as the direction of confidence towards classes is forced to be structurally different for M ◦ P and M , we hypothesize that useful features of the two classifiers should be different and behave differently to adversarial perturbations . The luring loss , designed to induce this behavior , is given in Equation 2 and the complete training procedure is detailed in Algorithm 1 . The parameters of P are denoted by θ , x ∈ X is an input and M is the target model . M has already been trained and its parameters are frozen during the process . hM ( x ) and hM◦P ( x ) denote respectively the logits of M and M ◦ P for input x. hMi ( x ) and hM◦Pi ( x ) correspond respectively to the values of h M ( x ) and hM◦P ( x ) for class i . The classes a and b correspond to the second maximum value of hM and hM◦P respectively . L ( x , M ( x ) ) =− λ ( hM◦PM ( x ) ( x ) − h M◦P a ( x ) ) +max ( 0 , hM◦Pb ( x ) − h M◦P M ( x ) ( x ) ) ( 2 ) The first term of Equation 2 optimizes the gap between the logits of M ◦ P corresponding to the first and second biggest unscaled confidence score ( logits ) given by M ( i.e . M ( x ) and a ) . This part formalizes the goal of changing the direction of confidence betweenM ◦P andM . The second term is compulsory to reach a good classification since the first part alone does not ensure that hM◦PM ( x ) ( x ) is the highest logit value ( prediction neutrality ) . The parameter λ > 0 , called the luring coefficient , allows to control the trade-off between ensuring good accuracy and shifting confidence direction . Algorithm 1 Training of the luring component Input : trained model M , training steps K , learning rate η , batch size B , luring coefficient λ Output : luring component P , with parameters θ 1 : hM◦Pc ( x ) denotes the logits of M ◦ P for input x and class c 2 : Randomly initialize the parameters θ of P 3 : for step = 1 . . .K : do 4 : { x1 , x2 , . . . , xB } : batch of training set examples 5 : for i = 1 . . . B : do 6 : ( a , b ) ← ( class of the 2nd max value of hM ( xi ) , class of the 2nd max value of hM◦P ( xi ) ) 7 : L ( xi , M ( xi ) ) ←−λ ( hM◦PM ( xi ) ( xi ) − h M◦P a ( xi ) ) +max ( 0 , h M◦P b ( xi ) − h M◦P M ( xi ) ( xi ) ) 8 : end for 9 : θ← θ − η ∑B i=1∇θL ( xi , M ( xi ) ) /B 10 : end for 11 : return P
In this paper, the authors present a novel approach to evade the transferability of adversarial examples between two models. Specifically, they design a luring loss to train model T, an augmented version of M, where the adversarial examples cannot transfer from T to M. The luring loss is designed to reach a twofold objective: (1) for a clean example, T and M yield the same prediction (2) for an adversarial example, T and M yield different predictions, and in the best case, M can provide correct prediction. The proposed approach can serve as a defense for both detect adversarial examples and defend adversarial examples. Experimental results show that the proposed defense can detect and defend adversarial examples better that the three baselines. In general, the paper is clearly written and easy to follow.
SP:e59dce35ddf8c0356e92c60959da89c7f4ce20de
Trans-Caps: Transformer Capsule Networks with Self-attention Routing
1 INTRODUCTION . Convolutional Neural Networks ( CNNs ) have achieved state-of-the-art performance in many different computer vision tasks ( Krizhevsky et al. , 2012 ; He et al. , 2016 ) . This is achieved by local connectivity and parameter sharing across spatial locations so that useful local features learned in one receptive field can then be detected across the input feature space . While such a mechanism is sufficient to learn relationships between nearby pixels and to detect the existence of objects of interest , CNNs often fail to detect objects presented in radically new viewpoints due to the complex effects of the viewpoint changes on the pixel intensity values . This limitation forces us to train each CNN with a large number of data points which is computationally expensive . Capsule Networks ( CapsNets ) were introduced to explicitly learn a viewpoint invariant representation of the geometry of an object . In CapsNets , each group of neurons ( called a “ capsule ” ) encodes and represents the visual features of a higher-level object in an instantiation parameter vector or matrix ( which we refer to as the pose vector or matrix throughout this paper ) . The lower-level capsules ( which we refer to as part capsules ) estimate the pose of the object parts and hierarchically combine them to predict the pose of the whole object in the next layer . The object-part relationship is viewpoint-invariant , meaning that changes in the viewpoint change the pose of parts and objects in a coordinated way . Therefore , regardless of the viewpoint , we can infer the pose of the whole object from its parts using a set of trainable viewpoint-invariant transformation matrices . Capsule routing mechanisms can therefore learn the underlying spatial relationships between parts and objects . This improves the generalization capabilities of the network due to the underlying linear relationship between the viewpoint changes and the pose matrices . In order to route information between capsules , the part capsules vote for the pose of the higher-level capsules ( which we refer to as object capsules ) . A routing-by-agreement mechanism is employed to aggregate votes ( which has been traditionally accomplished using a recurrent clustering procedure ) effectively computing the contribution of each part to the object pose . While various proposed iterative routing mechanisms ( such as Dynamic ( Sabour et al. , 2017 ) and EM ( Hinton et al. , 2018 ) routing ) have been shown to be effective in the detection of viewpoint variations , their iterative nature increases computational cost . Prior research has additionally shown that these routing mechanisms may fail to properly construct a parse tree between each set of part and object capsules , partly due to the inability of the network to learn routing weights through back-propagation ( Peer et al. , 2018 ) . This ultimately limits the performance of CapsNets in realworld image classification tasks . Additionally , the correct number of routing iterations serves as an additional data-dependent hyper-parameter that needs to be carefully selected ; failing to optimize the number of routing operations can result in increased bias or variance in the model ( Hinton et al. , 2018 ) . This issue is amplified when training networks with multiple capsule layers . In this paper , we introduce a novel routing algorithm called self-attention routing ( SAR ) , which is inspired by the structural resemblance between CapsNets and Transformer networks ( Vaswani et al. , 2017 ) . This mechanism eliminates the need for recursive computations by replacing unsupervised routing procedures with a self-attention module , making the use of CapsNets effective in complex and large-scale image classification tasks . Our algorithm also reduces the risk of under and over-fitting associated with selecting a small and large number of routing iterations , respectively . We compare our proposed routing algorithm to two of the most prominent iterative methods , namely dynamic and EM routing , and the recently published non-iterative self-routing mechanism ( Hahn et al. , 2019 ) . We evaluate performance on several image classification datasets including SVHN , CIFAR-10 , CIFAR-100 , Tiny-ImageNet , ImageNet , and SmallNORB . Our results show that our model outperforms other baseline CapsNets and achieves better classification performance and convergence speed while requiring significantly fewer trainable parameters , fewer computations ( in FLOPs ) , and less memory . Moreover , our experimental result on the SmallNORB dataset with novel viewpoints shows that the proposed model is significantly more robust to changes in the viewpoint and is able to retain its performance under severe viewpoint shifts . All source code will be made publicly available . 2 RELATED WORK . 2.1 CAPSULE NETWORKS . CapsNets were originally introduced in Transforming Autoencoders by Hinton et al . ( 2011 ) ; here they pose computer vision tasks as inverse graphics problems to deal with variations in an object ’ s instantiation parameters . This architecture learns to reconstruct an affine-transformed version of the input image , therefore learning to represent each input as a combination of its parts and their respective characteristics . Sabour et al . ( 2017 ) introduced capsules with Dynamic Routing ( DRCaps ) , which allows the network to learn part-whole relationships through an iterative unsupervised clustering procedure . In DR-Caps , capsules output a pose vector whose length ( norm or magnitude ) implicitly represents the capsule activation . The vector norm should be able to scale depending on the pose values ; representing existence with the vector norm can therefore potentially weaken the representation power of any given capsule layer . Hinton et al . ( 2018 ) proposed capsules with EM routing ( EM-Caps ) , where capsule activations and pose matrices are segregated to fit the votes from part capsules through a mixture of Gaussians . While powerful , capsule network ’ s routing procedures have several fundamental limitations : : 1 ) Iterative routing operations are the bottleneck of CapsNets due to their computational complexity , which limits their widespread applicability in complex , large-scale datasets ( Zhang et al. , 2018 ; Li et al. , 2018 ) . 2 ) The number of routing iterations are hyper-parameters that need to be carefully tuned to prevent under and over fitting ( Hinton et al. , 2018 ) . 3 ) Lin et al . ( 2018 ) showed that even after seven iterative routing operations , the entropy of the coupling coefficient was still large , indicating that part capsules pass information to all object capsules . 4 ) EM-Caps have difficulty converging and have been shown to be numerically unstable , which limits their applicability in complex tasks ( Ahmed & Torresani , 2019 ; Gritzman , 2019 ) . Several studies have proposed non-iterative methods to replace the traditional iterative routing mechanisms in CapsNets . STAR-CAPS ( Ahmed & Torresani , 2019 ) combines an attention gate with a straight-through estimator to make a binary decision to either connect or disconnect the route between each part and object capsule . Tsai et al . ( 2020 ) proposed an inverted dot-product attention routing mechanism ( IDPA-Caps ) which generates the routing coefficients between capsules ; they unroll the iterative routing procedure and perform the iterations concurrently which helps improve parallelization . While powerful , the number of concurrent iterations is a hyper-parameter that needs to be tuned , and the unrolling process creates a very large network that is memory intensive . Inspired by Mixture-of-Experts , Hahn et al . ( 2019 ) introduced a self-routing mechanism . While non-iterative , self-routing attaches stationary routing weights to specific locations which limits its ability to generalize to novel viewpoints . This also increases the required number of trainable parameters , making it impractical for high-dimensional images . 2.2 SELF-ATTENTION . Attention operations bias a network to more informative components of the input in order to improve the discriminative capabilities of the model . This operation has been used to tackle the problem of long-range interactions in sequence modeling and has seen great success across the fields of Natural Language Processing ( NLP ) ( Bahdanau et al. , 2014 ) , genomics ( Zaheer et al. , 2020 ) , speech recognition ( Chorowski et al. , 2015 ) , and computer vision ( Hu et al. , 2018 ; Wang et al. , 2017 ) . Various attention mechanisms have been used to improve CNNs by allowing the network to capture interactions between elements of the encoded feature space , which is difficult for a stand-alone convolutional operation ( Woo et al. , 2018 ; Hu et al. , 2018 ) . Transformer based architectures were introduced by Vaswani et al . ( 2017 ) and utilize self-attention as the primary mechanism for representation learning . Self-attention employs the standard dot product operation to generate attention coefficients that effectively capture the long-range interactions between inputs and outputs . These architectures have outperformed recurrent neural networks in a wide range of tasks and have become the SOTA for representation learning ( Devlin et al. , 2018 ; Radford et al. , 2019 ; Huang et al. , 2018 ) . This concept was then expanded to computer vision applications by treating each output pixel as an element in the self-attention operation , thus allowing a CNN to learn global dependencies between receptive fields ( Bello et al. , 2019 ) . While powerful , this mechanism generates global dependencies for all pixels , making it memory intensive and computationally cumbersome . This issue was later addressed by restricting the scope of each self-attention operation to local patches as opposed to applying self-attention to the global feature space ( Hu et al. , 2019 ; Ramachandran et al. , 2019 ) . The Set Transformer is an encoder-decoder architecture that utilizes a self-attention mechanism to cluster a group of independent inputs by modeling the interactions among the elements of the set ( Lee et al. , 2019 ) . Given that the order of the part capsules does not contribute to the understanding of each object capsule , we took inspiration from the Set Transformer to replace the recurrent routing mechanism with a self-attention-based aggregation of the “ votes ” in a permutation invariant manner . 3 TRANSFORMER CAPSULE NETWORK . 3.1 MODEL ARCHITECTURE OVERVIEW . The Transformer Capsule Network ( Trans-Caps ) is a capsule-based neural network architecture where each capsule represents an encoded pose matrix . Trans-Caps starts with a convolutional backbone , followed by a sequence of capsule layers . Note that the choice of the convolutional backbone , the number of capsule layers and the number of capsules per layer varies for different sets of experiments . Given an input image X ∈ RH×W×D , the role of the convolutional backbone is to extract a set of features F ∈ RH′×W ′×D′ from the input . The backbone can be either a single convolutional layer , a cascade of a few convolutional layers , or a cascade of residual blocks ( He et al. , 2016 ) . Previous studies have shown improved performance for more complex datasets when using a residual backbone ( Tsai et al. , 2020 ; Hahn et al. , 2019 ) . We provide a detailed discussion of the various backbone configurations in the Experiments section . The first capsule layer ( PrimaryCaps ) is a convolutional layer , followed by BN applied to the output backbone features F . The outputs are then reshaped to form the primary capsule pose elements . All layers following this layer are convolutional capsule layers ( ConvCaps ) with SAR performed between the layers to construct the pose of the object capsules . With our non-iterative SAR mechanism , the pose computation at all stages of the network can be performed sequentially in one forward pass , yielding numerical stability and efficiency . The final capsule layer ( ClassCaps ) has as many capsules as the number of classes and predicts the pose of the objects , PLj where j ∈ { 1 , ... , J } . J and L represent the number of object capsules and the total number of layers , respectively . This layer is followed by a linear Classifier which is shared across all class capsules and computes the final class logits as ŷc = Classifier ( PLc ) where P L c is the output of the final ConvCaps layer and c ∈ { 1 , ... , C } in a C class problem .
The paper proposes to swap the typical routing mechanisms in capsules for a more standard attention mechanism. The attention mechanism is based on computing similarity scores using gaussians instead of dot-products . The authors show that this leads to better downstream performance of more natural tasks while preserving robustness to viewpoint changes, one of the main strengths of capsules.
SP:e3aa12a5f1d70e4d877ae9ff02a92981c92f1f32
Trans-Caps: Transformer Capsule Networks with Self-attention Routing
1 INTRODUCTION . Convolutional Neural Networks ( CNNs ) have achieved state-of-the-art performance in many different computer vision tasks ( Krizhevsky et al. , 2012 ; He et al. , 2016 ) . This is achieved by local connectivity and parameter sharing across spatial locations so that useful local features learned in one receptive field can then be detected across the input feature space . While such a mechanism is sufficient to learn relationships between nearby pixels and to detect the existence of objects of interest , CNNs often fail to detect objects presented in radically new viewpoints due to the complex effects of the viewpoint changes on the pixel intensity values . This limitation forces us to train each CNN with a large number of data points which is computationally expensive . Capsule Networks ( CapsNets ) were introduced to explicitly learn a viewpoint invariant representation of the geometry of an object . In CapsNets , each group of neurons ( called a “ capsule ” ) encodes and represents the visual features of a higher-level object in an instantiation parameter vector or matrix ( which we refer to as the pose vector or matrix throughout this paper ) . The lower-level capsules ( which we refer to as part capsules ) estimate the pose of the object parts and hierarchically combine them to predict the pose of the whole object in the next layer . The object-part relationship is viewpoint-invariant , meaning that changes in the viewpoint change the pose of parts and objects in a coordinated way . Therefore , regardless of the viewpoint , we can infer the pose of the whole object from its parts using a set of trainable viewpoint-invariant transformation matrices . Capsule routing mechanisms can therefore learn the underlying spatial relationships between parts and objects . This improves the generalization capabilities of the network due to the underlying linear relationship between the viewpoint changes and the pose matrices . In order to route information between capsules , the part capsules vote for the pose of the higher-level capsules ( which we refer to as object capsules ) . A routing-by-agreement mechanism is employed to aggregate votes ( which has been traditionally accomplished using a recurrent clustering procedure ) effectively computing the contribution of each part to the object pose . While various proposed iterative routing mechanisms ( such as Dynamic ( Sabour et al. , 2017 ) and EM ( Hinton et al. , 2018 ) routing ) have been shown to be effective in the detection of viewpoint variations , their iterative nature increases computational cost . Prior research has additionally shown that these routing mechanisms may fail to properly construct a parse tree between each set of part and object capsules , partly due to the inability of the network to learn routing weights through back-propagation ( Peer et al. , 2018 ) . This ultimately limits the performance of CapsNets in realworld image classification tasks . Additionally , the correct number of routing iterations serves as an additional data-dependent hyper-parameter that needs to be carefully selected ; failing to optimize the number of routing operations can result in increased bias or variance in the model ( Hinton et al. , 2018 ) . This issue is amplified when training networks with multiple capsule layers . In this paper , we introduce a novel routing algorithm called self-attention routing ( SAR ) , which is inspired by the structural resemblance between CapsNets and Transformer networks ( Vaswani et al. , 2017 ) . This mechanism eliminates the need for recursive computations by replacing unsupervised routing procedures with a self-attention module , making the use of CapsNets effective in complex and large-scale image classification tasks . Our algorithm also reduces the risk of under and over-fitting associated with selecting a small and large number of routing iterations , respectively . We compare our proposed routing algorithm to two of the most prominent iterative methods , namely dynamic and EM routing , and the recently published non-iterative self-routing mechanism ( Hahn et al. , 2019 ) . We evaluate performance on several image classification datasets including SVHN , CIFAR-10 , CIFAR-100 , Tiny-ImageNet , ImageNet , and SmallNORB . Our results show that our model outperforms other baseline CapsNets and achieves better classification performance and convergence speed while requiring significantly fewer trainable parameters , fewer computations ( in FLOPs ) , and less memory . Moreover , our experimental result on the SmallNORB dataset with novel viewpoints shows that the proposed model is significantly more robust to changes in the viewpoint and is able to retain its performance under severe viewpoint shifts . All source code will be made publicly available . 2 RELATED WORK . 2.1 CAPSULE NETWORKS . CapsNets were originally introduced in Transforming Autoencoders by Hinton et al . ( 2011 ) ; here they pose computer vision tasks as inverse graphics problems to deal with variations in an object ’ s instantiation parameters . This architecture learns to reconstruct an affine-transformed version of the input image , therefore learning to represent each input as a combination of its parts and their respective characteristics . Sabour et al . ( 2017 ) introduced capsules with Dynamic Routing ( DRCaps ) , which allows the network to learn part-whole relationships through an iterative unsupervised clustering procedure . In DR-Caps , capsules output a pose vector whose length ( norm or magnitude ) implicitly represents the capsule activation . The vector norm should be able to scale depending on the pose values ; representing existence with the vector norm can therefore potentially weaken the representation power of any given capsule layer . Hinton et al . ( 2018 ) proposed capsules with EM routing ( EM-Caps ) , where capsule activations and pose matrices are segregated to fit the votes from part capsules through a mixture of Gaussians . While powerful , capsule network ’ s routing procedures have several fundamental limitations : : 1 ) Iterative routing operations are the bottleneck of CapsNets due to their computational complexity , which limits their widespread applicability in complex , large-scale datasets ( Zhang et al. , 2018 ; Li et al. , 2018 ) . 2 ) The number of routing iterations are hyper-parameters that need to be carefully tuned to prevent under and over fitting ( Hinton et al. , 2018 ) . 3 ) Lin et al . ( 2018 ) showed that even after seven iterative routing operations , the entropy of the coupling coefficient was still large , indicating that part capsules pass information to all object capsules . 4 ) EM-Caps have difficulty converging and have been shown to be numerically unstable , which limits their applicability in complex tasks ( Ahmed & Torresani , 2019 ; Gritzman , 2019 ) . Several studies have proposed non-iterative methods to replace the traditional iterative routing mechanisms in CapsNets . STAR-CAPS ( Ahmed & Torresani , 2019 ) combines an attention gate with a straight-through estimator to make a binary decision to either connect or disconnect the route between each part and object capsule . Tsai et al . ( 2020 ) proposed an inverted dot-product attention routing mechanism ( IDPA-Caps ) which generates the routing coefficients between capsules ; they unroll the iterative routing procedure and perform the iterations concurrently which helps improve parallelization . While powerful , the number of concurrent iterations is a hyper-parameter that needs to be tuned , and the unrolling process creates a very large network that is memory intensive . Inspired by Mixture-of-Experts , Hahn et al . ( 2019 ) introduced a self-routing mechanism . While non-iterative , self-routing attaches stationary routing weights to specific locations which limits its ability to generalize to novel viewpoints . This also increases the required number of trainable parameters , making it impractical for high-dimensional images . 2.2 SELF-ATTENTION . Attention operations bias a network to more informative components of the input in order to improve the discriminative capabilities of the model . This operation has been used to tackle the problem of long-range interactions in sequence modeling and has seen great success across the fields of Natural Language Processing ( NLP ) ( Bahdanau et al. , 2014 ) , genomics ( Zaheer et al. , 2020 ) , speech recognition ( Chorowski et al. , 2015 ) , and computer vision ( Hu et al. , 2018 ; Wang et al. , 2017 ) . Various attention mechanisms have been used to improve CNNs by allowing the network to capture interactions between elements of the encoded feature space , which is difficult for a stand-alone convolutional operation ( Woo et al. , 2018 ; Hu et al. , 2018 ) . Transformer based architectures were introduced by Vaswani et al . ( 2017 ) and utilize self-attention as the primary mechanism for representation learning . Self-attention employs the standard dot product operation to generate attention coefficients that effectively capture the long-range interactions between inputs and outputs . These architectures have outperformed recurrent neural networks in a wide range of tasks and have become the SOTA for representation learning ( Devlin et al. , 2018 ; Radford et al. , 2019 ; Huang et al. , 2018 ) . This concept was then expanded to computer vision applications by treating each output pixel as an element in the self-attention operation , thus allowing a CNN to learn global dependencies between receptive fields ( Bello et al. , 2019 ) . While powerful , this mechanism generates global dependencies for all pixels , making it memory intensive and computationally cumbersome . This issue was later addressed by restricting the scope of each self-attention operation to local patches as opposed to applying self-attention to the global feature space ( Hu et al. , 2019 ; Ramachandran et al. , 2019 ) . The Set Transformer is an encoder-decoder architecture that utilizes a self-attention mechanism to cluster a group of independent inputs by modeling the interactions among the elements of the set ( Lee et al. , 2019 ) . Given that the order of the part capsules does not contribute to the understanding of each object capsule , we took inspiration from the Set Transformer to replace the recurrent routing mechanism with a self-attention-based aggregation of the “ votes ” in a permutation invariant manner . 3 TRANSFORMER CAPSULE NETWORK . 3.1 MODEL ARCHITECTURE OVERVIEW . The Transformer Capsule Network ( Trans-Caps ) is a capsule-based neural network architecture where each capsule represents an encoded pose matrix . Trans-Caps starts with a convolutional backbone , followed by a sequence of capsule layers . Note that the choice of the convolutional backbone , the number of capsule layers and the number of capsules per layer varies for different sets of experiments . Given an input image X ∈ RH×W×D , the role of the convolutional backbone is to extract a set of features F ∈ RH′×W ′×D′ from the input . The backbone can be either a single convolutional layer , a cascade of a few convolutional layers , or a cascade of residual blocks ( He et al. , 2016 ) . Previous studies have shown improved performance for more complex datasets when using a residual backbone ( Tsai et al. , 2020 ; Hahn et al. , 2019 ) . We provide a detailed discussion of the various backbone configurations in the Experiments section . The first capsule layer ( PrimaryCaps ) is a convolutional layer , followed by BN applied to the output backbone features F . The outputs are then reshaped to form the primary capsule pose elements . All layers following this layer are convolutional capsule layers ( ConvCaps ) with SAR performed between the layers to construct the pose of the object capsules . With our non-iterative SAR mechanism , the pose computation at all stages of the network can be performed sequentially in one forward pass , yielding numerical stability and efficiency . The final capsule layer ( ClassCaps ) has as many capsules as the number of classes and predicts the pose of the objects , PLj where j ∈ { 1 , ... , J } . J and L represent the number of object capsules and the total number of layers , respectively . This layer is followed by a linear Classifier which is shared across all class capsules and computes the final class logits as ŷc = Classifier ( PLc ) where P L c is the output of the final ConvCaps layer and c ∈ { 1 , ... , C } in a C class problem .
The submission details a novel technique to learn the routing in capsule networks for image classification tasks. Connecting capsules in such architectures typically requires iterative approaches which are computationally expensive. The main idea in this submission is to leverage a non-iterative attention mechanism to learn this routing and thus decreases computational cost. Furthermore, the experiments indicate that the proposed architecture leads to higher accuracy on a number of image classification tasks and datasets.
SP:e3aa12a5f1d70e4d877ae9ff02a92981c92f1f32
Factoring out Prior Knowledge from Low-Dimensional Embeddings
1 INTRODUCTION . Embedding high dimensional data into low dimensional spaces , such as with tSNE ( van der Maaten & Hinton , 2008 ) or UMAP ( McInnes et al. , 2018 ) , allow us to visually inspect and discover meaningful structure from the data that would otherwise be difficult or impossible to see . These methods are as popular as they are useful , but , at the same time limited in that they are one-shot only : they embed the data as is , and that is that . If the resulting embedding reveals novel knowledge , all is well , but , what if the structure that dominates it is something we already know , something we are no longer interested in , or , if we want to discover whether the data has meaningful structure other than what the first result revealed ? In word embeddings , for example , we may already know that certain words are synonyms , while in single cell sequencing we may want to discover structure other than known cell types , or factor out family relationships . The question at hand is therefore , how can we obtain low-dimensional embeddings that reveal structure beyond what we already know , i.e . how to factor out prior knowledge from low-dimensional embeddings ? For conditional embeddings , research so far mostly focused on emphasizing rather than factoring out prior knowledge ( De Ridder et al. , 2003 ; Hanhijärvi et al. , 2009 ; Barshan et al. , 2011 ) , with conditional tSNE as notable exception , which , however , can only factor out label information ( Kang et al. , 2019 ) . Here , we propose two techniques for factoring out a more general form of prior knowledge from low-dimensional embeddings of arbitrary data types . In particular , we consider background knowledge in the form of pairwise distances between samples . This formulation allows us to cover a plethora of practical instances including labels , clustering structure , family trees , userdefined distances , but also , and especially important for unstructured data , kernel matrices . To factor out prior knowledge from tSNE embeddings , we propose JEDI , in which we adapt the tSNE objective in a principled way using Jensen-Shannon divergence . It has an intuitively appealing information theoretic interpretation , and maintains all the strengths and weaknesses of tSNE . One of these is runtime , which is why UMAP is particularly popular in bioinformatics . To factor out prior knowledge from embedding approaches in general , including UMAP , we hence propose CONFETTI , which directly operates on the input data . An extensive set of experiments shows that both methods work well in practice and provide embeddings that reveal meaningful structure beyond provided background knowledge , such as organizing flower images according to shape rather than color , or organizing single cell gene expression data beyond cell type , revealing batch effects and tissue type . 2 RELATED WORK . Embedding high dimensional data into a low dimensional spaces is a research topic of perennial interest that includes classic methods such as principal component analysis Pearson ( 1901 ) , multidimensional scaling ( Torgerson , 1952 ) , self organizing maps ( Kohonen , 1982 ) , and isomap ( Tenenbaum et al. , 2000 ) , all of which focus on keeping large distances intact . This is inadequate for data that lies on a manifold that resembles a Euclidean space only locally , which is the case for high dimensional data ( Silva & Tenenbaum , 2003 ) and for which we hence need methods such as locally linear embedding ( LLE ) ( Roweis & Saul , 2000 ) and stochastic neighbor embedding ( SNE ) ( Hinton & Roweis , 2003 ) that focus on keeping local distances intact . The current state of the art methods are t-distributed SNE ( tSNE ) by van der Maaten & Hinton ( 2008 ) and Uniform Manifold Approximation ( UMAP ) by McInnes et al . ( 2018 ) . Both are by now staple methods for data processing , e.g . in biology ( Becht et al. , 2019 ; Kobak & Berens , 2019 ) and NLP ( Coenen et al. , 2019 ) . As they often yield highly similar embeddings ( Kobak & Linderman , 2019 ) it is a matter of taste which one to use . While tSNE has an intuitive interpretation , despite recent optimizations ( van der Maaten , 2014 ; Linderman et al. , 2019 ) compared to UMAP it suffers from very long runtimes . Whereas the above consider only the data as is , there also exist proposals that additionally take user input and/or domain knowledge into account . For specific applications to gene expression , it was proposed to optimize projections of gene expression to model similarities in corresponding gene ontology annotations ( Peltonen et al. , 2010 ) . More recently , attention has been brought to removing unwanted variation ( RUV ) from data using negative controls in particular in the light of gene expression , assuming that the expression can be modeled as a linear function of factors of variation and a normally distributed variable ( Gagnon-Bartsch & Speed , 2012 ) . This approach has been successfully applied to different tasks and domains of gene expression ( Risso et al. , 2014 ; Buettner et al. , 2015 ; Gerstner et al. , 2016 ; Hung , 2019 ) . Here , we are interested to develop a domain independent method to obtain low-dimensional embeddings while factoring out prior knowledge . For that , we neither want to assume a functional relationship between prior and input data , nor do we want to assume a particular distribution of the input , but keep the original data manifold intact . Furthermore , we do not want to rely on negative samples that have to be known and present in the data to be able to factor out the prior . The general , domain independent methods supervised LLE ( De Ridder et al. , 2003 ) , guided LLE ( Alipanahi & Ghodsi , 2011 ) , and supervised PCA ( Barshan et al. , 2011 ) all aim to emphasize rather than factor out the structure given as prior knowledge . Like us , Kang et al . ( 2016 ; 2019 ) ; Puolamäki et al . ( 2018 ) factor out background knowledge , but are much more limited in the type of prior knowledge . In particular , Puolamäki et al . ( 2018 ) requires users to specify clusters in the embedded space , Kang et al . ( 2016 ) requires background knowledge for which a maximum entropy distribution can be obtained , while Kang et al . ( 2019 ) extend tSNE and propose conditional tSNE ( ctSNE ) which accepts prior knowledge in the form of class labels . In contract , we consider prior knowledge in the form of arbitrary distance metrics , which can capture relative relationships which appears naturally in real world data , such difference in age , geographic location , or level of gene expression . We propose both , an information theoretic extension to tSNE , and an embedding-algorithm independent approach to factor out prior knowledge . 3 THEORY . We present two approaches , with distinct properties , that both solve the problem of embedding high dimensional data while factoring out prior knowledge . We start with an informal definition of the problem , after which we introduce vanilla tSNE . We then present our first solution , JEDI , which extends the tSNE objective to incorporate prior information . We then present CONFETTI , which uses an elegant yet powerful idea that allows us to directly factor out prior knowledge from the distance matrix of the high dimensional data , which allows CONFETTI to be used in combination with any embedding algorithm that operates on distance matrices . 3.1 THE PROBLEM – INFORMALLY . Given a set of n samples X from a high dimensional space , e.g . IRd , our goal is to find a low dimensional representation Y in IR2 that captures the local structure in X while factoring out prior knowledge Z about the samples . Here , we consider both high dimensional data X and prior Z to be given as distance matrices , thus allowing for data from typical spaces such as Euclidean , but also images , up to unstructured data such as texts or graphs , for which distance matrices can be specified using a kernel . When embedding X , our goal is to embed the samples such that the pairwise low dimensional distances DY resemble high dimensional distances DX locally , but are distinct to the prior distances DZ . Informally , we can state this goal as finding an embedding Y subject to DX ≈ DY 6≈ DZ . We could formally define this as a multi-objective problem composed of a minimization over the difference between DX and DY and a maximization of the difference between DY and DZ . Besides how to measure these differences , there are two problems that render classic multi-objective optimization impractical . First , the two functions are highly imbalanced , with the minimization objective obtaining its optimum at 0 and the maximization at +∞ , hence we need to constrain the optimization . Second , we want to put emphasis on correctly reconstructing local structure , as this yields superior visualizations ( van der Maaten & Hinton , 2008 ; McInnes et al. , 2018 ) . 3.2 THE PROBLEM – INFORMATION THEORETICALLY . The t-distributed Stochastic Neighbor Embedding ( tSNE ) ( van der Maaten & Hinton , 2008 ) is a state-of-the-art approach for embedding data into low dimensional spaces that preserves the local structure of the high dimensional data . In particular , it models the local neighborhood of a point by casting the pairwise distances into similarity distributions that express for each point i the likelihood of observing point j as neighbor , given by pj|i . For the high dimensional distances DXij , this likelihood is approximated by a Gaussian kernel centered at point i pj|i = exp ( − ( DXij ) 2/2σ2i ) ∑ k 6=i exp ( − ( DXik ) 2/2σ2i ) . To account for varying densities of points in the space , the variance σi is dependent on where the kernel is centered . Given the user specified parameter perplexity , which can be thought of as an estimate of the neighborhood size , we can solve perplexity = 2H ( Pi ) for σi for each point i , where H ( Pi ) = ∑ j pj|i log pj|i is the entropy . By symmetrizing the conditional probabilities , the joint probability of a pair of points is given as pij = pj|i+pi|j 2n , which yields the desired local similarity representation of high dimensional points . The low dimensional point similarities qij are represented by a t-distribution instead of a Gaussian , which solves the crowding problem1 due to its heavy tails . We thus get low dimensional similarities qij = ( 1 + ( DYij ) 2 ) −1∑ k 6=l ( 1 + ( D Y kl ) 2 ) −1 . The goal of tSNE is to model pairs of points exhibiting a high similarity in the high dimensional space to have a high similarity in the low dimensional space . This is achieved by minimizing the Kullback-Leibler Divergence ( KL ) , given by DKL ( P || Q ) = ∑ i 6=j pij log pij qij , for the pairwise probabilities . This information theoretic measure yields the number of excess bits needed if we would encode P using a code optimal for encoding Q and thus models how well Q approximates P . Minimizing the KL divergence with respect to Y , we get a non-convex objective that we can practically optimize using gradient descent . Using a similar notion of neighborhood distributions , we can now define a new objective that instantiates our objective using tools from information theory .
The author(s) provide two methods for factoring out specific covariates from tSNE, UMAP or other distance matrices. The first one is JEDI, an extension of tSNE that minimizes a parameterized divergence (that takes into account the information to be factored out) instead of the simple KL divergence between high dimensional data and low-dimensional embedding. Because tSNE has inherent limitations, the author(s) also propose CONFETTI, a simple approach to create a distance matrix based on the distance matrices of the covariates and the input data. This produces a proper distance metric and can be used upstream of any embedding procedure. On synthetic data, the proposed methods perform to the level of ctSNE as well as a second baseline sLLE-1. However, both methods are not directly meant to solve the original problem. Only JEDI and CONFETTI may factor out continuous variations (ctSNE is designed for discrete clusters). On real world data, the method seems to effectively reorganize embeddings (either of images, or of single cells) by factoring out variations of interest.
SP:63a12d3b46928bf6fece89f1a1a51579ab162d84
Factoring out Prior Knowledge from Low-Dimensional Embeddings
1 INTRODUCTION . Embedding high dimensional data into low dimensional spaces , such as with tSNE ( van der Maaten & Hinton , 2008 ) or UMAP ( McInnes et al. , 2018 ) , allow us to visually inspect and discover meaningful structure from the data that would otherwise be difficult or impossible to see . These methods are as popular as they are useful , but , at the same time limited in that they are one-shot only : they embed the data as is , and that is that . If the resulting embedding reveals novel knowledge , all is well , but , what if the structure that dominates it is something we already know , something we are no longer interested in , or , if we want to discover whether the data has meaningful structure other than what the first result revealed ? In word embeddings , for example , we may already know that certain words are synonyms , while in single cell sequencing we may want to discover structure other than known cell types , or factor out family relationships . The question at hand is therefore , how can we obtain low-dimensional embeddings that reveal structure beyond what we already know , i.e . how to factor out prior knowledge from low-dimensional embeddings ? For conditional embeddings , research so far mostly focused on emphasizing rather than factoring out prior knowledge ( De Ridder et al. , 2003 ; Hanhijärvi et al. , 2009 ; Barshan et al. , 2011 ) , with conditional tSNE as notable exception , which , however , can only factor out label information ( Kang et al. , 2019 ) . Here , we propose two techniques for factoring out a more general form of prior knowledge from low-dimensional embeddings of arbitrary data types . In particular , we consider background knowledge in the form of pairwise distances between samples . This formulation allows us to cover a plethora of practical instances including labels , clustering structure , family trees , userdefined distances , but also , and especially important for unstructured data , kernel matrices . To factor out prior knowledge from tSNE embeddings , we propose JEDI , in which we adapt the tSNE objective in a principled way using Jensen-Shannon divergence . It has an intuitively appealing information theoretic interpretation , and maintains all the strengths and weaknesses of tSNE . One of these is runtime , which is why UMAP is particularly popular in bioinformatics . To factor out prior knowledge from embedding approaches in general , including UMAP , we hence propose CONFETTI , which directly operates on the input data . An extensive set of experiments shows that both methods work well in practice and provide embeddings that reveal meaningful structure beyond provided background knowledge , such as organizing flower images according to shape rather than color , or organizing single cell gene expression data beyond cell type , revealing batch effects and tissue type . 2 RELATED WORK . Embedding high dimensional data into a low dimensional spaces is a research topic of perennial interest that includes classic methods such as principal component analysis Pearson ( 1901 ) , multidimensional scaling ( Torgerson , 1952 ) , self organizing maps ( Kohonen , 1982 ) , and isomap ( Tenenbaum et al. , 2000 ) , all of which focus on keeping large distances intact . This is inadequate for data that lies on a manifold that resembles a Euclidean space only locally , which is the case for high dimensional data ( Silva & Tenenbaum , 2003 ) and for which we hence need methods such as locally linear embedding ( LLE ) ( Roweis & Saul , 2000 ) and stochastic neighbor embedding ( SNE ) ( Hinton & Roweis , 2003 ) that focus on keeping local distances intact . The current state of the art methods are t-distributed SNE ( tSNE ) by van der Maaten & Hinton ( 2008 ) and Uniform Manifold Approximation ( UMAP ) by McInnes et al . ( 2018 ) . Both are by now staple methods for data processing , e.g . in biology ( Becht et al. , 2019 ; Kobak & Berens , 2019 ) and NLP ( Coenen et al. , 2019 ) . As they often yield highly similar embeddings ( Kobak & Linderman , 2019 ) it is a matter of taste which one to use . While tSNE has an intuitive interpretation , despite recent optimizations ( van der Maaten , 2014 ; Linderman et al. , 2019 ) compared to UMAP it suffers from very long runtimes . Whereas the above consider only the data as is , there also exist proposals that additionally take user input and/or domain knowledge into account . For specific applications to gene expression , it was proposed to optimize projections of gene expression to model similarities in corresponding gene ontology annotations ( Peltonen et al. , 2010 ) . More recently , attention has been brought to removing unwanted variation ( RUV ) from data using negative controls in particular in the light of gene expression , assuming that the expression can be modeled as a linear function of factors of variation and a normally distributed variable ( Gagnon-Bartsch & Speed , 2012 ) . This approach has been successfully applied to different tasks and domains of gene expression ( Risso et al. , 2014 ; Buettner et al. , 2015 ; Gerstner et al. , 2016 ; Hung , 2019 ) . Here , we are interested to develop a domain independent method to obtain low-dimensional embeddings while factoring out prior knowledge . For that , we neither want to assume a functional relationship between prior and input data , nor do we want to assume a particular distribution of the input , but keep the original data manifold intact . Furthermore , we do not want to rely on negative samples that have to be known and present in the data to be able to factor out the prior . The general , domain independent methods supervised LLE ( De Ridder et al. , 2003 ) , guided LLE ( Alipanahi & Ghodsi , 2011 ) , and supervised PCA ( Barshan et al. , 2011 ) all aim to emphasize rather than factor out the structure given as prior knowledge . Like us , Kang et al . ( 2016 ; 2019 ) ; Puolamäki et al . ( 2018 ) factor out background knowledge , but are much more limited in the type of prior knowledge . In particular , Puolamäki et al . ( 2018 ) requires users to specify clusters in the embedded space , Kang et al . ( 2016 ) requires background knowledge for which a maximum entropy distribution can be obtained , while Kang et al . ( 2019 ) extend tSNE and propose conditional tSNE ( ctSNE ) which accepts prior knowledge in the form of class labels . In contract , we consider prior knowledge in the form of arbitrary distance metrics , which can capture relative relationships which appears naturally in real world data , such difference in age , geographic location , or level of gene expression . We propose both , an information theoretic extension to tSNE , and an embedding-algorithm independent approach to factor out prior knowledge . 3 THEORY . We present two approaches , with distinct properties , that both solve the problem of embedding high dimensional data while factoring out prior knowledge . We start with an informal definition of the problem , after which we introduce vanilla tSNE . We then present our first solution , JEDI , which extends the tSNE objective to incorporate prior information . We then present CONFETTI , which uses an elegant yet powerful idea that allows us to directly factor out prior knowledge from the distance matrix of the high dimensional data , which allows CONFETTI to be used in combination with any embedding algorithm that operates on distance matrices . 3.1 THE PROBLEM – INFORMALLY . Given a set of n samples X from a high dimensional space , e.g . IRd , our goal is to find a low dimensional representation Y in IR2 that captures the local structure in X while factoring out prior knowledge Z about the samples . Here , we consider both high dimensional data X and prior Z to be given as distance matrices , thus allowing for data from typical spaces such as Euclidean , but also images , up to unstructured data such as texts or graphs , for which distance matrices can be specified using a kernel . When embedding X , our goal is to embed the samples such that the pairwise low dimensional distances DY resemble high dimensional distances DX locally , but are distinct to the prior distances DZ . Informally , we can state this goal as finding an embedding Y subject to DX ≈ DY 6≈ DZ . We could formally define this as a multi-objective problem composed of a minimization over the difference between DX and DY and a maximization of the difference between DY and DZ . Besides how to measure these differences , there are two problems that render classic multi-objective optimization impractical . First , the two functions are highly imbalanced , with the minimization objective obtaining its optimum at 0 and the maximization at +∞ , hence we need to constrain the optimization . Second , we want to put emphasis on correctly reconstructing local structure , as this yields superior visualizations ( van der Maaten & Hinton , 2008 ; McInnes et al. , 2018 ) . 3.2 THE PROBLEM – INFORMATION THEORETICALLY . The t-distributed Stochastic Neighbor Embedding ( tSNE ) ( van der Maaten & Hinton , 2008 ) is a state-of-the-art approach for embedding data into low dimensional spaces that preserves the local structure of the high dimensional data . In particular , it models the local neighborhood of a point by casting the pairwise distances into similarity distributions that express for each point i the likelihood of observing point j as neighbor , given by pj|i . For the high dimensional distances DXij , this likelihood is approximated by a Gaussian kernel centered at point i pj|i = exp ( − ( DXij ) 2/2σ2i ) ∑ k 6=i exp ( − ( DXik ) 2/2σ2i ) . To account for varying densities of points in the space , the variance σi is dependent on where the kernel is centered . Given the user specified parameter perplexity , which can be thought of as an estimate of the neighborhood size , we can solve perplexity = 2H ( Pi ) for σi for each point i , where H ( Pi ) = ∑ j pj|i log pj|i is the entropy . By symmetrizing the conditional probabilities , the joint probability of a pair of points is given as pij = pj|i+pi|j 2n , which yields the desired local similarity representation of high dimensional points . The low dimensional point similarities qij are represented by a t-distribution instead of a Gaussian , which solves the crowding problem1 due to its heavy tails . We thus get low dimensional similarities qij = ( 1 + ( DYij ) 2 ) −1∑ k 6=l ( 1 + ( D Y kl ) 2 ) −1 . The goal of tSNE is to model pairs of points exhibiting a high similarity in the high dimensional space to have a high similarity in the low dimensional space . This is achieved by minimizing the Kullback-Leibler Divergence ( KL ) , given by DKL ( P || Q ) = ∑ i 6=j pij log pij qij , for the pairwise probabilities . This information theoretic measure yields the number of excess bits needed if we would encode P using a code optimal for encoding Q and thus models how well Q approximates P . Minimizing the KL divergence with respect to Y , we get a non-convex objective that we can practically optimize using gradient descent . Using a similar notion of neighborhood distributions , we can now define a new objective that instantiates our objective using tools from information theory .
The distance metric learned by low-dimensional embeddings typically captures the knowledge that we already know. This paper proposes a principled way of factoring out prior knowledge (in the form of distance matrices) from tSNE and UMAP embeddings. Two algorithms are proposed for factoring out prior knowledge. JEDI (for tSNE embeds) uses a parameterized JS divergence-- the objective is to learn a low-dimensional distance metric that preserves high-dimensional distances but is orthogonal to the prior distance matrix. CONFETTI is the second algorithm which also optimizes a similar objective to JEDI but doesn't employ JS divergence and is algorithm independent, so one can use it for tSNE or UMAP. Results are shown on synthetic and real-world flower and cell-sequencing data and they highlight the superior ability of JEDI and CONFETTI algorithms in factoring-out prior knowledge compared to the baselines.
SP:63a12d3b46928bf6fece89f1a1a51579ab162d84
Federated Averaging as Expectation Maximization
1 INTRODUCTION . Smart devices have become ubiquitous in today ’ s world and are generating large amounts of potentially sensitive data . Traditionally , such data is transmitted and stored in a central location for training machine learning models . Such methods rightly raise privacy concerns and we seek the means for training powerful models , such as neural networks , without the need to transmit potentially sensitive data . To this end , Federated Learning ( FL ) ( McMahan et al. , 2016 ) has been proposed to train global machine learning models without the need for participating devices to transmit their data to the server . The Federated Averaging ( FedAvg ) ( McMahan et al. , 2016 ) algorithm communicates the parameters of the machine learning model instead of the data itself , which is a more private means of communication . The FedAvg algorithm was originally proposed through empirical observations . While it can be shown that it converges ( Li et al. , 2019 ) , its theoretical understanding in terms of the model assumptions as well as the underlying objective function is still not well understood . The first contribution of this work improves our understanding of FedAvg ; we show that FedAvg can be derived by applying the general Expectation-Maximization ( EM ) framework to a simple hierarchical model . This novel view has several interesting consequences : it sheds light on the algorithmic choices of FedAvg , bridges FedAvg with meta-learning , connects several extensions of FedAvg and provides fruitful ground for future extensions . Apart from theoretical grounding , the FL scenario poses several practical challenges , especially in the “ cross-device ” setting ( Kairouz et al. , 2019 ) that we consider in this work . In particular , communicating model updates over multiple rounds across a large amount of devices can incur significant communication costs . Communication via the public internet infrastructure and mobile networks is potentially slow and not for free . Equally important , training ( and inference ) takes place on-device and is therefore restricted by the edge-devices ’ hardware constraints on memory , speed and heat dissipation capabilities . Therefore , jointly addressing both of these issues is an important step towards building practical FL systems , as also discussed in Kairouz et al . ( 2019 ) . Through the novel EM view of FedAvg that we introduce , we develop our second contribution , FedSparse . FedSparse allows for learning sparse models at the client and server via a careful choice of priors within the hierarchical model . As a result , it tackles the aforementioned challenges , since it can simultaneously reduce the overall communication and computation at the client devices . Empirically , FedSparse provides better communication-accuracy trade-offs compared to both FedAvg as well as methods proposed for similar reasons ( Caldas et al. , 2018 ) . 2 FEDAVG THROUGH THE LENS OF EM The FedAvg algorithm is a simple iterative procedure realized in four simple steps . At the beginning of each round t , the server communicates the model parameters , let them be w , to a subset of the devices . The devices then proceed to optimize w , e.g. , via stochastic gradient descent , on their respective dataset via a given loss function Ls ( Ds , w ) : = 1 Ns Ns∑ i=1 L ( Dsi , w ) ( 1 ) where s indexes the device , Ds corresponds to the dataset at device s and Ns corresponds to its size . After a specific amount of epochs of optimization on Ls is performed , denoted as E , the devices communicate the current state of their parameters , let it be φs , to the server . The server then performs an update to its own model by simply averaging the client specific parameters wt = 1S ∑ s φs . 2.1 THE CONNECTION TO EM . We now ask the following question ; does the overall algorithm correspond to a specific optimization procedure on a given objective function ? Let us consider the following objective function : argmax w 1 S S∑ s=1 log p ( Ds|w ) , ( 2 ) where Ds corresponds to the shard specific dataset that has Ns datapoints , p ( Ds|w ) corresponds to the likelihood of Ds under the server parameters w. Now consider decomposing each of the shard specific likelihoods as follows : p ( Ds|w ) = ∫ p ( Ds|φs ) p ( φs|w ) dφs , p ( φs|w ) ∝ exp ( −λ 2 ‖φs −w‖2 ) , ( 3 ) where we introduced the auxiliary latent variables φs , which are the parameters of the local model at shard s. The server parameters w act as “ hyperparameters ” for the prior over the shard specific parameters and λ acts as a regularization strength that prevents φs from moving too far from w. How can we then optimize the resulting objective in the presence of these latent variables φs ? The traditional way to optimize such objectives is through Expectation-Maximization ( EM ) . EM consists of two steps , the E-step where we form the posterior distribution over these latent variables p ( φs|Ds , w ) = p ( Ds|φs ) p ( φs|w ) p ( Ds|w ) , ( 4 ) and the M-step where we maximize the probability of Ds w.r.t . the parameters of the model w by marginalizing over this posterior argmax w 1 S ∑ s Ep ( φs|Ds , wold ) [ log p ( Ds|φs ) + log p ( φs|w ) ] = argmax w 1 S ∑ s Ep ( φs|Ds , wold ) [ log p ( φs|w ) ] . ( 5 ) If we perform a single gradient step for w in the M-step , this procedure corresponds to doing gradient ascent on the original objective , a fact we show in Appendix D. When posterior inference is intractable , hard-EM is sometimes employed . In this case we make “ hard ” assignment for the latent variables φs in the E-step by approximating p ( φs|Ds , w ) with its most probable point , i.e . φ∗s = argmax φs p ( Ds|φs ) p ( φs|w ) p ( Ds|w ) = argmax φs log p ( Ds|φs ) + log p ( φs|w ) . ( 6 ) This is usually easier to do as we can use techniques such as stochastic gradient ascent . Given these hard assignments , the M-step then corresponds to another simple maximization argmaxw 1 S ∑ s log p ( φ ∗ s|w ) . As a result , hard-EM corresponds to a block coordinate ascent type of algorithm on the following objective function argmax φ1 : S , w 1 S ∑ s ( log p ( Ds|φs ) + log p ( φs|w ) ) , ( 7 ) where we alternate between optimizing φ1 : S and w while keeping the other fixed . How is this framework the same as FedAvg ? By letting λ → 0 in Eq . 3 it is clear that the hard assignments in the E-step mimic the process of optimizing a local model on the data of each shard . In fact , even by optimizing the model locally with stochastic gradient ascent for a fixed number of iterations with a given learning rate we implicitly assume a specific prior over the parameters ; for linear regression , this prior is a Gaussian centered at the initial value of the parameters ( Santos , 1996 ) whereas for non-linear models it bounds the distance from the initial point . After obtaining φ∗s the M-step then corresponds to argmaxw Lr : = 1S ∑ s− λ 2 ‖φ ∗ s −w‖2 , and we can easily find a closed form solution by setting the derivative of the objective w.r.t . w to zero and solving for w : ∂Lr ∂w = 0⇒ λ S ∑ s ( φ∗s −w ) = 0⇒ w = 1 S ∑ s φ∗s . ( 8 ) It is easy to see that the optimal solution for w given φ∗1 : S is the same as the one from FedAvg . Of course , FedAvg does not optimize the local parameters φs to convergence at each round , so one might wonder whether the correspondence to EM is still valid . It turns out that the alternating procedure of EM corresponds to block coordinate ascent on a single objective function , the variational lower bound of the marginal log-likelihood ( Neal & Hinton , 1998 ) of a given model . More specifically for our setting , we can see that the EM iterations perform block coordinate ascent to optimize : argmax w1 : S , w 1 S ∑ s Eqws ( φs ) [ log p ( Ds|φs ) + log p ( φs|w ) ] +H [ qws ( φs ) ] ( 9 ) where ws are the parameters of the variational approximation to the posterior distribution p ( φs|Ds , w ) and H [ q ] corresponds to the entropy of the q distribution . To obtain the procedure of FedAvg we can use a ( numerically ) deterministic distribution for φs , qws ( φs ) : = N ( ws , I ) . This leads us to the same objective as in Eq . 7 , since the expectation concentrates on a single term and the entropy of qws ( φs ) becomes a constant independent of the optimization . In this case , the optimized value for φs after a fixed number of steps corresponds to the ws of the variational approximation . It is interesting to contrast recent literature under the lens of this framework . Optimizing the same hierarchical model with hard-EM but with a non-trivial λ results into the same procedure that was proposed by Li et al . ( 2018 ) . Furthermore , using the difference of the local parameters to the global parameters as a “ gradient ” ( Reddi et al. , 2020 ) is equivalent to hard-EM on the same model where in the M-step we take a single gradient step . In addition , this view makes precise the idea that FedAvg is a meta-learning algorithm ( Jiang et al. , 2019 ) ; the underlying hierarchical model we optimize is similar to the ones used in meta-learning ( Grant et al. , 2018 ; Chen et al. , 2019 ) . How can we then use this novel view of FedAvg to our advantage ? The most straightforward way is to use an alternative prior which would result into different behaviours in local training and server side updating . For example , one could use a Laplace prior , which would result into the server selecting the median instead of averaging , or a mixture of Gaussians prior , which would result into training an ensemble of models at the server . In order to tackle the communication and computational costs , which is important for “ cross-device ” FL , we chose a sparsity inducing prior , namely the spike and slab prior . We describe the resulting algorithm , FedSparse , in the next section . 3 THE FEDSPARSE ALGORITHM : SPARSITY IN FEDERATED LEARNING Encouraging sparsity in FL has two main advantages ; the model becomes smaller and less resource intensive to train and furthermore , it cuts down on communication costs as the pruned parameters do not need to be communicated . The golden standard for sparsity in probabilistic models is the spike and slab ( Mitchell & Beauchamp , 1988 ) prior . It is a mixture of two components , a delta spike at zero , δ ( 0 ) , and a continuous distribution over the real line , i.e . the slab . More specifically , by adopting a Gaussian slab for each local parameter φsi we have that p ( φsi|θi , wi ) = ( 1− θi ) δ ( 0 ) + θiN ( φsi|wi , 1/λ ) , ( 10 ) or equivalently as a hierarchical model p ( φsi|θi , wi ) = ∑ zsi p ( zsi|θi ) p ( φsi|zsi , wi ) , p ( zsi ) = Bern ( θi ) , ( 11 ) p ( φsi|zsi = 1 , wi ) = N ( φsi|wi , 1/λ ) , p ( φsi|zsi = 0 ) = δ ( 0 ) , ( 12 ) where zsi plays the role of a “ gating ” variable that switches on or off the parameter φsi . Now consider using this distribution for the prior over the parameters in the federated setting . w , θ will be the server side model weights and probabilities of the binary gates . In order to stay close to the FedAvg paradigm of simple point estimation and since approximate inference for complex posteriors , such as those that arise in neural networks , is still an open problem , we will perform hard-EM in order to optimize w , θ . By using approximate distributions qws ( φs|zs ) , qπs ( zs ) , the variational lower bound for this model becomes argmax w1 : S , w , π1 : S , θ 1 S ∑ s Eqπs ( zs ) qws ( φs|zs ) [ log p ( Ds|φs ) + log p ( φs|w , zs ) + log p ( zs|θ ) − log qws ( φs|zs ) ] +H [ qπs ( zs ) ] . ( 13 ) For the shard specific weight distributions , as they are continuous , we will use qws ( φsi|zsi = 1 ) : = N ( wsi , ) , q ( φsi|zsi = 1 ) : = N ( 0 , ) with ≈ 0 which will be , numerically speaking , deterministic . For the gating variables , as they are binary , we will use qπsi ( zsi ) : = Bern ( πsi ) with πsi being the probability of activating local gate zsi . In order to do hard-EM for the binary variables , we will remove the entropy term for the qπs ( zs ) from the aforementioned bound as this will encourage the approximate distribution to move towards the most probable value for zs . Furthermore , by relaxing the spike at zero to a Gaussian with precision λ2 , i.e. , p ( φsi|zsi = 0 ) = N ( 0 , 1/λ2 ) , and by plugging in the appropriate expressions into Eq . 13 we can show that the local and global objectives will be argmax ws , πs Ls ( Ds , w , θ , ws , πs ) : = Eqπs ( zs ) [ Ns∑ i L ( Dsi , ws zs ) ] − λ 2 ∑ j πsj ( wsj −wj ) 2 − λ0 ∑ j πsj + ∑ j ( πsj log θj + ( 1− πsj ) log ( 1− θj ) ) + C , ( 14 ) argmax w , θ L : = 1 S S∑ s=1 Ls ( Ds , w , θ , ws , πs ) ( 15 ) respectively , where λ0 = 12 log λ2 λ and C is a constant independent of the variables to be optimized . The derivation can be found at Appendix E. It is interesting to see that the final objective at each shard intuitively tries to find a trade-off between four things : 1 ) explaining the local dataset Ds , 2 ) having the local weights close to the server weights ( regulated by λ ) , 3 ) having the local gate probabilities close to the server probabilities and 4 ) reducing the local gate activation probabilities so as to prune away a parameter ( regulated by λ0 ) . The latter is an L0 regularization term , akin to the one proposed by Louizos et al . ( 2017 ) . Now let us consider what happens at the server after the local shard , through some procedure , optimized ws and πs . Since the server loss for w , θ is the sum of all local losses , the gradient for each of the parameters will be ∂L ∂w = ∑ s λπs ( ws −w ) , ∂L ∂θ = ∑ s ( πs θ − 1− πs 1− θ ) . ( 16 ) Setting these derivatives to zero , we see that the stationary points are w = 1∑ j πj ∑ s πsws , θ = 1 S ∑ s πs ( 17 ) i.e. , a weighted average of the local weights and an average of the local probabilities of keeping these weights . Therefore , since the πs are being optimized to be sparse through the L0 penalty , the server probabilities θ will also become small for the weights that are used by only a small fraction of the shards . As a result , to obtain the final sparse architecture , we can prune the weights whose corresponding server inclusion probabilities θ are less than a threshold , e.g. , 0.1 . It should be noted that the sums and averages of Eq . 16 , 17 respectively can be easily approximated by subsampling a small set of clients S′ from S. Therefore we do not have to consider all of the clients at each round , which would be prohibitive for the “ cross-device ” setting of FL .
Federated learning has emerged as a promising approach to training models at the edge devices. This paper makes an observation that most algorithms used within federated learning, including the popular FedAvg, could be cast as instances of EM methods. The paper then continues to propose FedSparse, a federated learning framework imposing sparse priors (specifically Bernoulli-Gaussian priors), and concludes with some experimental results on FedSparse.
SP:0a93f0ca52d6a7b39a82c3a9e3199255a4fa4c84
Federated Averaging as Expectation Maximization
1 INTRODUCTION . Smart devices have become ubiquitous in today ’ s world and are generating large amounts of potentially sensitive data . Traditionally , such data is transmitted and stored in a central location for training machine learning models . Such methods rightly raise privacy concerns and we seek the means for training powerful models , such as neural networks , without the need to transmit potentially sensitive data . To this end , Federated Learning ( FL ) ( McMahan et al. , 2016 ) has been proposed to train global machine learning models without the need for participating devices to transmit their data to the server . The Federated Averaging ( FedAvg ) ( McMahan et al. , 2016 ) algorithm communicates the parameters of the machine learning model instead of the data itself , which is a more private means of communication . The FedAvg algorithm was originally proposed through empirical observations . While it can be shown that it converges ( Li et al. , 2019 ) , its theoretical understanding in terms of the model assumptions as well as the underlying objective function is still not well understood . The first contribution of this work improves our understanding of FedAvg ; we show that FedAvg can be derived by applying the general Expectation-Maximization ( EM ) framework to a simple hierarchical model . This novel view has several interesting consequences : it sheds light on the algorithmic choices of FedAvg , bridges FedAvg with meta-learning , connects several extensions of FedAvg and provides fruitful ground for future extensions . Apart from theoretical grounding , the FL scenario poses several practical challenges , especially in the “ cross-device ” setting ( Kairouz et al. , 2019 ) that we consider in this work . In particular , communicating model updates over multiple rounds across a large amount of devices can incur significant communication costs . Communication via the public internet infrastructure and mobile networks is potentially slow and not for free . Equally important , training ( and inference ) takes place on-device and is therefore restricted by the edge-devices ’ hardware constraints on memory , speed and heat dissipation capabilities . Therefore , jointly addressing both of these issues is an important step towards building practical FL systems , as also discussed in Kairouz et al . ( 2019 ) . Through the novel EM view of FedAvg that we introduce , we develop our second contribution , FedSparse . FedSparse allows for learning sparse models at the client and server via a careful choice of priors within the hierarchical model . As a result , it tackles the aforementioned challenges , since it can simultaneously reduce the overall communication and computation at the client devices . Empirically , FedSparse provides better communication-accuracy trade-offs compared to both FedAvg as well as methods proposed for similar reasons ( Caldas et al. , 2018 ) . 2 FEDAVG THROUGH THE LENS OF EM The FedAvg algorithm is a simple iterative procedure realized in four simple steps . At the beginning of each round t , the server communicates the model parameters , let them be w , to a subset of the devices . The devices then proceed to optimize w , e.g. , via stochastic gradient descent , on their respective dataset via a given loss function Ls ( Ds , w ) : = 1 Ns Ns∑ i=1 L ( Dsi , w ) ( 1 ) where s indexes the device , Ds corresponds to the dataset at device s and Ns corresponds to its size . After a specific amount of epochs of optimization on Ls is performed , denoted as E , the devices communicate the current state of their parameters , let it be φs , to the server . The server then performs an update to its own model by simply averaging the client specific parameters wt = 1S ∑ s φs . 2.1 THE CONNECTION TO EM . We now ask the following question ; does the overall algorithm correspond to a specific optimization procedure on a given objective function ? Let us consider the following objective function : argmax w 1 S S∑ s=1 log p ( Ds|w ) , ( 2 ) where Ds corresponds to the shard specific dataset that has Ns datapoints , p ( Ds|w ) corresponds to the likelihood of Ds under the server parameters w. Now consider decomposing each of the shard specific likelihoods as follows : p ( Ds|w ) = ∫ p ( Ds|φs ) p ( φs|w ) dφs , p ( φs|w ) ∝ exp ( −λ 2 ‖φs −w‖2 ) , ( 3 ) where we introduced the auxiliary latent variables φs , which are the parameters of the local model at shard s. The server parameters w act as “ hyperparameters ” for the prior over the shard specific parameters and λ acts as a regularization strength that prevents φs from moving too far from w. How can we then optimize the resulting objective in the presence of these latent variables φs ? The traditional way to optimize such objectives is through Expectation-Maximization ( EM ) . EM consists of two steps , the E-step where we form the posterior distribution over these latent variables p ( φs|Ds , w ) = p ( Ds|φs ) p ( φs|w ) p ( Ds|w ) , ( 4 ) and the M-step where we maximize the probability of Ds w.r.t . the parameters of the model w by marginalizing over this posterior argmax w 1 S ∑ s Ep ( φs|Ds , wold ) [ log p ( Ds|φs ) + log p ( φs|w ) ] = argmax w 1 S ∑ s Ep ( φs|Ds , wold ) [ log p ( φs|w ) ] . ( 5 ) If we perform a single gradient step for w in the M-step , this procedure corresponds to doing gradient ascent on the original objective , a fact we show in Appendix D. When posterior inference is intractable , hard-EM is sometimes employed . In this case we make “ hard ” assignment for the latent variables φs in the E-step by approximating p ( φs|Ds , w ) with its most probable point , i.e . φ∗s = argmax φs p ( Ds|φs ) p ( φs|w ) p ( Ds|w ) = argmax φs log p ( Ds|φs ) + log p ( φs|w ) . ( 6 ) This is usually easier to do as we can use techniques such as stochastic gradient ascent . Given these hard assignments , the M-step then corresponds to another simple maximization argmaxw 1 S ∑ s log p ( φ ∗ s|w ) . As a result , hard-EM corresponds to a block coordinate ascent type of algorithm on the following objective function argmax φ1 : S , w 1 S ∑ s ( log p ( Ds|φs ) + log p ( φs|w ) ) , ( 7 ) where we alternate between optimizing φ1 : S and w while keeping the other fixed . How is this framework the same as FedAvg ? By letting λ → 0 in Eq . 3 it is clear that the hard assignments in the E-step mimic the process of optimizing a local model on the data of each shard . In fact , even by optimizing the model locally with stochastic gradient ascent for a fixed number of iterations with a given learning rate we implicitly assume a specific prior over the parameters ; for linear regression , this prior is a Gaussian centered at the initial value of the parameters ( Santos , 1996 ) whereas for non-linear models it bounds the distance from the initial point . After obtaining φ∗s the M-step then corresponds to argmaxw Lr : = 1S ∑ s− λ 2 ‖φ ∗ s −w‖2 , and we can easily find a closed form solution by setting the derivative of the objective w.r.t . w to zero and solving for w : ∂Lr ∂w = 0⇒ λ S ∑ s ( φ∗s −w ) = 0⇒ w = 1 S ∑ s φ∗s . ( 8 ) It is easy to see that the optimal solution for w given φ∗1 : S is the same as the one from FedAvg . Of course , FedAvg does not optimize the local parameters φs to convergence at each round , so one might wonder whether the correspondence to EM is still valid . It turns out that the alternating procedure of EM corresponds to block coordinate ascent on a single objective function , the variational lower bound of the marginal log-likelihood ( Neal & Hinton , 1998 ) of a given model . More specifically for our setting , we can see that the EM iterations perform block coordinate ascent to optimize : argmax w1 : S , w 1 S ∑ s Eqws ( φs ) [ log p ( Ds|φs ) + log p ( φs|w ) ] +H [ qws ( φs ) ] ( 9 ) where ws are the parameters of the variational approximation to the posterior distribution p ( φs|Ds , w ) and H [ q ] corresponds to the entropy of the q distribution . To obtain the procedure of FedAvg we can use a ( numerically ) deterministic distribution for φs , qws ( φs ) : = N ( ws , I ) . This leads us to the same objective as in Eq . 7 , since the expectation concentrates on a single term and the entropy of qws ( φs ) becomes a constant independent of the optimization . In this case , the optimized value for φs after a fixed number of steps corresponds to the ws of the variational approximation . It is interesting to contrast recent literature under the lens of this framework . Optimizing the same hierarchical model with hard-EM but with a non-trivial λ results into the same procedure that was proposed by Li et al . ( 2018 ) . Furthermore , using the difference of the local parameters to the global parameters as a “ gradient ” ( Reddi et al. , 2020 ) is equivalent to hard-EM on the same model where in the M-step we take a single gradient step . In addition , this view makes precise the idea that FedAvg is a meta-learning algorithm ( Jiang et al. , 2019 ) ; the underlying hierarchical model we optimize is similar to the ones used in meta-learning ( Grant et al. , 2018 ; Chen et al. , 2019 ) . How can we then use this novel view of FedAvg to our advantage ? The most straightforward way is to use an alternative prior which would result into different behaviours in local training and server side updating . For example , one could use a Laplace prior , which would result into the server selecting the median instead of averaging , or a mixture of Gaussians prior , which would result into training an ensemble of models at the server . In order to tackle the communication and computational costs , which is important for “ cross-device ” FL , we chose a sparsity inducing prior , namely the spike and slab prior . We describe the resulting algorithm , FedSparse , in the next section . 3 THE FEDSPARSE ALGORITHM : SPARSITY IN FEDERATED LEARNING Encouraging sparsity in FL has two main advantages ; the model becomes smaller and less resource intensive to train and furthermore , it cuts down on communication costs as the pruned parameters do not need to be communicated . The golden standard for sparsity in probabilistic models is the spike and slab ( Mitchell & Beauchamp , 1988 ) prior . It is a mixture of two components , a delta spike at zero , δ ( 0 ) , and a continuous distribution over the real line , i.e . the slab . More specifically , by adopting a Gaussian slab for each local parameter φsi we have that p ( φsi|θi , wi ) = ( 1− θi ) δ ( 0 ) + θiN ( φsi|wi , 1/λ ) , ( 10 ) or equivalently as a hierarchical model p ( φsi|θi , wi ) = ∑ zsi p ( zsi|θi ) p ( φsi|zsi , wi ) , p ( zsi ) = Bern ( θi ) , ( 11 ) p ( φsi|zsi = 1 , wi ) = N ( φsi|wi , 1/λ ) , p ( φsi|zsi = 0 ) = δ ( 0 ) , ( 12 ) where zsi plays the role of a “ gating ” variable that switches on or off the parameter φsi . Now consider using this distribution for the prior over the parameters in the federated setting . w , θ will be the server side model weights and probabilities of the binary gates . In order to stay close to the FedAvg paradigm of simple point estimation and since approximate inference for complex posteriors , such as those that arise in neural networks , is still an open problem , we will perform hard-EM in order to optimize w , θ . By using approximate distributions qws ( φs|zs ) , qπs ( zs ) , the variational lower bound for this model becomes argmax w1 : S , w , π1 : S , θ 1 S ∑ s Eqπs ( zs ) qws ( φs|zs ) [ log p ( Ds|φs ) + log p ( φs|w , zs ) + log p ( zs|θ ) − log qws ( φs|zs ) ] +H [ qπs ( zs ) ] . ( 13 ) For the shard specific weight distributions , as they are continuous , we will use qws ( φsi|zsi = 1 ) : = N ( wsi , ) , q ( φsi|zsi = 1 ) : = N ( 0 , ) with ≈ 0 which will be , numerically speaking , deterministic . For the gating variables , as they are binary , we will use qπsi ( zsi ) : = Bern ( πsi ) with πsi being the probability of activating local gate zsi . In order to do hard-EM for the binary variables , we will remove the entropy term for the qπs ( zs ) from the aforementioned bound as this will encourage the approximate distribution to move towards the most probable value for zs . Furthermore , by relaxing the spike at zero to a Gaussian with precision λ2 , i.e. , p ( φsi|zsi = 0 ) = N ( 0 , 1/λ2 ) , and by plugging in the appropriate expressions into Eq . 13 we can show that the local and global objectives will be argmax ws , πs Ls ( Ds , w , θ , ws , πs ) : = Eqπs ( zs ) [ Ns∑ i L ( Dsi , ws zs ) ] − λ 2 ∑ j πsj ( wsj −wj ) 2 − λ0 ∑ j πsj + ∑ j ( πsj log θj + ( 1− πsj ) log ( 1− θj ) ) + C , ( 14 ) argmax w , θ L : = 1 S S∑ s=1 Ls ( Ds , w , θ , ws , πs ) ( 15 ) respectively , where λ0 = 12 log λ2 λ and C is a constant independent of the variables to be optimized . The derivation can be found at Appendix E. It is interesting to see that the final objective at each shard intuitively tries to find a trade-off between four things : 1 ) explaining the local dataset Ds , 2 ) having the local weights close to the server weights ( regulated by λ ) , 3 ) having the local gate probabilities close to the server probabilities and 4 ) reducing the local gate activation probabilities so as to prune away a parameter ( regulated by λ0 ) . The latter is an L0 regularization term , akin to the one proposed by Louizos et al . ( 2017 ) . Now let us consider what happens at the server after the local shard , through some procedure , optimized ws and πs . Since the server loss for w , θ is the sum of all local losses , the gradient for each of the parameters will be ∂L ∂w = ∑ s λπs ( ws −w ) , ∂L ∂θ = ∑ s ( πs θ − 1− πs 1− θ ) . ( 16 ) Setting these derivatives to zero , we see that the stationary points are w = 1∑ j πj ∑ s πsws , θ = 1 S ∑ s πs ( 17 ) i.e. , a weighted average of the local weights and an average of the local probabilities of keeping these weights . Therefore , since the πs are being optimized to be sparse through the L0 penalty , the server probabilities θ will also become small for the weights that are used by only a small fraction of the shards . As a result , to obtain the final sparse architecture , we can prune the weights whose corresponding server inclusion probabilities θ are less than a threshold , e.g. , 0.1 . It should be noted that the sums and averages of Eq . 16 , 17 respectively can be easily approximated by subsampling a small set of clients S′ from S. Therefore we do not have to consider all of the clients at each round , which would be prohibitive for the “ cross-device ” setting of FL .
The paper proposes to re-interpret federated averaging (FedAvg) as a version of the expectation-maximization (EM) algorithm under a particular probabilistic model. Further, the authors propose to use spike-and-slab sparsity inducing priors over the local model parameters to sparsify the learned models (the corresponding method is called FedSparse), which naturally reduces the communication cost (only non-zero parameters need to be sent over the network). Improvement in communication efficiency is showcased on a few standard federated datasets.
SP:0a93f0ca52d6a7b39a82c3a9e3199255a4fa4c84
Unsupervised Video Decomposition using Spatio-temporal Iterative Inference
1 INTRODUCTION . Unsupervised representation learning , which has a long history dating back to Boltzman Machines ( Hinton & Sejnowski , 1986 ) and original works of Marr ( 1970 ) , has recently emerged as one of the important directions of research , carrying the newfound promise of alleviating the need for excessively large and fully labeled datasets . More traditional representation learning approaches focus on unsupervised ( e.g. , autoencoder-based ( Pathak et al. , 2016 ; Vincent et al. , 2008 ) ) or selfsupervised ( Noroozi & Favaro , 2016 ; Vondrick et al. , 2016 ; Zhang et al. , 2016 ) learning of holistic representations that , for example , are tasked with producing ( spatial ( Noroozi & Favaro , 2016 ) , temporal ( Vondrick et al. , 2016 ) , or color ( Zhang et al. , 2016 ) ) encodings of images or patches . The latest and most successful methods along these lines include ViLBERT ( Lu et al. , 2019 ) and others ( Sun et al. , 2019 ; Tan & Bansal , 2019 ) that utilize powerful transformer architectures ( Vaswani et al. , 2017 ) coupled with proxy multi-modal tasks ( e.g. , masked token prediction or visua-lingual alignment ) . Learning of good disentangled , spatially granular , representations that are , for example , able to decouple object appearance and shape in complex visual scenes consisting of multiple moving objects remains elusive . Recent works that attempt to address this challenge can be characterized as : ( i ) attention-based methods ( Crawford & Pineau , 2019b ; Eslami et al. , 2016 ) , which infer latent representations for each object in a scene , and ( ii ) iterative refinement models ( Greff et al. , 2019 ; 2017 ) , which decompose a scene into a collection of components by grouping pixels . Importantly , the former have been limited to latent representations at object- or image patch-levels , while the latter class of models have illustrated the ability for more granular latent representations at the pixel ( segmentation ) -level . Specifically , most refinement models learn pixel-level generative models driven by spatial mixtures ( Greff et al. , 2017 ) and utilize amortized iterative refinements ( Marino et al. , 2018 ) for inference of disentangled latent representations within the VAE framework ( Kingma & Welling , 2014 ) ; a prime example is IODINE ( Greff et al. , 2019 ) . However , while providing a powerful model and abstraction which is able to segment and disentangle complex scenes , IODINE ( Greff et al. , 2019 ) and other similar architectures are fundamentally limited by the fact that they only consider images . Even when applied for inference in video , they process one frame at a time . This makes it excessively challenging to discover and represent individual instances of objects that may share properties such as appearance and shape but differ in dynamics . In computer vision , it has been a long-held belief that motion carries important information for segmenting objects ( Jepson et al. , 2002 ; Weiss & Adelson , 1996 ) . Armed with this intuition , we propose a spatio-temporal amortized inference model capable of not only unsupervised multi-object scene decomposition , but also of learning and leveraging the implicit probabilistic dynamics of each object from perspective raw video alone . This is achieved by introducing temporal dependencies between the latent variables across time . As such , IODINE ( Greff et al. , 2019 ) could be considered a special ( spatial ) case of our spatio-temporal formulation . Modeling temporal dependencies among video frames also allows us to make use of conditional priors ( Chung et al. , 2015 ) for variational inference , leading to more accurate and efficient inference results . The resulting model , illustrated in Fig . 1 , achieves superior performance on complex multi-object benchmark datasets ( Bouncing Balls and CLEVRER ) with respect to state-of-the-art models , including R-NEM ( Van Steenkiste et al. , 2018 ) and IODINE ( Greff et al. , 2019 ) in terms of segmentation , prediction , and generalization . Our model has a number of appealing properties , including temporal extrapolation , computational efficiency , and the ability to work with complex data exhibiting non-linear dynamics , colors , and changing number of objects within the same video sequence . In addition , we introduce an entropy prior to improve our model ’ s performance in scenarios where object appearance alone is not sufficiently distinctive ( e.g. , greyscale data ) . 2 RELATED WORK . Unsupervised Scene Representation Learning . Unsupervised scene representation learning can generally be divided into two groups : attention-based methods , which infer latent representations for each object in a scene , and more complex and powerful iterative refinement models , which often make use of spatial mixtures and can decompose a scene into a collection of estimated components by grouping pixels together . Attention-based methods , such as AIR ( Eslami et al. , 2016 ) ( Xu et al. , 2019 ) and SPAIR ( Crawford & Pineau , 2019b ) , decompose scenes into latent variables representing the appearance , position , and size of the underlying objects . However , both methods can only infer the objects ’ bounding boxes and have not been shown to work on non-trivial 3D scenes with perspective distortions and occlusions . MoNet ( Burgess et al. , 2019 ) is the first model in this family tackling more complex data and inferring representations that can be used for instance segmentation of objects . On the other hand , it is not a probabilistic generative model and thus not suitable for density estimation . GENESIS ( Engelcke et al. , 2020 ) extends it and alleviates some of its limitations by introducing a probabilistic framework and allowing for spatial relations between the objects . DDPAE ( Hsieh et al. , 2018 ) is a framework that uses structured probabilistic models to decompose a video into low-dimensional temporal dynamics with the sole purpose of prediction . It is shown to operate on binary scenes with no perspective distortion and is not capable of generating per-object segmentation masks . Iterative refinement models started with Tagger ( Greff et al. , 2016 ) that reasons about the segmentation of its inputs . However , it does not allow explicit latent representations and can not be scaled to more complex images . NEM ( Greff et al. , 2017 ) , as an extension of Tagger , uses a spatial mixture model inside an expectation maximization framework , but is limited to binary data . Finally , IODINE ( Greff et al. , 2019 ) is a notable example of a model employing iterative amortized inference w.r.t . a spatial mixture formulation and achieves state-of-the-art performance in scene decomposition and segmentation . Unsupervised Video Tracking and Object Detection . SQAIR ( Kosiorek et al. , 2018 ) , SILOT ( Crawford & Pineau , 2019a ) and SCALOR ( Jiang et al. , 2020 ) are temporal extensions of the static attention-based models that are tailored to tracking and object detection tasks . SQAIR is restricted to binary data and operates at the level of bounding boxes . SILOT and SCALOR are more expressive and can cope with cluttered scenes , a larger numbers of objects , and dynamic backgrounds , but do not work on colored perspective1 data ; accurate segmentation remains a challenge . Unsupervised Video Decomposition and Segmentation . Models employing spatial mixtures and iterative inference in a temporal setting are closest to our method from a technical perspective . Notably , there are only few models falling into this line of work : RTagger ( Prémont-Schwarz et al. , 2017 ) is a recurrent extension of Tagger and has same limitations as its predecessor . R-NEM ( Van Steenkiste et al. , 2018 ) effectively learns the objects ’ dynamics and interactions through a relational module and can produce segmentations but is limited to orthographic binary data . Methods without Latent Modeling . GAN-based ReDO ( Chen et al. , 2019 ) uses a model built around the assumption that object regions are independent , guiding the generator by drawing objects ’ pixel regions separately and composing them after segmentation . Another model ( Arandjelović & Zisserman , 2019 ) employs the same principles but guide the generator by copying a region of an image into another one . Both architectures are shown to operate on static images only and do not have a clearly interpretable latent space or prediction capabilities . Our method allows an effective use of temporal information in object-centric decompositions of colored video data . This places our approach between methods like R-NEM , which strictly operates on binary data , and IODINE , whose usage of temporal information is ad-hoc and produces results of limited quality ( Table 1 ) . In practice , we leverage a 2D-LSTM and employ an implicit modeling of dynamics by incorporating the hidden states into a conditional prior in the efficient runtime manner . 3 DYNAMIC VIDEO DECOMPOSITION . We now introduce our dynamic model for unsupervised video decomposition . Our approach builds upon a generative model of multi-object representations and leverages elements of iterative amortized inference . We briefly review both concepts ( §3.1 ) and then introduce our model ( §3.2 ) . 3.1 BACKGROUND . Multi-Object Representations . The multi-object framework introduced in Greff et al . ( 2019 ) decomposes a static image x = ( xi ) i ∈ RD into K objects ( including background ) . Each object is represented by a latent vector z ( k ) ∈ RM capturing the object ’ s unique appearance and can be thought of as an encoding of common visual properties , such as color , shape , position , and size . For each z ( k ) independently , a broadcast decoder ( Watters et al. , 2019 ) generates pixelwise pairs ( m ( k ) i , µ ( k ) i ) describing the assignment probability and appearance of pixel i for object k. Together , they induce the generative image formation model p ( x|z ) = D∏ i=1 K∑ k=1 m ( k ) i N ( xi ; µ ( k ) i , σ 2 ) , ( 1 ) where z = ( z ( k ) ) k , ∑K k=1m ( k ) i = 1 and σ is the same and fixed for all i and k. The original image pixels can be reconstructed from this probabilistic representation as x̃i = ∑K k=1m ( k ) i µ ( k ) i . Iterative Amortized Inference . Our approach leverages the iterative amortized inference framework ( Marino et al. , 2018 ) , which uses the learning to learn principle ( Andrychowicz et al. , 2016 ) to close the amortization gap ( Cremer et al. , 2017 ) typically observed in traditional variational inference . The need for such an iterative process arises due to the multi-modality of Eq . ( 1 ) , which results in an order invariance and assignment ambiguity in the approximate posterior that standard variational inference can not overcome ( Greff et al. , 2019 ) . The idea of amortized iterative inference is to start with randomly guessed parameters λ ( k ) 1 for the approximate posterior qλ ( z ( k ) 1 |x ) and update this initial estimate through a series of R refinement steps . Each refinement step r ∈ { 1 , . . . , R } first samples a latent representation from qλ to evaluate 1Perspective videos are more complex as objects can occlude one another and change in size over time . the ELBO L and then uses the approximate posterior gradients ∇λL to compute an additive update fφ , producing a new parameter estimate λ ( k ) r+1 : z ( k ) r k∼ qλ ( z ( k ) r |x ) , λ ( k ) r+1 k←− λ ( k ) r + fφ ( a ( k ) , h ( k ) r−1 ) , ( 2 ) where a ( k ) is a function of z ( k ) r , x , ∇λL , and additional inputs ( mirrors definition in Greff et al . ( 2019 ) ) . The function fφ consists of a sequence of convolutional layers and an LSTM . The memory unit takes as input a hidden state h ( k ) r−1 from the previous refinement step .
In this paper, the authors propose to better explicitly utilize the sequential information in the video to improve the performance of unsupervised scene decomposition in video. Concretely, 2D LSTM is used to combine the advantages of iterative inference and temporal information. By appropriately using the inferred results in the previous time step, the number of interactive inference steps is decreasing, which finally results in the O(R^2+T) complexity.
SP:dea62d40d829155b4a45b0c13adcdbe1bb080cf6
Unsupervised Video Decomposition using Spatio-temporal Iterative Inference
1 INTRODUCTION . Unsupervised representation learning , which has a long history dating back to Boltzman Machines ( Hinton & Sejnowski , 1986 ) and original works of Marr ( 1970 ) , has recently emerged as one of the important directions of research , carrying the newfound promise of alleviating the need for excessively large and fully labeled datasets . More traditional representation learning approaches focus on unsupervised ( e.g. , autoencoder-based ( Pathak et al. , 2016 ; Vincent et al. , 2008 ) ) or selfsupervised ( Noroozi & Favaro , 2016 ; Vondrick et al. , 2016 ; Zhang et al. , 2016 ) learning of holistic representations that , for example , are tasked with producing ( spatial ( Noroozi & Favaro , 2016 ) , temporal ( Vondrick et al. , 2016 ) , or color ( Zhang et al. , 2016 ) ) encodings of images or patches . The latest and most successful methods along these lines include ViLBERT ( Lu et al. , 2019 ) and others ( Sun et al. , 2019 ; Tan & Bansal , 2019 ) that utilize powerful transformer architectures ( Vaswani et al. , 2017 ) coupled with proxy multi-modal tasks ( e.g. , masked token prediction or visua-lingual alignment ) . Learning of good disentangled , spatially granular , representations that are , for example , able to decouple object appearance and shape in complex visual scenes consisting of multiple moving objects remains elusive . Recent works that attempt to address this challenge can be characterized as : ( i ) attention-based methods ( Crawford & Pineau , 2019b ; Eslami et al. , 2016 ) , which infer latent representations for each object in a scene , and ( ii ) iterative refinement models ( Greff et al. , 2019 ; 2017 ) , which decompose a scene into a collection of components by grouping pixels . Importantly , the former have been limited to latent representations at object- or image patch-levels , while the latter class of models have illustrated the ability for more granular latent representations at the pixel ( segmentation ) -level . Specifically , most refinement models learn pixel-level generative models driven by spatial mixtures ( Greff et al. , 2017 ) and utilize amortized iterative refinements ( Marino et al. , 2018 ) for inference of disentangled latent representations within the VAE framework ( Kingma & Welling , 2014 ) ; a prime example is IODINE ( Greff et al. , 2019 ) . However , while providing a powerful model and abstraction which is able to segment and disentangle complex scenes , IODINE ( Greff et al. , 2019 ) and other similar architectures are fundamentally limited by the fact that they only consider images . Even when applied for inference in video , they process one frame at a time . This makes it excessively challenging to discover and represent individual instances of objects that may share properties such as appearance and shape but differ in dynamics . In computer vision , it has been a long-held belief that motion carries important information for segmenting objects ( Jepson et al. , 2002 ; Weiss & Adelson , 1996 ) . Armed with this intuition , we propose a spatio-temporal amortized inference model capable of not only unsupervised multi-object scene decomposition , but also of learning and leveraging the implicit probabilistic dynamics of each object from perspective raw video alone . This is achieved by introducing temporal dependencies between the latent variables across time . As such , IODINE ( Greff et al. , 2019 ) could be considered a special ( spatial ) case of our spatio-temporal formulation . Modeling temporal dependencies among video frames also allows us to make use of conditional priors ( Chung et al. , 2015 ) for variational inference , leading to more accurate and efficient inference results . The resulting model , illustrated in Fig . 1 , achieves superior performance on complex multi-object benchmark datasets ( Bouncing Balls and CLEVRER ) with respect to state-of-the-art models , including R-NEM ( Van Steenkiste et al. , 2018 ) and IODINE ( Greff et al. , 2019 ) in terms of segmentation , prediction , and generalization . Our model has a number of appealing properties , including temporal extrapolation , computational efficiency , and the ability to work with complex data exhibiting non-linear dynamics , colors , and changing number of objects within the same video sequence . In addition , we introduce an entropy prior to improve our model ’ s performance in scenarios where object appearance alone is not sufficiently distinctive ( e.g. , greyscale data ) . 2 RELATED WORK . Unsupervised Scene Representation Learning . Unsupervised scene representation learning can generally be divided into two groups : attention-based methods , which infer latent representations for each object in a scene , and more complex and powerful iterative refinement models , which often make use of spatial mixtures and can decompose a scene into a collection of estimated components by grouping pixels together . Attention-based methods , such as AIR ( Eslami et al. , 2016 ) ( Xu et al. , 2019 ) and SPAIR ( Crawford & Pineau , 2019b ) , decompose scenes into latent variables representing the appearance , position , and size of the underlying objects . However , both methods can only infer the objects ’ bounding boxes and have not been shown to work on non-trivial 3D scenes with perspective distortions and occlusions . MoNet ( Burgess et al. , 2019 ) is the first model in this family tackling more complex data and inferring representations that can be used for instance segmentation of objects . On the other hand , it is not a probabilistic generative model and thus not suitable for density estimation . GENESIS ( Engelcke et al. , 2020 ) extends it and alleviates some of its limitations by introducing a probabilistic framework and allowing for spatial relations between the objects . DDPAE ( Hsieh et al. , 2018 ) is a framework that uses structured probabilistic models to decompose a video into low-dimensional temporal dynamics with the sole purpose of prediction . It is shown to operate on binary scenes with no perspective distortion and is not capable of generating per-object segmentation masks . Iterative refinement models started with Tagger ( Greff et al. , 2016 ) that reasons about the segmentation of its inputs . However , it does not allow explicit latent representations and can not be scaled to more complex images . NEM ( Greff et al. , 2017 ) , as an extension of Tagger , uses a spatial mixture model inside an expectation maximization framework , but is limited to binary data . Finally , IODINE ( Greff et al. , 2019 ) is a notable example of a model employing iterative amortized inference w.r.t . a spatial mixture formulation and achieves state-of-the-art performance in scene decomposition and segmentation . Unsupervised Video Tracking and Object Detection . SQAIR ( Kosiorek et al. , 2018 ) , SILOT ( Crawford & Pineau , 2019a ) and SCALOR ( Jiang et al. , 2020 ) are temporal extensions of the static attention-based models that are tailored to tracking and object detection tasks . SQAIR is restricted to binary data and operates at the level of bounding boxes . SILOT and SCALOR are more expressive and can cope with cluttered scenes , a larger numbers of objects , and dynamic backgrounds , but do not work on colored perspective1 data ; accurate segmentation remains a challenge . Unsupervised Video Decomposition and Segmentation . Models employing spatial mixtures and iterative inference in a temporal setting are closest to our method from a technical perspective . Notably , there are only few models falling into this line of work : RTagger ( Prémont-Schwarz et al. , 2017 ) is a recurrent extension of Tagger and has same limitations as its predecessor . R-NEM ( Van Steenkiste et al. , 2018 ) effectively learns the objects ’ dynamics and interactions through a relational module and can produce segmentations but is limited to orthographic binary data . Methods without Latent Modeling . GAN-based ReDO ( Chen et al. , 2019 ) uses a model built around the assumption that object regions are independent , guiding the generator by drawing objects ’ pixel regions separately and composing them after segmentation . Another model ( Arandjelović & Zisserman , 2019 ) employs the same principles but guide the generator by copying a region of an image into another one . Both architectures are shown to operate on static images only and do not have a clearly interpretable latent space or prediction capabilities . Our method allows an effective use of temporal information in object-centric decompositions of colored video data . This places our approach between methods like R-NEM , which strictly operates on binary data , and IODINE , whose usage of temporal information is ad-hoc and produces results of limited quality ( Table 1 ) . In practice , we leverage a 2D-LSTM and employ an implicit modeling of dynamics by incorporating the hidden states into a conditional prior in the efficient runtime manner . 3 DYNAMIC VIDEO DECOMPOSITION . We now introduce our dynamic model for unsupervised video decomposition . Our approach builds upon a generative model of multi-object representations and leverages elements of iterative amortized inference . We briefly review both concepts ( §3.1 ) and then introduce our model ( §3.2 ) . 3.1 BACKGROUND . Multi-Object Representations . The multi-object framework introduced in Greff et al . ( 2019 ) decomposes a static image x = ( xi ) i ∈ RD into K objects ( including background ) . Each object is represented by a latent vector z ( k ) ∈ RM capturing the object ’ s unique appearance and can be thought of as an encoding of common visual properties , such as color , shape , position , and size . For each z ( k ) independently , a broadcast decoder ( Watters et al. , 2019 ) generates pixelwise pairs ( m ( k ) i , µ ( k ) i ) describing the assignment probability and appearance of pixel i for object k. Together , they induce the generative image formation model p ( x|z ) = D∏ i=1 K∑ k=1 m ( k ) i N ( xi ; µ ( k ) i , σ 2 ) , ( 1 ) where z = ( z ( k ) ) k , ∑K k=1m ( k ) i = 1 and σ is the same and fixed for all i and k. The original image pixels can be reconstructed from this probabilistic representation as x̃i = ∑K k=1m ( k ) i µ ( k ) i . Iterative Amortized Inference . Our approach leverages the iterative amortized inference framework ( Marino et al. , 2018 ) , which uses the learning to learn principle ( Andrychowicz et al. , 2016 ) to close the amortization gap ( Cremer et al. , 2017 ) typically observed in traditional variational inference . The need for such an iterative process arises due to the multi-modality of Eq . ( 1 ) , which results in an order invariance and assignment ambiguity in the approximate posterior that standard variational inference can not overcome ( Greff et al. , 2019 ) . The idea of amortized iterative inference is to start with randomly guessed parameters λ ( k ) 1 for the approximate posterior qλ ( z ( k ) 1 |x ) and update this initial estimate through a series of R refinement steps . Each refinement step r ∈ { 1 , . . . , R } first samples a latent representation from qλ to evaluate 1Perspective videos are more complex as objects can occlude one another and change in size over time . the ELBO L and then uses the approximate posterior gradients ∇λL to compute an additive update fφ , producing a new parameter estimate λ ( k ) r+1 : z ( k ) r k∼ qλ ( z ( k ) r |x ) , λ ( k ) r+1 k←− λ ( k ) r + fφ ( a ( k ) , h ( k ) r−1 ) , ( 2 ) where a ( k ) is a function of z ( k ) r , x , ∇λL , and additional inputs ( mirrors definition in Greff et al . ( 2019 ) ) . The function fφ consists of a sequence of convolutional layers and an LSTM . The memory unit takes as input a hidden state h ( k ) r−1 from the previous refinement step .
The authors extend previous work of Greff et al. on unsupervised, multi-object scene decomposition to incorporate temporal information. In particular, they apply the LSTM defined for each candidate object not only over inference steps, but also over time. This allows the model to capture temporal cues, such as object motion, to better decompose the scene into objects. In addition, this allows to speed up the inference, since they perform fewer inference steps at each consecutive frame, capitalizing on temporal consistency in videos (LSTM state can be largely refused between consecutive frames, since the appearance doesn't change a lot). Experimentally demonstrate that their approach indeed outperforms prior work on two toy datasets (bouncing balls and CLEVERER), while being more computationally efficient.
SP:dea62d40d829155b4a45b0c13adcdbe1bb080cf6
Network Pruning That Matters: A Case Study on Retraining Variants
1 INTRODUCTION . Training neural networks is an everyday task in the era of deep learning and artificial intelligence . Generally speaking , given data availability , large and cumbersome networks are often preferred as they have more capacity to exhibit good data generalization . In the literature , large networks are considered easier to train than small ones ( Neyshabur et al. , 2018 ; Arora et al. , 2018 ; Novak et al. , 2018 ; Brutzkus & Globerson , 2019 ) . Thus , many breakthroughs in deep learning are strongly correlated to increasingly complex and over-parameterized networks . However , the use of large networks exacerbate the gap between research and practice since real-world applications usually require running neural networks in low-resource environments for numerous purposes : reducing memory , latency , energy consumption , etc . To adopt those networks to resourceconstrained devices , network pruning ( LeCun et al. , 1990 ; Han et al. , 2015 ; Li et al. , 2016 ) is often exploited to remove dispensable weights , filters and other structures from neural networks . The goal of pruning is to reduce overall computational cost and memory footprint without inducing significant drop in performance of the network . A common approach to mitigating performance drop after pruning is retraining : we continue to train the pruned models for some more epochs . In this paper , we are interested in approaches based on learning rate schedules to control the retraining . A well-known practice is fine-tuning , which aims to train the pruned model with a small fixed learning rate . More advanced learning rate schedules exist , which we generally refer to as retraining . The retraining step is a critical part in implementing network pruning , but it has been largely overlooked and tend to vary in each implementation including differences in learning rate schedules , retraining budget , hyperparameter choices , etc . Recently , Renda et al . ( 2020 ) proposed a state-of-the-art technique for retraining pruned networks namely learning rate rewinding ( LRW ) . Specifically , instead of fine-tuning the pruned networks with a fixed learning rate , usually the last learning rate from the original training schedule ( Han et al. , 2015 ; Liu et al. , 2019 ) , the authors suggested using the learning rate schedule from the previous t epochs ( i.e . rewinding ) . This seemingly subtle change in learning rate schedule led to an important result : LRW was shown to achieve comparable performance to more complex and computationally expensive pruning algorithms while only utilizing simple norm-based pruning . Unfortunately , the authors did not provide the analysis to justify the improvement . In general , it is intriguing to understand the importance of a learning rate schedule and how it affects the final performance of a pruned model . In this work , we study the behavior of pruned networks under different retraining settings . We found that the efficacy from retraining with learning rate rewinding is rooted in the use of a large learning rate , which helps pruned networks to converge faster after pruning . We demonstrate that the success of learning rate rewinding over fine-tuning is not exclusive to the learning rate schedule coupling with the original training process . Retraining with a large learning rate could outperform fine-tuning even with some modest retraining , e.g. , for a few epochs , and regardless of network compression ratio . We argue that retraining is of paramount importance to regain the performance in network pruning and should not be overlooked when comparing two pruning algorithms . This is evidenced by our extensive experiments : ( 1 ) randomly pruned network can outperform methodically pruned network with only ( hyper-parameters free ) modifications of the learning rate schedule in retraining , and ( 2 ) a simple baseline such as norm-based pruning can perform as well as as other complex pruning methods by using a large learning rate restarting retraining schedule . The contributions of our work are as follows . • We document a thorough experiment on learning rate schedule for the retraining step in network pruning with different pruning configurations ; • We show that learning rate matters : pruned models retrained with a large learning rate consistently outperform those trained by conventional fine-tuning regardless of specific learning rate schedules ; • We present a novel and counter-intuitive result achieved by solely applying large learning rate retraining : a randomly pruned network and a simple norm-based pruned network can perform as well as networks obtained from more sophisticated pruning algorithms . Given the significant impact of learning rate schedule in network pruning , we advocate the following practices : learning rate schedule should be considered as a critical part of retraining when designing pruning algorithms . Rigorous ablation studies with different retraining settings should be made for a fair comparison of pruning algorithms . To facilitate reproducibility , we would release our implementation upon publication . 2 PRELIMINARY AND METHODOLOGY . Pruning is a common method to produce compact and high performance neural networks from their original large and cumbersome counterparts.We can categorize pruning approaches into three classes : Pruning after training - which consists of three steps : training the original network to convergence , prune redundant weights based on some criteria , and retrain the pruned model to regain the performance loss due to pruning ( Li et al. , 2016 ; Han et al. , 2015 ; Luo et al. , 2017 ; Ye et al. , 2018 ; Wen et al. , 2016 ; He et al. , 2017 ) ; Pruning during training - we update the “ pruning mask ” while training the network from scratch , thus , allowing pruned neurons to be recovered ( Zhu & Gupta , 2017 ; Kusupati et al. , 2020 ; Wortsman et al. , 2019 ; Lin et al. , 2020b ; He et al. , 2019 ; 2018 ) ; Pruning before training - Inspired by the Lottery Ticket Hypothesis ( Frankle & Carbin , 2019 ) , some recent works try to find the sparsity mask at initialization and train the pruned network from scratch without changing the mask ( Lee et al. , 2019 ; Tanaka et al. , 2020 ; Wang et al. , 2020 ) . In this work , we are mainly concerned with the first category i.e . pruning after training which has the largest body of work to our knowledge . Traditionally , the last step is referred to as fine-tuning , i.e. , continue to train the pruned model with a small learning rate obtained from the last epoch of the original model . This seemly subtle step is often overlooked when designing pruning algorithms . Particularly , we found that the implementation of previous pruning algorithms have many notable differences in their retraining step : some employed a small value of learning rate ( e.g . 0.001 on ImageNet ) to fine-tune the network ( Molchanov et al. , 2016 ; Li et al. , 2016 ; Han et al. , 2015 ) for a small number of epochs , e.g. , 20 epochs in the work by Li et al . ( 2016 ) ; some used a larger value of learning rate ( 0.01 ) with much longer retraining budgets , e.g. , 60 , 100 and 120 epochs respectively on ImageNet ( Zhuang et al. , 2018 ; Gao et al. , 2020 ; Li et al. , 2020 ) ; You et al . ( 2019 ) ; Li et al . ( 2020 ) respectively utilized 1-cycle ( Smith & Topin , 2019 ) and cosine annealing learning rate schedule instead of conventional step-wise schedule . Despite such difference , the success of each pruning algorithm is only attributed to the pruning algorithm itself . This motivates us to ask the question : do details like learning rate schedule used for retraining matter ? In this section , we strive to understand the behavior of pruned models under different retraining configurations and how they impact the final performance . Specifically , we conduct experiments with different retraining schedules on simple baselines such as ` 1-norm filters pruning ( Li et al. , 2016 ) and magnitude-based weights pruning ( Han et al. , 2015 ) . We show that the efficacy of several pruning algorithms can be boosted by simply modifying the learning rate schedule . More importantly , the performance gain by retraining can be remarkable : the accuracy loss can drop to zero and in some cases better accuracy than baseline models can be achieved . To analyze the effect of retraining a pruned network , we based on learning rate rewinding ( Renda et al. , 2020 ) and experiment with different retraining settings . Although in the previous work , Renda et al . ( 2020 ) demonstrated the efficacy of learning rate rewinding across datasets and pruning criteria , there is a lack of understanding of the actual reason behind the success of this technique . Here we hypothesize that the initial pruned network is a suboptimal solution , staying in a local minima . Learning rate rewinding succeeds because it uses a large learning rate to encourage the pruned networks to converge to another , supposingly better , local minima . Our experiment setups are as follows . Retraining techniques . To verify this conjecture empirically , we conduct experiments with different learning rate schedules including learning rate rewinding ( Renda et al. , 2020 ) while varying pruning algorithms , network architectures and datasets . In this work , we consider the following retraining techniques : 1 . FINE-TUNING ( FT ) Fine-tuning is the most common retraining techniques ( Han et al. , 2015 ; Li et al. , 2016 ; Liu et al. , 2019 ) . In this approach , we continue train the pruned networks for t epochs with the last ( smallest ) learning rate of original training . 2 . LEARNING RATE REWINDING ( LRW ) Renda et al . ( 2020 ) propose to reuse the learning rate schedule of the original training when retraining pruned networks . Specifically , when retraining for t epochs , we reuse the learning rate schedule from the previous t epochs , i.e. , rewinding . 3 . SCALED LEARNING RATE RESTARTING ( SLR ) : In this approach , we employ the learning rate schedule that is proportionally identical to the standard training . For example , the learning rate is dropped by a factor of 10× at 50 % and 75 % of retraining epochs on CIFAR , which is akin to original training learning rate adjustment . The original learning rate schedule can be found in Appendix A . 4 . CYCLIC LEARNING RATE RESTARTING ( CLR ) : Instead of using stepwise learning rate schedule as scaled learning rate restarting , we leverage the 1-cycle ( Smith & Topin , 2019 ) , which is shown to give faster convergence speed than conventional approaches . Note that for the last two strategies ( SLR and CLR ) , we warmup the learning rate for 10 % of total retraining budget . For simplicity , we always use the largest learning rate of the original training for learning rate restarting . Specifically , the learning rate is increased from the smallest learning rate of original training to the largest one according to cosine function . The detailed learning rate schedule of each technique is depicted in Figure 1 . See also Appendix F for the choice of warmup epochs . Pruning algorithms We consider the following dimensions in our experiments . For pruning methods , we use ` 1-norm filters pruning ( PFEC ) ( Li et al. , 2016 ) and ( global ) magnitude-based weights pruning ( MWP ) ( Han et al. , 2015 ) and evaluate them on the CIFAR-10 , CIFAR-100 and ImageNet dataset . We examine both variations of pruning namely one-shot pruning and iterative pruning when comparing the proposed retraining techniques . Furthermore , we also experiment the CLR schedule on HRank ( Lin et al. , 2020a ) , Taylor Pruning ( TP ) ( Molchanov et al. , 2019 ) and Soft Filter Pruning ( SFP ) ( He et al. , 2018 ) . Our implementation and hyperparameters of ` 1-norm filters pruning and magnitude weight pruning are based on the public implementation of Liu et al . ( 2019 ) , which is shown to obtain comparable results with the original works . For remaining algorithms , we use official implementations with hyperparameters specified according to their papers . The detailed configurations of training and fine-tuning is provided in the Appendix B for interested readers . Evaluation . For CIFAR-10 and CIFAR-100 , we run each experiment three times and report “ mean± std ” . For ImageNet , we run each experiment once . These settings are kept consistently across architectures , pruning algorithms , retraining techniques , and ablation studies unless otherwise stated .
This paper analyzes the role of learning rate in re-training after pruning, building on previous findings that changing the learning rate schedule of re-training can result in higher accuracy than low-learning-rate fine-tuning. The paper proposes several learning rate schedules to compare, specifically a cyclic learning rate (gradually ramping up to and back down from the maximum learning rate schedule used during the original training phase) and a compressed version of the original learning rate schedule, and shows that these learning rate schedules outperform standard fine-tuning and also learning rate rewinding, showing that the findings of prior work come from using a higher learning rate in general and not any specific schedule. The paper than shows that choice of re-training learning rate schedule can have more impact on final accuracy than choice of saliency metric.
SP:914f06bae289e10ae114cc43130751b8a8859b46
Network Pruning That Matters: A Case Study on Retraining Variants
1 INTRODUCTION . Training neural networks is an everyday task in the era of deep learning and artificial intelligence . Generally speaking , given data availability , large and cumbersome networks are often preferred as they have more capacity to exhibit good data generalization . In the literature , large networks are considered easier to train than small ones ( Neyshabur et al. , 2018 ; Arora et al. , 2018 ; Novak et al. , 2018 ; Brutzkus & Globerson , 2019 ) . Thus , many breakthroughs in deep learning are strongly correlated to increasingly complex and over-parameterized networks . However , the use of large networks exacerbate the gap between research and practice since real-world applications usually require running neural networks in low-resource environments for numerous purposes : reducing memory , latency , energy consumption , etc . To adopt those networks to resourceconstrained devices , network pruning ( LeCun et al. , 1990 ; Han et al. , 2015 ; Li et al. , 2016 ) is often exploited to remove dispensable weights , filters and other structures from neural networks . The goal of pruning is to reduce overall computational cost and memory footprint without inducing significant drop in performance of the network . A common approach to mitigating performance drop after pruning is retraining : we continue to train the pruned models for some more epochs . In this paper , we are interested in approaches based on learning rate schedules to control the retraining . A well-known practice is fine-tuning , which aims to train the pruned model with a small fixed learning rate . More advanced learning rate schedules exist , which we generally refer to as retraining . The retraining step is a critical part in implementing network pruning , but it has been largely overlooked and tend to vary in each implementation including differences in learning rate schedules , retraining budget , hyperparameter choices , etc . Recently , Renda et al . ( 2020 ) proposed a state-of-the-art technique for retraining pruned networks namely learning rate rewinding ( LRW ) . Specifically , instead of fine-tuning the pruned networks with a fixed learning rate , usually the last learning rate from the original training schedule ( Han et al. , 2015 ; Liu et al. , 2019 ) , the authors suggested using the learning rate schedule from the previous t epochs ( i.e . rewinding ) . This seemingly subtle change in learning rate schedule led to an important result : LRW was shown to achieve comparable performance to more complex and computationally expensive pruning algorithms while only utilizing simple norm-based pruning . Unfortunately , the authors did not provide the analysis to justify the improvement . In general , it is intriguing to understand the importance of a learning rate schedule and how it affects the final performance of a pruned model . In this work , we study the behavior of pruned networks under different retraining settings . We found that the efficacy from retraining with learning rate rewinding is rooted in the use of a large learning rate , which helps pruned networks to converge faster after pruning . We demonstrate that the success of learning rate rewinding over fine-tuning is not exclusive to the learning rate schedule coupling with the original training process . Retraining with a large learning rate could outperform fine-tuning even with some modest retraining , e.g. , for a few epochs , and regardless of network compression ratio . We argue that retraining is of paramount importance to regain the performance in network pruning and should not be overlooked when comparing two pruning algorithms . This is evidenced by our extensive experiments : ( 1 ) randomly pruned network can outperform methodically pruned network with only ( hyper-parameters free ) modifications of the learning rate schedule in retraining , and ( 2 ) a simple baseline such as norm-based pruning can perform as well as as other complex pruning methods by using a large learning rate restarting retraining schedule . The contributions of our work are as follows . • We document a thorough experiment on learning rate schedule for the retraining step in network pruning with different pruning configurations ; • We show that learning rate matters : pruned models retrained with a large learning rate consistently outperform those trained by conventional fine-tuning regardless of specific learning rate schedules ; • We present a novel and counter-intuitive result achieved by solely applying large learning rate retraining : a randomly pruned network and a simple norm-based pruned network can perform as well as networks obtained from more sophisticated pruning algorithms . Given the significant impact of learning rate schedule in network pruning , we advocate the following practices : learning rate schedule should be considered as a critical part of retraining when designing pruning algorithms . Rigorous ablation studies with different retraining settings should be made for a fair comparison of pruning algorithms . To facilitate reproducibility , we would release our implementation upon publication . 2 PRELIMINARY AND METHODOLOGY . Pruning is a common method to produce compact and high performance neural networks from their original large and cumbersome counterparts.We can categorize pruning approaches into three classes : Pruning after training - which consists of three steps : training the original network to convergence , prune redundant weights based on some criteria , and retrain the pruned model to regain the performance loss due to pruning ( Li et al. , 2016 ; Han et al. , 2015 ; Luo et al. , 2017 ; Ye et al. , 2018 ; Wen et al. , 2016 ; He et al. , 2017 ) ; Pruning during training - we update the “ pruning mask ” while training the network from scratch , thus , allowing pruned neurons to be recovered ( Zhu & Gupta , 2017 ; Kusupati et al. , 2020 ; Wortsman et al. , 2019 ; Lin et al. , 2020b ; He et al. , 2019 ; 2018 ) ; Pruning before training - Inspired by the Lottery Ticket Hypothesis ( Frankle & Carbin , 2019 ) , some recent works try to find the sparsity mask at initialization and train the pruned network from scratch without changing the mask ( Lee et al. , 2019 ; Tanaka et al. , 2020 ; Wang et al. , 2020 ) . In this work , we are mainly concerned with the first category i.e . pruning after training which has the largest body of work to our knowledge . Traditionally , the last step is referred to as fine-tuning , i.e. , continue to train the pruned model with a small learning rate obtained from the last epoch of the original model . This seemly subtle step is often overlooked when designing pruning algorithms . Particularly , we found that the implementation of previous pruning algorithms have many notable differences in their retraining step : some employed a small value of learning rate ( e.g . 0.001 on ImageNet ) to fine-tune the network ( Molchanov et al. , 2016 ; Li et al. , 2016 ; Han et al. , 2015 ) for a small number of epochs , e.g. , 20 epochs in the work by Li et al . ( 2016 ) ; some used a larger value of learning rate ( 0.01 ) with much longer retraining budgets , e.g. , 60 , 100 and 120 epochs respectively on ImageNet ( Zhuang et al. , 2018 ; Gao et al. , 2020 ; Li et al. , 2020 ) ; You et al . ( 2019 ) ; Li et al . ( 2020 ) respectively utilized 1-cycle ( Smith & Topin , 2019 ) and cosine annealing learning rate schedule instead of conventional step-wise schedule . Despite such difference , the success of each pruning algorithm is only attributed to the pruning algorithm itself . This motivates us to ask the question : do details like learning rate schedule used for retraining matter ? In this section , we strive to understand the behavior of pruned models under different retraining configurations and how they impact the final performance . Specifically , we conduct experiments with different retraining schedules on simple baselines such as ` 1-norm filters pruning ( Li et al. , 2016 ) and magnitude-based weights pruning ( Han et al. , 2015 ) . We show that the efficacy of several pruning algorithms can be boosted by simply modifying the learning rate schedule . More importantly , the performance gain by retraining can be remarkable : the accuracy loss can drop to zero and in some cases better accuracy than baseline models can be achieved . To analyze the effect of retraining a pruned network , we based on learning rate rewinding ( Renda et al. , 2020 ) and experiment with different retraining settings . Although in the previous work , Renda et al . ( 2020 ) demonstrated the efficacy of learning rate rewinding across datasets and pruning criteria , there is a lack of understanding of the actual reason behind the success of this technique . Here we hypothesize that the initial pruned network is a suboptimal solution , staying in a local minima . Learning rate rewinding succeeds because it uses a large learning rate to encourage the pruned networks to converge to another , supposingly better , local minima . Our experiment setups are as follows . Retraining techniques . To verify this conjecture empirically , we conduct experiments with different learning rate schedules including learning rate rewinding ( Renda et al. , 2020 ) while varying pruning algorithms , network architectures and datasets . In this work , we consider the following retraining techniques : 1 . FINE-TUNING ( FT ) Fine-tuning is the most common retraining techniques ( Han et al. , 2015 ; Li et al. , 2016 ; Liu et al. , 2019 ) . In this approach , we continue train the pruned networks for t epochs with the last ( smallest ) learning rate of original training . 2 . LEARNING RATE REWINDING ( LRW ) Renda et al . ( 2020 ) propose to reuse the learning rate schedule of the original training when retraining pruned networks . Specifically , when retraining for t epochs , we reuse the learning rate schedule from the previous t epochs , i.e. , rewinding . 3 . SCALED LEARNING RATE RESTARTING ( SLR ) : In this approach , we employ the learning rate schedule that is proportionally identical to the standard training . For example , the learning rate is dropped by a factor of 10× at 50 % and 75 % of retraining epochs on CIFAR , which is akin to original training learning rate adjustment . The original learning rate schedule can be found in Appendix A . 4 . CYCLIC LEARNING RATE RESTARTING ( CLR ) : Instead of using stepwise learning rate schedule as scaled learning rate restarting , we leverage the 1-cycle ( Smith & Topin , 2019 ) , which is shown to give faster convergence speed than conventional approaches . Note that for the last two strategies ( SLR and CLR ) , we warmup the learning rate for 10 % of total retraining budget . For simplicity , we always use the largest learning rate of the original training for learning rate restarting . Specifically , the learning rate is increased from the smallest learning rate of original training to the largest one according to cosine function . The detailed learning rate schedule of each technique is depicted in Figure 1 . See also Appendix F for the choice of warmup epochs . Pruning algorithms We consider the following dimensions in our experiments . For pruning methods , we use ` 1-norm filters pruning ( PFEC ) ( Li et al. , 2016 ) and ( global ) magnitude-based weights pruning ( MWP ) ( Han et al. , 2015 ) and evaluate them on the CIFAR-10 , CIFAR-100 and ImageNet dataset . We examine both variations of pruning namely one-shot pruning and iterative pruning when comparing the proposed retraining techniques . Furthermore , we also experiment the CLR schedule on HRank ( Lin et al. , 2020a ) , Taylor Pruning ( TP ) ( Molchanov et al. , 2019 ) and Soft Filter Pruning ( SFP ) ( He et al. , 2018 ) . Our implementation and hyperparameters of ` 1-norm filters pruning and magnitude weight pruning are based on the public implementation of Liu et al . ( 2019 ) , which is shown to obtain comparable results with the original works . For remaining algorithms , we use official implementations with hyperparameters specified according to their papers . The detailed configurations of training and fine-tuning is provided in the Appendix B for interested readers . Evaluation . For CIFAR-10 and CIFAR-100 , we run each experiment three times and report “ mean± std ” . For ImageNet , we run each experiment once . These settings are kept consistently across architectures , pruning algorithms , retraining techniques , and ablation studies unless otherwise stated .
The authors conducted a comprehensive set of experiments on choices of learning rate schedules for re-training/fine-tuning during iterative or after 1-shot pruning of deep convnets. Empirically, they reported that high learning rate (LR) is particularly helpful in recovering generalization performance of the resultant sparse model. The results are purely empirical, well-documented observations from well-designed experiments, which is of practical value in practice of network compression, and the consistent, somewhat surprising observation raises interesting questions.
SP:914f06bae289e10ae114cc43130751b8a8859b46
Graph Pooling by Edge Cut
1 INTRODUCTION . Convolution neural networks ( LeCun et al. , 1995 ) have been proven to be very efficient at learning meaningful patterns for many articificial intelligence tasks . They convey the ability to learn hierarchical informations in data with Euclidean grid-like structures such as images and textual data . Convolutional Neural Networks ( CNNs ) have rapidly become state-of-the-art methods in the fields of computer vision ( Russakovsky et al. , 2015 ) and natural language processing ( Devlin et al. , 2018 ) . However in many scientific fields , studied data have an underlying graph or manifold structure such as communication networks ( whether social or technical ) or knowledge graphs . Recently there have been many attempts to extend convolution to such non-Euclidean structured data ( Hammond et al. , 2011 ; Kipf & Welling , 2016 ; Defferrard et al. , 2016 ) . In these new approaches , the authors propose to compute node embeddings in a semi-supervised fashion in order to perform node classification . Those node embeddings can also be used for link prediction by computing distances between each node of the graph ( Hammond et al. , 2011 ; Kipf & Welling , 2016 ) . An image can be seen as a special case of graph that lies on a 2D grid and where nodes are pixels and edges are weighted according to the difference of intensity and to the distance between two pixels ( Zhang et al. , 2015 ; Achanta & Susstrunk , 2017 ; Van den Bergh et al. , 2012 ; Stutz et al. , 2018 ) . In the emerging field of graph analysis based on convolutions and deep neural networks , it is appealing to try to apply models that worked best in the field of computer vision . In this effort , several ways to perform convolutions in graphs have been proposed ( Hammond et al. , 2011 ; Kipf & Welling , 2016 ; Defferrard et al. , 2016 ; Gilmer et al. , 2017 ; Veličković et al. , 2017 ; Xu et al. , 2018 ; Battaglia et al. , 2016 ; Kearnes et al. , 2016 ) . Moreover , when dealing with image classification , pooling is an important step ( Gao & Ji , 2019 ; Ying et al. , 2018 ; Defferrard et al. , 2016 ; Diehl , 2019 ) . It allows us to extract hierarchical features in images in order to make the classification more accuracte . While it is easy to apply coarsening to an image , it isn ’ t obvious how to coarsen a graph since nodes in graphs are not ordered like pixels in images . In this work we present a novel pooling layer based on edge scoring and related to the minCUT problem . The main contributions of this work are summarized below : 1 . Learned pooling layer . A differentiable pooling layer that learns how to aggregate nodes in clusters to produce a pooled graph of reduced size . 2 . A novel approach based on edge cuts . We develop a novel pooling layer . Most coarsening strategies are based on nodes , either by finding clusters or by deleting nodes that carry less information of the graph structure . In our approach , we focus on edges to uncover communities of topologically close nodes in graphs . 3 . The definition of a regularization that aims at approximating the problem of minCUT . We regularize our problem by a term that corresponds to the problem of Ncut in order to learn edge scores and clusters that are consistent with the topology of the graph . We show that by computing an edge score matrix , we can easily compute this regularization term . 4 . Experimental results . Our method achieves state-of-the-art results on benchmark datasets . We compare it with kernel methods and state-of-the-art message passing algorithms that use pooling layers as aggregation processes . 2 RELATED WORK . Recently there has been a rich line of research , inspired by deep models in images , that aims at redefining neural networks in graphs and in particular convolutional neural networks ( Defferrard et al. , 2016 ; Kipf & Welling , 2016 ; Veličković et al. , 2017 ; Hamilton et al. , 2017 ; Bronstein et al. , 2017 ; Bruna et al. , 2013 ; Scarselli et al. , 2009 ) . Those convolutions can be viewed as message passing algorithms that are composed of two phases Gilmer et al . ( 2017 ) . They find their success in their ability to uncover meaningful patterns in graphs by propagating information from nodes to their neighbors . Moreover , many works on graph neural networks also focus on redefining pooling in graphs . The pooling operation allows us to obtain different versions of the input graph at different scales . In graphs , the pooling step isn ’ t trivial because of the nature the data . Nodes can have different numbers of neighbors and graphs can have different sizes . To cope with these issues , different pooling strategies have been proposed : • Top-k : Like Gao & Ji ( 2019 ) , the objective is to score nodes according to their importance in the graph and then to keep only nodes with the top-k scores . By removing nodes we can remove important connections in the graph and produce disconnected graphs . A step to increase connectivity is necessary . This is done by adding edges at 2-hops from the input graph . • Cluster identification : This is usually done by projecting node features on a learned weight to obtain an assignment matrix . Nodes that have close embeddings are projected on the same cluster . After having obtained the assignment matrix , super nodes at the coarsened level can be computed by aggregating all nodes that belong to the same cluster ( Ying et al. , 2018 ) . • Edge based pooling : An edge contraction pooling layer has recently been proposed by Diehl ( 2019 ) . They compute edge scores in order to successively contract pairs of nodes , which means that they successively merge pairs of nodes that are linked by edges of the highest scores . • Deterministic coarsening strategies : Finally , a way to perform pooling in graphs can simply be to apply a deterministic clustering algorithm in order to identify clusters of nodes that will represent super nodes in the coarsened level ( Defferrard et al. , 2016 ; Ying et al. , 2018 ) . The main drawback of it is that the strategy isn ’ t learned and thus may not be suited to the graph classification task . In this work we define a new pooling layer that is based on edge cuts . Like Diehl ( 2019 ) we focus our pooling method on edges instead of nodes . In their work , Diehl ( 2019 ) calculate scores on edges to perform contraction pooling . This means that at each pooling step , they merge pairs of nodes that are associated with the highest edge scores , without merging nodes that were already involved in a contracted edge . This method results in pooled graphs of size divided by 2 compared to the input graph . The main similarity with our work is that we compute edge scores to characterize edge importance inspired by Graph Attention Transform ( Veličković et al. , 2017 ) . There are several differences with the pooling layer that we propose in this work . We want our pooling layer not to be constrained by a number of communities or by a predefined size of pooled graph . Moreover , our pooling layer works by edge cuts and the goal is to remove edges that minimize the minCUT problem ( Stoer & Wagner , 1997 ) . Once edges are cut , the graph is no longer connected and is composed of several connected components . These connected components correspond to super nodes in the coarsened level . In this work , we will first introduce the pooling architecture based on edge scoring in section 3.1 . We will then relate this pooling layer to the minCUT problem in section 3.2 . We will finally compare this pooling layer to state-of-the-art methods on benchmark datasets on a graph classification task and a node classification task in section 4 . 3 POOLING ARCHITECTURE . When designing a pooling layer , most algorithms need a number of classes for the pooling layer that is usually set as a hyperparameter . This is very restrictive especially when working on graphs of different sizes . Indeed , the pooling layer should cluster nodes according to the topology of the graph without being constrained by a number of classes . In this section we present our pooling layer that is based on edge cutting and that does not necessitate any a priori on the number of classes that needs to be found . 3.1 GNNS . Let G = ( V , E , X ) be a graph composed of a set of nodes V , a set of edges E and a node feature matrix X ∈ Rn×f0 where f0 is the dimensionality of node features . We denote by A the adjacency matrix . Graph neural networks . We build our work upon graph neural networks ( GNNs ) . There are several architectures of graph neural networks that have been proposed by Defferrard et al . ( 2016 ) ; Kipf & Welling ( 2016 ) ; Veličković et al . ( 2017 ) or Bruna & Li ( 2017 ) . Those graph neural network models are all based on propagation mechanisms of node features that follow a general neural message passing architecture ( Ying et al. , 2018 ; Gilmer et al. , 2017 ) : Z ( l+1 ) = MP ( A , Z ( l ) ; W ( l ) ) ( 1 ) where Z ( l ) ∈ Rn×fl are node embeddings computed after l steps of MP , Z ( 0 ) = X , and MP is the message propagation function , which depends on the adjacency matrix . W ( l ) is a trainable weight matrix that depends on layer l and fl is the dimensionality of node embeddings . The pooling layer that we introduce next can be used with any neural message passing algorithm that follows the propagation rule 1 . In all the following of our work we denote by MP the algorithm . For the experiments , we consider the Graph Convolutional Network ( GCN ) defined by ( Kipf & Welling , 2016 ) . This model is based on an approximation of convolutions on graphs defined by ( Defferrard et al. , 2016 ) and that use spectral decompositions of the Laplacian . It is very popular because it is very efficient computationally and obtains state-of-the-art results on benchmark datasets . This layer propagates node features to 1-hop neighbors . Its propagation rule is the following : Z ( l+1 ) = MP ( A , Z ( l ) ; W ( l ) ) = GCN ( A , Z ( l ) ) = ρ ( D̃−1/2ÃD̃−1/2Z ( l ) W ( l ) ) ( 2 ) Where ρ is a non-linear function ( a ReLU in our case ) , à = A + In is the adjacency matrix with added self-loops and D̃ii = ∑ j Ãij is the degree diagonal matrix associated with adjacency matrix à . Scoring edges . After layer l , each node i in the graph has an embedding Z ( l ) i . To simplify notations , we consider all matrices to be associated to layer l and we do not keep the exponant l. For example , we write feature of node i at layer l , Zi and its dimensionality is denoted by f . Based on these embeddings , we develop a scoring function that characterizes the importance of each edge of the graph . The input of our scoring algorithm is a set of node features , { Z1 , ... , Zn } ∈ Rn×f . The scoring function produces a matrix S ∈ Rn×n associated with layer l , Sij = 1 ( i , j ) ∈E ∗ sij where sij is the score of edge ( i , j ) . In order to compute the score of each edge of the graph , we apply a shared linear transformation , parametrized by a weight matrix Wpool ∈ Rf×d , to each node of the graph , d being the output size of the linear transformation . We then perform self-attention on nodes , as used in the Graph Attention Network ( GAT ) ( Veličković et al. , 2017 ) , by applying a shared weight a : R× R→ R to obtain a score on edge ( i , j ) ∈ E : sij = σ ( a [ WpoolZi||WpoolZj ] ) ( 3 ) Where σ is the sigmoid function , Wpool and a are trainable matrices associated with layer l and [ WpoolZi||WpoolZj ] ∈ R2d is a vector that is the concatenation of WpoolZi and WpoolZj . Let ’ s note that this scoring function isn ’ t symmetric and depends on the order of nodes . We can symmetrize this function by computing sij = 1 2 ( σ ( a [ WpoolZi||WpoolZj ] ) + σ ( a [ WpoolZj ||WpoolZi ] ) ) By applying the sigmoid function to the attention mechanism we compute an importance of edges . The goal is to obtain a distribution on edges for whose nodes that are close topologically have an edge which value is close to 1 . In the opposite case , we would like an edge to have a weight close to 0 if it links two nodes that do not lie in the same community . By doing so we would like to solve the minimum cut problem in graphs . After having computed the edge score matrix , we keep a ratio r of edges that correspond to edges with the r % higher scores . We obtain a threshold sthreshold that corresponds to the rth percentile of the distribution of edge scores . This way , we cut edges which scores are close to 0 in the graph . Edges with the smallest scores represent edges that link nodes that aren ’ t in the same community and thus by cutting those edges , we separate the graph into several clusters . We denote by Scut the score matrix with values under sthreshold truncated to 0 . Each row is renormalized by the number of positive components . This renormalization is useful in the following to compute node features in the coarsened level . ∀ ( i , j ) ∈ V 2 , Scutij = 1∑ j∈N ( i ) 1sij≥sthreshold sij1sij≥sthreshold We then extract the connected components of the new graph with cutted edges . Those connected components represent super nodes in the pooled graph . We obtain a cluster assignment matrix C ∈ Rn×c , c being a free parameter that isn ’ t fixed and that can vary during the training of the algorithm . After layer l , the pooled adjacency matrix and the pooled feature matrix are thus : A ( l+1 ) = A ( l ) pool = C ( l ) TA ( l ) C ( l ) Z ( l+1 ) = Z ( l ) pool = C ( l ) TS ( l ) cutZ ( l ) Remark . The multiplication by ScutZ makes the weightsWpool and a trainable by back-propagation . Otherwise it wouldn ’ t be the case because the function that outputs the matrix C by finding connected components from matrix Scut is not differentiable . Moreover , this multiplication weights the importance of each node feature in the super node of the coarsened level . In order to compute the feature Zk of cluster ( or super node ) k , we compute a node importance score scuti at layer l for each node i of the graph : scuti = 1∑ j∈N ( i ) 1 scut ( l ) ij > 0 ∑ j∈N ( i ) scutij The feature Zk of cluster k is then a weighted mean of the features of nodes that belong to cluster k : Zk = ∑ i∈k scutiZi Moreover , for edge scores to be consistent with the minCUT algorithm , we add a regularization term that we define in the next section .
The paper proposes a novel pooling layer for graph neural networks. Pooling in GNNs amounts to merging nodes that are very similar through the layers. Specifically, the paper proposes to merge nodes whose edges have a high score according to the edge cuts. The edge score in practice is computed in each layer using an attention mechanism on the concatenated representations of the edge’s nodes from that layer. The authors then choose a fixed ratio r of the top edges to keep, in an effort to remove edges of nodes from distant communities. The edge score matrix which is n x n stores all the scores and is truncated based on the aforementioned threshold, renormalized, and used to extract the connected components simply from disconnected areas of the matrix. In the following layer, the clusters form super-nodes and their representations are a weighted combination of each individual node’s representation.
SP:e2541b2195db1d6b0025113818f7d7a653473370
Graph Pooling by Edge Cut
1 INTRODUCTION . Convolution neural networks ( LeCun et al. , 1995 ) have been proven to be very efficient at learning meaningful patterns for many articificial intelligence tasks . They convey the ability to learn hierarchical informations in data with Euclidean grid-like structures such as images and textual data . Convolutional Neural Networks ( CNNs ) have rapidly become state-of-the-art methods in the fields of computer vision ( Russakovsky et al. , 2015 ) and natural language processing ( Devlin et al. , 2018 ) . However in many scientific fields , studied data have an underlying graph or manifold structure such as communication networks ( whether social or technical ) or knowledge graphs . Recently there have been many attempts to extend convolution to such non-Euclidean structured data ( Hammond et al. , 2011 ; Kipf & Welling , 2016 ; Defferrard et al. , 2016 ) . In these new approaches , the authors propose to compute node embeddings in a semi-supervised fashion in order to perform node classification . Those node embeddings can also be used for link prediction by computing distances between each node of the graph ( Hammond et al. , 2011 ; Kipf & Welling , 2016 ) . An image can be seen as a special case of graph that lies on a 2D grid and where nodes are pixels and edges are weighted according to the difference of intensity and to the distance between two pixels ( Zhang et al. , 2015 ; Achanta & Susstrunk , 2017 ; Van den Bergh et al. , 2012 ; Stutz et al. , 2018 ) . In the emerging field of graph analysis based on convolutions and deep neural networks , it is appealing to try to apply models that worked best in the field of computer vision . In this effort , several ways to perform convolutions in graphs have been proposed ( Hammond et al. , 2011 ; Kipf & Welling , 2016 ; Defferrard et al. , 2016 ; Gilmer et al. , 2017 ; Veličković et al. , 2017 ; Xu et al. , 2018 ; Battaglia et al. , 2016 ; Kearnes et al. , 2016 ) . Moreover , when dealing with image classification , pooling is an important step ( Gao & Ji , 2019 ; Ying et al. , 2018 ; Defferrard et al. , 2016 ; Diehl , 2019 ) . It allows us to extract hierarchical features in images in order to make the classification more accuracte . While it is easy to apply coarsening to an image , it isn ’ t obvious how to coarsen a graph since nodes in graphs are not ordered like pixels in images . In this work we present a novel pooling layer based on edge scoring and related to the minCUT problem . The main contributions of this work are summarized below : 1 . Learned pooling layer . A differentiable pooling layer that learns how to aggregate nodes in clusters to produce a pooled graph of reduced size . 2 . A novel approach based on edge cuts . We develop a novel pooling layer . Most coarsening strategies are based on nodes , either by finding clusters or by deleting nodes that carry less information of the graph structure . In our approach , we focus on edges to uncover communities of topologically close nodes in graphs . 3 . The definition of a regularization that aims at approximating the problem of minCUT . We regularize our problem by a term that corresponds to the problem of Ncut in order to learn edge scores and clusters that are consistent with the topology of the graph . We show that by computing an edge score matrix , we can easily compute this regularization term . 4 . Experimental results . Our method achieves state-of-the-art results on benchmark datasets . We compare it with kernel methods and state-of-the-art message passing algorithms that use pooling layers as aggregation processes . 2 RELATED WORK . Recently there has been a rich line of research , inspired by deep models in images , that aims at redefining neural networks in graphs and in particular convolutional neural networks ( Defferrard et al. , 2016 ; Kipf & Welling , 2016 ; Veličković et al. , 2017 ; Hamilton et al. , 2017 ; Bronstein et al. , 2017 ; Bruna et al. , 2013 ; Scarselli et al. , 2009 ) . Those convolutions can be viewed as message passing algorithms that are composed of two phases Gilmer et al . ( 2017 ) . They find their success in their ability to uncover meaningful patterns in graphs by propagating information from nodes to their neighbors . Moreover , many works on graph neural networks also focus on redefining pooling in graphs . The pooling operation allows us to obtain different versions of the input graph at different scales . In graphs , the pooling step isn ’ t trivial because of the nature the data . Nodes can have different numbers of neighbors and graphs can have different sizes . To cope with these issues , different pooling strategies have been proposed : • Top-k : Like Gao & Ji ( 2019 ) , the objective is to score nodes according to their importance in the graph and then to keep only nodes with the top-k scores . By removing nodes we can remove important connections in the graph and produce disconnected graphs . A step to increase connectivity is necessary . This is done by adding edges at 2-hops from the input graph . • Cluster identification : This is usually done by projecting node features on a learned weight to obtain an assignment matrix . Nodes that have close embeddings are projected on the same cluster . After having obtained the assignment matrix , super nodes at the coarsened level can be computed by aggregating all nodes that belong to the same cluster ( Ying et al. , 2018 ) . • Edge based pooling : An edge contraction pooling layer has recently been proposed by Diehl ( 2019 ) . They compute edge scores in order to successively contract pairs of nodes , which means that they successively merge pairs of nodes that are linked by edges of the highest scores . • Deterministic coarsening strategies : Finally , a way to perform pooling in graphs can simply be to apply a deterministic clustering algorithm in order to identify clusters of nodes that will represent super nodes in the coarsened level ( Defferrard et al. , 2016 ; Ying et al. , 2018 ) . The main drawback of it is that the strategy isn ’ t learned and thus may not be suited to the graph classification task . In this work we define a new pooling layer that is based on edge cuts . Like Diehl ( 2019 ) we focus our pooling method on edges instead of nodes . In their work , Diehl ( 2019 ) calculate scores on edges to perform contraction pooling . This means that at each pooling step , they merge pairs of nodes that are associated with the highest edge scores , without merging nodes that were already involved in a contracted edge . This method results in pooled graphs of size divided by 2 compared to the input graph . The main similarity with our work is that we compute edge scores to characterize edge importance inspired by Graph Attention Transform ( Veličković et al. , 2017 ) . There are several differences with the pooling layer that we propose in this work . We want our pooling layer not to be constrained by a number of communities or by a predefined size of pooled graph . Moreover , our pooling layer works by edge cuts and the goal is to remove edges that minimize the minCUT problem ( Stoer & Wagner , 1997 ) . Once edges are cut , the graph is no longer connected and is composed of several connected components . These connected components correspond to super nodes in the coarsened level . In this work , we will first introduce the pooling architecture based on edge scoring in section 3.1 . We will then relate this pooling layer to the minCUT problem in section 3.2 . We will finally compare this pooling layer to state-of-the-art methods on benchmark datasets on a graph classification task and a node classification task in section 4 . 3 POOLING ARCHITECTURE . When designing a pooling layer , most algorithms need a number of classes for the pooling layer that is usually set as a hyperparameter . This is very restrictive especially when working on graphs of different sizes . Indeed , the pooling layer should cluster nodes according to the topology of the graph without being constrained by a number of classes . In this section we present our pooling layer that is based on edge cutting and that does not necessitate any a priori on the number of classes that needs to be found . 3.1 GNNS . Let G = ( V , E , X ) be a graph composed of a set of nodes V , a set of edges E and a node feature matrix X ∈ Rn×f0 where f0 is the dimensionality of node features . We denote by A the adjacency matrix . Graph neural networks . We build our work upon graph neural networks ( GNNs ) . There are several architectures of graph neural networks that have been proposed by Defferrard et al . ( 2016 ) ; Kipf & Welling ( 2016 ) ; Veličković et al . ( 2017 ) or Bruna & Li ( 2017 ) . Those graph neural network models are all based on propagation mechanisms of node features that follow a general neural message passing architecture ( Ying et al. , 2018 ; Gilmer et al. , 2017 ) : Z ( l+1 ) = MP ( A , Z ( l ) ; W ( l ) ) ( 1 ) where Z ( l ) ∈ Rn×fl are node embeddings computed after l steps of MP , Z ( 0 ) = X , and MP is the message propagation function , which depends on the adjacency matrix . W ( l ) is a trainable weight matrix that depends on layer l and fl is the dimensionality of node embeddings . The pooling layer that we introduce next can be used with any neural message passing algorithm that follows the propagation rule 1 . In all the following of our work we denote by MP the algorithm . For the experiments , we consider the Graph Convolutional Network ( GCN ) defined by ( Kipf & Welling , 2016 ) . This model is based on an approximation of convolutions on graphs defined by ( Defferrard et al. , 2016 ) and that use spectral decompositions of the Laplacian . It is very popular because it is very efficient computationally and obtains state-of-the-art results on benchmark datasets . This layer propagates node features to 1-hop neighbors . Its propagation rule is the following : Z ( l+1 ) = MP ( A , Z ( l ) ; W ( l ) ) = GCN ( A , Z ( l ) ) = ρ ( D̃−1/2ÃD̃−1/2Z ( l ) W ( l ) ) ( 2 ) Where ρ is a non-linear function ( a ReLU in our case ) , à = A + In is the adjacency matrix with added self-loops and D̃ii = ∑ j Ãij is the degree diagonal matrix associated with adjacency matrix à . Scoring edges . After layer l , each node i in the graph has an embedding Z ( l ) i . To simplify notations , we consider all matrices to be associated to layer l and we do not keep the exponant l. For example , we write feature of node i at layer l , Zi and its dimensionality is denoted by f . Based on these embeddings , we develop a scoring function that characterizes the importance of each edge of the graph . The input of our scoring algorithm is a set of node features , { Z1 , ... , Zn } ∈ Rn×f . The scoring function produces a matrix S ∈ Rn×n associated with layer l , Sij = 1 ( i , j ) ∈E ∗ sij where sij is the score of edge ( i , j ) . In order to compute the score of each edge of the graph , we apply a shared linear transformation , parametrized by a weight matrix Wpool ∈ Rf×d , to each node of the graph , d being the output size of the linear transformation . We then perform self-attention on nodes , as used in the Graph Attention Network ( GAT ) ( Veličković et al. , 2017 ) , by applying a shared weight a : R× R→ R to obtain a score on edge ( i , j ) ∈ E : sij = σ ( a [ WpoolZi||WpoolZj ] ) ( 3 ) Where σ is the sigmoid function , Wpool and a are trainable matrices associated with layer l and [ WpoolZi||WpoolZj ] ∈ R2d is a vector that is the concatenation of WpoolZi and WpoolZj . Let ’ s note that this scoring function isn ’ t symmetric and depends on the order of nodes . We can symmetrize this function by computing sij = 1 2 ( σ ( a [ WpoolZi||WpoolZj ] ) + σ ( a [ WpoolZj ||WpoolZi ] ) ) By applying the sigmoid function to the attention mechanism we compute an importance of edges . The goal is to obtain a distribution on edges for whose nodes that are close topologically have an edge which value is close to 1 . In the opposite case , we would like an edge to have a weight close to 0 if it links two nodes that do not lie in the same community . By doing so we would like to solve the minimum cut problem in graphs . After having computed the edge score matrix , we keep a ratio r of edges that correspond to edges with the r % higher scores . We obtain a threshold sthreshold that corresponds to the rth percentile of the distribution of edge scores . This way , we cut edges which scores are close to 0 in the graph . Edges with the smallest scores represent edges that link nodes that aren ’ t in the same community and thus by cutting those edges , we separate the graph into several clusters . We denote by Scut the score matrix with values under sthreshold truncated to 0 . Each row is renormalized by the number of positive components . This renormalization is useful in the following to compute node features in the coarsened level . ∀ ( i , j ) ∈ V 2 , Scutij = 1∑ j∈N ( i ) 1sij≥sthreshold sij1sij≥sthreshold We then extract the connected components of the new graph with cutted edges . Those connected components represent super nodes in the pooled graph . We obtain a cluster assignment matrix C ∈ Rn×c , c being a free parameter that isn ’ t fixed and that can vary during the training of the algorithm . After layer l , the pooled adjacency matrix and the pooled feature matrix are thus : A ( l+1 ) = A ( l ) pool = C ( l ) TA ( l ) C ( l ) Z ( l+1 ) = Z ( l ) pool = C ( l ) TS ( l ) cutZ ( l ) Remark . The multiplication by ScutZ makes the weightsWpool and a trainable by back-propagation . Otherwise it wouldn ’ t be the case because the function that outputs the matrix C by finding connected components from matrix Scut is not differentiable . Moreover , this multiplication weights the importance of each node feature in the super node of the coarsened level . In order to compute the feature Zk of cluster ( or super node ) k , we compute a node importance score scuti at layer l for each node i of the graph : scuti = 1∑ j∈N ( i ) 1 scut ( l ) ij > 0 ∑ j∈N ( i ) scutij The feature Zk of cluster k is then a weighted mean of the features of nodes that belong to cluster k : Zk = ∑ i∈k scutiZi Moreover , for edge scores to be consistent with the minCUT algorithm , we add a regularization term that we define in the next section .
This manuscript proposes a new pooling layer in Graph Neural Networks (GNN). By computing certain scores on edges which indicate the importance of edges in the process of information propagation, top r% edges are selected and a pooled graph is constructed by considering the connected components to be super nodes. The authors tried to explain some connection between their pooled graph and the normalized cut problem, which is not clearly stated in the manuscript. Even though the manuscript explores an interesting and timely topic, their approach is not technically appealing and the explanations are not enough to thoroughly understand the authors' ideas. My main concerns and major questions are as follows:
SP:e2541b2195db1d6b0025113818f7d7a653473370
Hyperrealistic neural decoding: Reconstruction of face stimuli from fMRI measurements via the GAN latent space
1 INTRODUCTION . In recent years , the field of neural decoding has been gaining more and more traction as advanced computational methods became increasingly available for application on neural data . This is a very welcome development in both neuroscience and neurotechnology since reading neural information will not only help understand and explain human brain function but also find applications in brain computer interfaces and neuroprosthetics to help people with disabilities . Neural decoding can be conceptualized as the inverse problem of mapping brain responses back to sensory stimuli via a latent space ( 20 ) . Such a mapping can be idealized as a composite function of linear and nonlinear transformations ( Figure 1 ) . The linear transformation models the mapping from brain responses to the latent space . The latent space should effectively capture the defining properties of the underlying neural representations . The nonlinear transformation models the mapping from the latent space to sensory stimuli . The systematic correspondences between latent representations of discriminative convnets and neural representations of sensory cortices are well established ( 23 ; 14 ; 2 ; 7 ; 8 ; 6 ) . As such , exploiting these systematic correspondences in neural decoding of visual experience has pushed the state-of-the-art forward ( 20 ) . This includes linear reconstruction of perceived handwritten characters ( 15 ) , neural decoding of perceived and imagined object categories ( 10 ) , and reconstruction of natural images ( 17 ; 16 ) and faces ( 9 ; 21 ) . Yet , there is still much room for improvement since state-of-the-art results still fall short of providing photorealistic reconstructions . At the same time , generative adversarial networks ( GANs ) have emerged as perhaps the most powerful generative models to date ( 5 ; 11 ; 12 ; 1 ) that can potentially bring neural decoding to the next level . However , since the true latent representations of GANs are not readily available for preexisting neural data ( unlike those of the aforementioned discriminative convnets ) , the adoption of GANs in neural decoding has been relatively slow ( see ( 16 ) for an earlier attempt with GANs and ( 21 ) for a related attempt with VAEs ) . In this study , we introduce a very powerful yet simple framework for HYperrealistic reconstruction of PERception ( HYPER ) , which elegantly integrates GANs in neural decoding by combining the following components ( Figure 2 ) : i GAN . We used a pretrained GAN , which allows for the generation of meaningful data samples from randomly sampled latent vectors . This model is used both for generating the stimulus set and for the ultimate reconstruction of perceived stimuli . In the current study , we used the progressive growing of GANs ( PGGAN ) model ( 11 ) , which generates photorealistic faces that resemble celebrities . ii fMRI . We made use of neural data with a known latent representation , obtained by presenting the stimulus set produced using the above-mentioned generative model , and recording the brain responses to these stimuli . In the current study , we collected fMRI recordings in response to the images produced using the PGGAN . We created a dataset consisting of a separate training and test set . iii Decoding model . We used a decoding model , mapping the neural data to the latent space of the generative model . Using this model , we then obtained latent vectors for the neural responses corresponding to the stimulus images in the test set . Feeding these latent vectors back into the generative model resulted in the hyperrealistic reconstructions of perception . 2 METHODS . 2.1 TRAINING ON SYNTHETIC IMAGES WITH KNOWN LATENT FEATURES . State-of-the art face reconstruction techniques use deep neural networks to encode vectors of latent features for the images presented during the fMRI experiment ( 9 ; 21 ) . These feature vectors have been shown to have a linear relation with measured brain responses . However , this approach entails information loss since the target images need to be reconstructed from the linear prediction using an approximate inversion network such as a variational decoder , leading to a severe bottleneck to the maximum possible reconstruction quality . In this paper , we avoid this sub-optimality by presenting to the participants photorealistic synthetic images generated using PGGAN . This allows us to store the ground-truth latents corresponding to the generated images which can be perfectly reconstructed using the generative model after predicting them from brain data . 2.2 NEURAL DECODING . 2.2.1 PREDICTING LATENT VECTORS FROM BRAIN DATA .. We adapted the deep generative network of PGGAN by adding a dense layer at the beginning to transform brain data into latent vectors . This layer is trained by minimizing the Euclidean distance between true and predicted latent representations ( batchsize = 30 , lr = 0.00001 , Adam optimization ) with weight decay ( alpha = 0.01 ) to reduce complexity and multicollinearity of the model . The remainder of the generative network was kept fixed . The first decoding model is trained with a loss function that takes only the latent vectors into account . Yet , the ultimate goal is to reconstruct what our participants were seeing . Technically , this is achieved when all the layer activations up until the output image would be similar between the real and predicted latent vector . Therefore , we created five additional loss functions that include these layer activations to examine how these contribute to further optimization of neural decoding . Importantly , we only took the centers of the activation maps to exclude surrounding background noise . In the end , we trained one model on the latent vectors alone , and five models on the latent vectors together with one PGGAN layer activation . 2.2.2 PREDICTING LAYER ACTIVATIONS FROM BRAIN DATA .. Earlier work has found correspondences between artificial neural networks and the brain ( 7 ) . Based on this knowledge , we trained four decoding models to predict PGGAN ’ s layer activations from brain data to explore the correspondence between this deep generative network and the brain . Specifically , we used the following layer outputs of PGGAN : 4 , 9 , 14 , and 19 , to which we will refer to as layer activation 1 , 2 , 3 , and 4 , respectively , for the remainder of this manuscript . The loss function was the Euclidean distance between true and predicted layer activations ( and not the latent vectors ) . The rest of training proceeded as before . Next , we examined the contribution of each voxel in a predefined mask on model performance using a combination of a searchlight mapping approach and occlusion analysis . The searchlight approach takes a cubic subset of 7× 7× 7 voxels , centered on a voxel . As each voxel is 2× 2× 2 mm3 , this results in volumes of 14× 14× 14 mm 3 . Neighboring voxels are only included when they are also in the mask . Ultimately , this searchlight is excluded from the brain data input to detect the effects of the center voxel on model performance . 2.3 DATASETS . 2.3.1 VISUAL STIMULI . High-resolution face images ( 1024 × 1024 pixels ) are generated by the generator network of a Progressive GAN ( PGGAN ) model ( 11 ) from randomly sampled latent vectors . Each generated face image is cropped and resized to 224× 224 pixels . In total , 1050 unique faces are presented once for the training set , and 36 faces are repeated 14 times for the test set of which the average brain response is taken . This ensured that the training set covers a large stimulus space to fit a general face model , whereas the voxel responses from the test set contain less noise and higher statistical power . 2.3.2 BRAIN RESPONSES An fMRI dataset was collected , consisting of BOLD responses that correspond to the perceived face stimuli . The BOLD responses ( TR = 1.5 s , voxel size = 2 × 2 × 2 mm3 , wholebrain coverage ) of two healthy subjects were measured ( S1 : 30-year old male ; S2 : 32-year old male ) while they were fixating on a target ( 0.6 × 0.6 degrees ) ( 19 ) superimposed on the stimuli ( 15× 15 degrees ) to minimize involuntary eye movements . During preprocessing , the obtained brain volumes are realigned to the first functional scan and the mean functional scan , respectively , after which the volumes are normalized to MNI space . A general linear model is fit to deconvolve task-related neural activation with the canonical hemodynamic response function ( HRF ) . Next , for each voxel , we computed its t-statistic and converted these t-scores to z-statistics to obtain a brain map in terms of z per perceived stimulus . Ultimately , most-active 4096 voxels were selected from the training set to define a voxel mask ( Figure 3 ) . Most of these mask voxels are located in the downstream brain regions . Voxel responses from the test set are not used to create the voxel mask to avoid double-dipping . The experiment was approved by the local ethics committee ( CMO Regio Arnhem-Nijmegen ) . Subjects provided written informed consent in accordance with the Declaration of Helsinki . The fMRI dataset for both subjects and used models are openly accessible via Github . 2.4 EVALUATION . Model performance is assessed in terms of three metrics : latent similarity , feature similarity , and structural similarity . First , latent similarity is the Euclidean similarity between predicted and true latent vectors . Second , feature similarity is the Euclidean similarity between feature extraction layer outputs ( n = 2048 ) of the ResNet50 model , pretrained for face recognition , which we feed stimuli and reconstructions . Lastly , structural similarity is used to measure the spatial interdependence between pixels of stimuli and reconstructions ( 22 ) . Next , based on the assumption that there exists a hyperplane in latent space for binary semantic attributes ( e.g . male vs. female ) , ( 18 ) have identified the decision boundaries for five semantic face attributes in PGGAN ’ s latent space : gender , age , the presence of eyeglasses , smile , and pose , by training five independent linear support vector machines ( SVMs ) ( Figure 4 ) . We used these decision boundaries to compute feature scores per image , by taking the dot product between latent representation and decision boundary ( resulting in a scalar ) . In this way , model performance with regard to specific visual features could be captured along a continuous spectrum , and compared across images . 3 RESULTS . Linear decoding of fMRI recordings using PGGAN ’ s latent space has led to unprecedented stimulus reconstructions . The highest performance is achieved by the first model that is trained on latent vectors alone ( Figure 5 ) . Figure 6 presents all image reconstructions of this best brain decoding model together with the originally perceived stimuli . To keep the presentation concise , the first half of the images ( 1-18 ) are reconstructed from brain activations from Subject 1 and the second half ( 19-36 ) from Subject 2 . The interpolations visualize the distance between predicted and true latent representations that underlie the ( re ) generated faces . It demonstrates which features are being retained or change . The bar graphs next to the perceived and reconstructed images show the scores of each image in terms of five semantic face attributes in PGGAN ’ s latent space : gender , age , the presence of eyeglasses , smile , and pose . Looking at the similarities and differences in the graphs for perceived and reconstructed images is a way to evaluate how well each semantic attribute is captured by our model . For most reconstructions , the two graphs match in terms of directionality . There are a few cases , however , demonstrating that there is still room for improvement , e.g . number 31 , 34 , and 35 . Correlating the feature scores for stimuli and reconstructions resulted in significant ( p < 0.05 ; Student ’ s t-test ) results for gender , age , eyeglasses , and pose , but not for smile ( Figure 5 ) . We would like to point out that using feature scores quantifies model performance as continuous rather than binary , explaining the significant correlation for eyeglasses despite lack of reconstruction in number 1 and 8 . Next , we compared the performance of the HYPER framework to the state-of-the-art VAE-GAN approach ( 21 ) and the traditional eigenface approach ( 3 ) which map the brain recordings onto different latent spaces . For a fair comparison , we used the same voxel mask to evaluate all the methods presented in this study without any optimization to a particular decoding approach . The VAE-GAN approach predicts 1024-dimensional latent representations which are fed to the VAE ’ s decoder network for stimulus reconstruction ( 128× 128 pixels ) . The eigenface approach predicts the first 512 principal components ( or ’ eigenfaces ’ ) after which stimulus reconstruction ( 64× 64 pixels ) is achieved by applying an inverse PCA transform . All quantitative and qualitative comparisons showed that the HYPER framework outperformed the baselines and had significantly above-chance latent and feature reconstruction performance ( p « 0.001 , permutation test ) , indicating the probability that a random latent vector or image would be more similar to the original stimulus ( Table 1 ) . We also present arbitrarily chosen but representative reconstruction examples from the VAE-GAN and eigenface approach , again demonstrating that the HYPER framework resulted in markedly better reconstructions ( Figure 7 ) . Lastly , we looked for any correspondence between the generative network and the brain . For each voxel , the searchlight-occlusion analysis identified on which of the four layer activation-predicting models it had the largest effect in terms of Euclidean activation similarity . This layer activation was then assigned to that voxel , and mapped to the brain ( Figure 8 ) . The majority of the voxels was found to correspond to layer activations closest to the latent vector ( i.e. , L1 and L2 ) . Other than that , there was no systematic relationship between voxels and layer activations . This is not surprising considering that the voxel mask covered mostly the downstream regions such as FFA which are already specialized for high level representations . Nevertheless , it would be interesting to further investigate if GAN layers map onto the visual cortex similar to task-optimized models do when trained and tested on natural images .
The paper proposes to reconstruct images of faces from fMRI measurements, using GANs. The authors collected a new dataset, showing static faces generated by a GAN model to human subjects, and recording their brain BOLD responses with MRI. Then, they learned a model to reconstruct the stimulus based on the brain responses. The authors demonstrate the high quality of the reconstructed faces, comparing with other recent methods.
SP:1fc0dee5fc3408ae717010debd346f9d2aff2c52
Hyperrealistic neural decoding: Reconstruction of face stimuli from fMRI measurements via the GAN latent space
1 INTRODUCTION . In recent years , the field of neural decoding has been gaining more and more traction as advanced computational methods became increasingly available for application on neural data . This is a very welcome development in both neuroscience and neurotechnology since reading neural information will not only help understand and explain human brain function but also find applications in brain computer interfaces and neuroprosthetics to help people with disabilities . Neural decoding can be conceptualized as the inverse problem of mapping brain responses back to sensory stimuli via a latent space ( 20 ) . Such a mapping can be idealized as a composite function of linear and nonlinear transformations ( Figure 1 ) . The linear transformation models the mapping from brain responses to the latent space . The latent space should effectively capture the defining properties of the underlying neural representations . The nonlinear transformation models the mapping from the latent space to sensory stimuli . The systematic correspondences between latent representations of discriminative convnets and neural representations of sensory cortices are well established ( 23 ; 14 ; 2 ; 7 ; 8 ; 6 ) . As such , exploiting these systematic correspondences in neural decoding of visual experience has pushed the state-of-the-art forward ( 20 ) . This includes linear reconstruction of perceived handwritten characters ( 15 ) , neural decoding of perceived and imagined object categories ( 10 ) , and reconstruction of natural images ( 17 ; 16 ) and faces ( 9 ; 21 ) . Yet , there is still much room for improvement since state-of-the-art results still fall short of providing photorealistic reconstructions . At the same time , generative adversarial networks ( GANs ) have emerged as perhaps the most powerful generative models to date ( 5 ; 11 ; 12 ; 1 ) that can potentially bring neural decoding to the next level . However , since the true latent representations of GANs are not readily available for preexisting neural data ( unlike those of the aforementioned discriminative convnets ) , the adoption of GANs in neural decoding has been relatively slow ( see ( 16 ) for an earlier attempt with GANs and ( 21 ) for a related attempt with VAEs ) . In this study , we introduce a very powerful yet simple framework for HYperrealistic reconstruction of PERception ( HYPER ) , which elegantly integrates GANs in neural decoding by combining the following components ( Figure 2 ) : i GAN . We used a pretrained GAN , which allows for the generation of meaningful data samples from randomly sampled latent vectors . This model is used both for generating the stimulus set and for the ultimate reconstruction of perceived stimuli . In the current study , we used the progressive growing of GANs ( PGGAN ) model ( 11 ) , which generates photorealistic faces that resemble celebrities . ii fMRI . We made use of neural data with a known latent representation , obtained by presenting the stimulus set produced using the above-mentioned generative model , and recording the brain responses to these stimuli . In the current study , we collected fMRI recordings in response to the images produced using the PGGAN . We created a dataset consisting of a separate training and test set . iii Decoding model . We used a decoding model , mapping the neural data to the latent space of the generative model . Using this model , we then obtained latent vectors for the neural responses corresponding to the stimulus images in the test set . Feeding these latent vectors back into the generative model resulted in the hyperrealistic reconstructions of perception . 2 METHODS . 2.1 TRAINING ON SYNTHETIC IMAGES WITH KNOWN LATENT FEATURES . State-of-the art face reconstruction techniques use deep neural networks to encode vectors of latent features for the images presented during the fMRI experiment ( 9 ; 21 ) . These feature vectors have been shown to have a linear relation with measured brain responses . However , this approach entails information loss since the target images need to be reconstructed from the linear prediction using an approximate inversion network such as a variational decoder , leading to a severe bottleneck to the maximum possible reconstruction quality . In this paper , we avoid this sub-optimality by presenting to the participants photorealistic synthetic images generated using PGGAN . This allows us to store the ground-truth latents corresponding to the generated images which can be perfectly reconstructed using the generative model after predicting them from brain data . 2.2 NEURAL DECODING . 2.2.1 PREDICTING LATENT VECTORS FROM BRAIN DATA .. We adapted the deep generative network of PGGAN by adding a dense layer at the beginning to transform brain data into latent vectors . This layer is trained by minimizing the Euclidean distance between true and predicted latent representations ( batchsize = 30 , lr = 0.00001 , Adam optimization ) with weight decay ( alpha = 0.01 ) to reduce complexity and multicollinearity of the model . The remainder of the generative network was kept fixed . The first decoding model is trained with a loss function that takes only the latent vectors into account . Yet , the ultimate goal is to reconstruct what our participants were seeing . Technically , this is achieved when all the layer activations up until the output image would be similar between the real and predicted latent vector . Therefore , we created five additional loss functions that include these layer activations to examine how these contribute to further optimization of neural decoding . Importantly , we only took the centers of the activation maps to exclude surrounding background noise . In the end , we trained one model on the latent vectors alone , and five models on the latent vectors together with one PGGAN layer activation . 2.2.2 PREDICTING LAYER ACTIVATIONS FROM BRAIN DATA .. Earlier work has found correspondences between artificial neural networks and the brain ( 7 ) . Based on this knowledge , we trained four decoding models to predict PGGAN ’ s layer activations from brain data to explore the correspondence between this deep generative network and the brain . Specifically , we used the following layer outputs of PGGAN : 4 , 9 , 14 , and 19 , to which we will refer to as layer activation 1 , 2 , 3 , and 4 , respectively , for the remainder of this manuscript . The loss function was the Euclidean distance between true and predicted layer activations ( and not the latent vectors ) . The rest of training proceeded as before . Next , we examined the contribution of each voxel in a predefined mask on model performance using a combination of a searchlight mapping approach and occlusion analysis . The searchlight approach takes a cubic subset of 7× 7× 7 voxels , centered on a voxel . As each voxel is 2× 2× 2 mm3 , this results in volumes of 14× 14× 14 mm 3 . Neighboring voxels are only included when they are also in the mask . Ultimately , this searchlight is excluded from the brain data input to detect the effects of the center voxel on model performance . 2.3 DATASETS . 2.3.1 VISUAL STIMULI . High-resolution face images ( 1024 × 1024 pixels ) are generated by the generator network of a Progressive GAN ( PGGAN ) model ( 11 ) from randomly sampled latent vectors . Each generated face image is cropped and resized to 224× 224 pixels . In total , 1050 unique faces are presented once for the training set , and 36 faces are repeated 14 times for the test set of which the average brain response is taken . This ensured that the training set covers a large stimulus space to fit a general face model , whereas the voxel responses from the test set contain less noise and higher statistical power . 2.3.2 BRAIN RESPONSES An fMRI dataset was collected , consisting of BOLD responses that correspond to the perceived face stimuli . The BOLD responses ( TR = 1.5 s , voxel size = 2 × 2 × 2 mm3 , wholebrain coverage ) of two healthy subjects were measured ( S1 : 30-year old male ; S2 : 32-year old male ) while they were fixating on a target ( 0.6 × 0.6 degrees ) ( 19 ) superimposed on the stimuli ( 15× 15 degrees ) to minimize involuntary eye movements . During preprocessing , the obtained brain volumes are realigned to the first functional scan and the mean functional scan , respectively , after which the volumes are normalized to MNI space . A general linear model is fit to deconvolve task-related neural activation with the canonical hemodynamic response function ( HRF ) . Next , for each voxel , we computed its t-statistic and converted these t-scores to z-statistics to obtain a brain map in terms of z per perceived stimulus . Ultimately , most-active 4096 voxels were selected from the training set to define a voxel mask ( Figure 3 ) . Most of these mask voxels are located in the downstream brain regions . Voxel responses from the test set are not used to create the voxel mask to avoid double-dipping . The experiment was approved by the local ethics committee ( CMO Regio Arnhem-Nijmegen ) . Subjects provided written informed consent in accordance with the Declaration of Helsinki . The fMRI dataset for both subjects and used models are openly accessible via Github . 2.4 EVALUATION . Model performance is assessed in terms of three metrics : latent similarity , feature similarity , and structural similarity . First , latent similarity is the Euclidean similarity between predicted and true latent vectors . Second , feature similarity is the Euclidean similarity between feature extraction layer outputs ( n = 2048 ) of the ResNet50 model , pretrained for face recognition , which we feed stimuli and reconstructions . Lastly , structural similarity is used to measure the spatial interdependence between pixels of stimuli and reconstructions ( 22 ) . Next , based on the assumption that there exists a hyperplane in latent space for binary semantic attributes ( e.g . male vs. female ) , ( 18 ) have identified the decision boundaries for five semantic face attributes in PGGAN ’ s latent space : gender , age , the presence of eyeglasses , smile , and pose , by training five independent linear support vector machines ( SVMs ) ( Figure 4 ) . We used these decision boundaries to compute feature scores per image , by taking the dot product between latent representation and decision boundary ( resulting in a scalar ) . In this way , model performance with regard to specific visual features could be captured along a continuous spectrum , and compared across images . 3 RESULTS . Linear decoding of fMRI recordings using PGGAN ’ s latent space has led to unprecedented stimulus reconstructions . The highest performance is achieved by the first model that is trained on latent vectors alone ( Figure 5 ) . Figure 6 presents all image reconstructions of this best brain decoding model together with the originally perceived stimuli . To keep the presentation concise , the first half of the images ( 1-18 ) are reconstructed from brain activations from Subject 1 and the second half ( 19-36 ) from Subject 2 . The interpolations visualize the distance between predicted and true latent representations that underlie the ( re ) generated faces . It demonstrates which features are being retained or change . The bar graphs next to the perceived and reconstructed images show the scores of each image in terms of five semantic face attributes in PGGAN ’ s latent space : gender , age , the presence of eyeglasses , smile , and pose . Looking at the similarities and differences in the graphs for perceived and reconstructed images is a way to evaluate how well each semantic attribute is captured by our model . For most reconstructions , the two graphs match in terms of directionality . There are a few cases , however , demonstrating that there is still room for improvement , e.g . number 31 , 34 , and 35 . Correlating the feature scores for stimuli and reconstructions resulted in significant ( p < 0.05 ; Student ’ s t-test ) results for gender , age , eyeglasses , and pose , but not for smile ( Figure 5 ) . We would like to point out that using feature scores quantifies model performance as continuous rather than binary , explaining the significant correlation for eyeglasses despite lack of reconstruction in number 1 and 8 . Next , we compared the performance of the HYPER framework to the state-of-the-art VAE-GAN approach ( 21 ) and the traditional eigenface approach ( 3 ) which map the brain recordings onto different latent spaces . For a fair comparison , we used the same voxel mask to evaluate all the methods presented in this study without any optimization to a particular decoding approach . The VAE-GAN approach predicts 1024-dimensional latent representations which are fed to the VAE ’ s decoder network for stimulus reconstruction ( 128× 128 pixels ) . The eigenface approach predicts the first 512 principal components ( or ’ eigenfaces ’ ) after which stimulus reconstruction ( 64× 64 pixels ) is achieved by applying an inverse PCA transform . All quantitative and qualitative comparisons showed that the HYPER framework outperformed the baselines and had significantly above-chance latent and feature reconstruction performance ( p « 0.001 , permutation test ) , indicating the probability that a random latent vector or image would be more similar to the original stimulus ( Table 1 ) . We also present arbitrarily chosen but representative reconstruction examples from the VAE-GAN and eigenface approach , again demonstrating that the HYPER framework resulted in markedly better reconstructions ( Figure 7 ) . Lastly , we looked for any correspondence between the generative network and the brain . For each voxel , the searchlight-occlusion analysis identified on which of the four layer activation-predicting models it had the largest effect in terms of Euclidean activation similarity . This layer activation was then assigned to that voxel , and mapped to the brain ( Figure 8 ) . The majority of the voxels was found to correspond to layer activations closest to the latent vector ( i.e. , L1 and L2 ) . Other than that , there was no systematic relationship between voxels and layer activations . This is not surprising considering that the voxel mask covered mostly the downstream regions such as FFA which are already specialized for high level representations . Nevertheless , it would be interesting to further investigate if GAN layers map onto the visual cortex similar to task-optimized models do when trained and tested on natural images .
The manuscript entitled “Hyperrealistic neural decoding: Linear reconstruction of face stimuli from fMRI measurements via the GAN latent space” utilizes a GAN-based network structure for generating faces that are presented to the subjects during fMRI acquisition. The acquired fMRI signals are then used to predict latent vector in GAN, where the predicted vectors (rather than the original, trained vectors) are used to generate “fMRI-derived” faces in turn. This work proposed a novel perspective to the field of cognitive neuroscience and human brain mapping in functional neuroimaging studies. It is an indirect yet highly effective way for modeling brain functional signals, and representing how the visual encoding-decoding actually works in human brain. Similar schemes of investigation can be easily developed based on the proposed work (e.g. analyzing correspondence between EMG and fMRI during motor tasks), which will bring significant value to the community.
SP:1fc0dee5fc3408ae717010debd346f9d2aff2c52
Adaptive Discretization for Continuous Control using Particle Filtering Policy Network
1 INTRODUCTION . In the last few years , impressive results have been obtained by deep reinforcement learning ( DRL ) both on physical and simulated articulated agents for a wide range of motor tasks that involve learning controls in high-dimensional continuous action spaces ( Lillicrap et al. , 2015 ; Levine et al. , 2016 ; Heess et al. , 2017 ; Haarnoja et al. , 2018c ; Rajeswaran et al. , 2018 ; Tan et al. , 2018 ; Peng et al. , 2018 ; 2020 ) . Many methods have been proposed that can improve the performance of DRL for continuous control problems , e.g . distributed training ( Mnih et al. , 2016 ; Espeholt et al. , 2018 ) , hierarchical learning ( Daniel et al. , 2012 ; Haarnoja et al. , 2018a ) , and maximum entropy regularization ( Haarnoja et al. , 2017 ; Liu et al. , 2017 ; Haarnoja et al. , 2018b ) . Most of such works , though , focus on learning mechanisms to boost performance beyond the basic distribution that defines the action policy , where a Gaussian-based policy or that with a squashing function is the most common choice as the basic policy to deal with continuous action spaces . However , the unimodal form of Gaussian distributions could experience difficulties when facing a multi-modal reward landscape during optimization and prematurely commit to suboptimal actions ( Daniel et al. , 2012 ; Haarnoja et al. , 2017 ) . To address the unimodality issue of Gaussian policies , people have been exploring more expressive distributions than Gaussians , with a simple solution being to discretize the action space and use categorical distributions as multi-modal action policies ( Andrychowicz et al. , 2020 ; Jaśkowski et al. , 2018 ; Tang & Agrawal , 2019 ) . However , categorical distributions can not be directly extended to many off-policy frameworks as their sampling process is not reparameterizable . Importantly , the performance of the action space discretization depends a lot on the choice of discrete atomic actions , which are usually picked uniformly due to lack of prior knowledge . On the surface , increasing the resolution of the discretized action space can make fine control more possible . However , in practice , this can be detrimental to the optimization during training , since the policy gradient variance increases with increasing number of atomic actions ( Tang & Agrawal , 2019 ) . Our work also focuses on action policies defined by an expressive , multimodal distribution . Instead of selecting fixed samples from the continuous action space , though , we exploit a particlebased approach to sample the action space dynamically during training and track the policy represented as a mixture distribution with state-independent components . We refer to the resulting policy network as Particle Filtering Policy Network ( PFPN ) . We evaluate PFPN on state-of-the-art on-policy and off-policy baselines using high-dimensional tasks from the PyBullet Roboschool en- vironments ( Coumans & Bai , 2016–2019 ) and the more challenging DeepMimic framework ( Peng et al. , 2018 ) . Our experiments show that baselines using PFPN exhibit better overall performance and/or speed of convergence and lead to more robust agent control . as compared to uniform discretization and to corresponding implementations with Gaussian policies . Main Contributions . Overall , we make the following contributions . We propose PFPN as a general framework for providing expressive action policies dealing with continuous action spaces . PFPN uses state-independent particles to represent atomic actions and optimizes their placement to meet the fine control demand of continuous control problems . We introduce a reparameterization trick that allows PFPN to be applicable to both on-policy and off-policy policy gradient methods . PFPN outperforms unimodal Gaussian policies and the uniform discretization scheme , and is more sampleefficient and stable across different training trials . In addition , it leads to high quality motion and generates controls that are more robust to external perturbations . Our work does not change the underlying model architecture or learning mechanisms of policy gradient algorithms and thus can be applied to most commonly used policy gradient algorithms . 2 BACKGROUND . We consider a standard reinforcement learning setup where given a time horizonH and the trajectory τ = ( s1 , a1 , · · · , sH , aH ) obtained by a transient modelM ( st+1|st , at ) and a parameterized action policy πθ ( at|st ) , with st ∈ Rn and at ∈ Rm denoting the state and action taken at time step t , respectively , the goal of learning is to optimize θ that maximize the cumulative reward : J ( θ ) = Eτ∼pθ ( τ ) [ rt ( τ ) ] = ∫ pθ ( τ ) r ( τ ) dτ . ( 1 ) Here , pθ ( τ ) denotes the state-action visitation distribution for the trajectory τ induced by the transient model M and the action policy πθ with parameter θ , and r ( τ ) = ∑ t r ( st , at ) where r ( st , at ) ∈ R is the reward received at time step t. We can maximize J ( θ ) by adjusting the policy parameters θ through the gradient ascent method , where the gradient of the expected reward can be determined according to the policy gradient theorem ( Sutton et al. , 2000 ) , i.e . ∇θJ ( θ ) = Eτ∼πθ ( ·|st ) [ At∇θ log πθ ( at|st ) |st ] . ( 2 ) whereAt ∈ R denotes an estimate to the reward term rt ( τ ) . In DRL , the estimator ofAt often relies on a separate network ( critic ) that is updated in tandem with the policy network ( actor ) . This gives rise to a family of policy gradient algorithms known as actor-critic . On-Policy and Off-Policy Actor-Critics . In on-policy learning , the update policy is also the behavior policy based on which a trajectory is obtained to estimate At . Common on-policy actor-critic algorithms include A3C ( Mnih et al. , 2016 ) and PPO ( Schulman et al. , 2017 ) , and directly employ Equation 2 for optimization . In off-policy learning , the policy can be updated without the knowledge of a whole trajectory . This results in more sample efficient approaches as samples are reusable . While algorithms such as Retrace ( Munos et al. , 2016 ) and PCL ( Nachum et al. , 2017 ) rely on Equation 2 , many off-policy algorithms exploit a critic network to estimate At given a state-action pair ( Q- or soft Q-value ) . Common off-policy actor-critic methods include DDPG ( Lillicrap et al. , 2015 ) , SAC ( Haarnoja et al. , 2018b ; d ) and their variants ( Haarnoja et al. , 2017 ; Fujimoto et al. , 2018 ) . These methods perform optimization to maximize a state-action value Q ( st , at ) . In order to update the policy network with parameter θ , they require the action policy to be reparameterizable such that the sampled action at can be rewritten as a function differentiable to the parameter θ , and the optimization can be done through the gradient∇atQ ( st , at ) ∇θat . Policy Representation . Given a multi-dimensional continuous action space , the most common choice in current DRL baselines is to model the policy πθ as a multivariate Gaussian distribution with independent components for each action dimension ( DDPG , SAC and their variants typically use Gaussian with a monotonic squashing function to stabilize the training ) . For simplicity , let us consider a simple case with a single action dimension and define the action policy as πθ ( ·|st ) : = N ( µθ ( st ) , σ2θ ( st ) ) . Then , we can obtain log πθ ( at|st ) ∝ − ( at − µθ ( st ) ) 2 . Given a sampled action at and the estimate of cumulative rewards At , the optimization process based on the above expression can be imagined as that of shifting µ θ ( st ) towards the direction of at ifAt is higher than the expectation , or to the opposite direction if At is smaller . Such an approach , though , can easily converge to a suboptimal solution , if , for example , the reward landscape has a basis between the current location of µ θ ( st ) and the optimal solution , or hard to be optimized if the reward land- scape is symmetric around µ θ ( st ) . These issues arise due to the fact that the Gaussian distribution is inherently unimodal , while the reward landscape could be multi-modal ( Haarnoja et al. , 2017 ) . Similar problems also could occur in Q-value based optimization , like DDPG and SAC . We refer to Appendix F for further discussion about the limitations of unimodal Gaussian policies and the value of expressive multimodal policies . 3 PARTICLE FILTERING POLICY NETWORK . In this section , we describe our Particle Filtering Policy Network ( PFPN ) that addresses the unimodality issues from which typical Gaussian-based policy networks suffer . Our approach represents the action policy as a mixture distribution obtained by adaptively discretizing the action space using state-independent particles , each capturing a Gaussian distribution . The policy network , instead of directly generating actions , it is tasked with choosing particles , while the final actions are obtained by sampling from the selected particles . 3.1 PARTICLE-BASED ACTION POLICY . Generally , we define P : = { 〈µi , k , wi , k ( st|θ ) 〉|i = 1 , · · · , n ; k = 1 , · · · , m } as a weighted set of particles for continuous control problems with a m-dimension action space and n particles distributed on each action space , where µi , k ∈ R representing an atomic action location on the kth dimension of the action space , and wi , k ( st|θ ) , satisfying ∑ i wi , k ( st|θ ) = 1 , denotes the associated weight generated by the policy network with parameter θ given the input state st. Let pi , k ( ai , k|µi , k , ξi , k ) denote the probability density function of the distribution defined by the location µi , k and a noise process ξi , k . Given P , we define the action policy as factorized across the action dimensions : πPθ ( at|st ) = ∏ k ∑ i wi , k ( st|θ ) pi , k ( at , k|µi , k , ξi , k ) , ( 3 ) where at = { at,1 , · · · , at , m } , at , k ∈ R is the sampled action at the time step t for the action dimension k , and wi , k ( ·|θ ) can be obtained by applying a softmax operation to the output neurons of the policy network for the k-th dimension . The state-independent parameter set , { µi , k } , gives us an adaptive discretization scheme that can be optimized during training . The choice of noise ξi , k relies on certain algorithms . It can be a scalar , e.g. , the Ornstein–Uhlenbeck noise in DDPG ( Lillicrap et al. , 2015 ) or an independent sample drawn from the standard normal distribution N ( 0 , 1 ) in soft Q-learning ( Haarnoja et al. , 2017 ) , or be decided by a learnable variable , for example , a sample drawn fromN ( 0 , ξ2i , k ) with a learnable standard deviation ξi , k . In the later case , a particle become a Gaussian componentN ( µi , k , ξ2i , k ) . Without loss of generality , we define the parameters of a particle as φi , k = [ µi , k , ξi , k ] for the following discussion . While the softmax operation gives us a categorical distribution defined by w· , k ( st|θ ) , the nature of the policy for each dimension is a mixture distribution with state-independent components defined by φi , k . The number of output neurons in PFPN increases linearly with the increase in the number of action dimensions and thus makes it suitable for high-dimensional control problems . Drawing samples from the mixture distribution can be done in two steps : first , based on the weights w· , k ( st|θ ) , we perform sampling on the categorical distribution to choose a particle jk for each dimension k , i.e . jk ( st ) ∼ P ( ·|w· , k ( st ) ) ; then , we can draw actions from the components represented by the chosen particles with noise as at , k ∼ pjk ( st ) ( ·|φjk ( st ) ) . Certain algorithms , like A3C and IMPALA , introduce differential entropy loss to encourage exploration . However , it may be infeasible to analytically evaluate the differential entropy of a mixture distribution without approximation ( Huber et al. , 2008 ) . As such , we use the entropy of the categorical distribution if a differential entropy term is needed during optimization . We refer to Appendix C for the action policy representation in DDPG and SAC where an invertible squashing function is applied to Gaussian components .
This paper presents an approach to multimodal policies based on Gaussian mixtures. The policy is parameterized as a set of Gaussian distributions (with state-invariant mean and variance) weighted by state-dependent mixture weights, which are the output of a (softmaxed) network. The weighting network and the means and covariances of the Gaussians are updated with standard RL losses. The authors propose a resampling scheme for mixture elements that consistently have low weight, in the style of resampling in particle filters. The authors evaluate the method with several RL algorithms including PPO and SAC, and on a variety of environments.
SP:ce4b30f5da82d5d28aabe201cf6180b230ff4e26
Adaptive Discretization for Continuous Control using Particle Filtering Policy Network
1 INTRODUCTION . In the last few years , impressive results have been obtained by deep reinforcement learning ( DRL ) both on physical and simulated articulated agents for a wide range of motor tasks that involve learning controls in high-dimensional continuous action spaces ( Lillicrap et al. , 2015 ; Levine et al. , 2016 ; Heess et al. , 2017 ; Haarnoja et al. , 2018c ; Rajeswaran et al. , 2018 ; Tan et al. , 2018 ; Peng et al. , 2018 ; 2020 ) . Many methods have been proposed that can improve the performance of DRL for continuous control problems , e.g . distributed training ( Mnih et al. , 2016 ; Espeholt et al. , 2018 ) , hierarchical learning ( Daniel et al. , 2012 ; Haarnoja et al. , 2018a ) , and maximum entropy regularization ( Haarnoja et al. , 2017 ; Liu et al. , 2017 ; Haarnoja et al. , 2018b ) . Most of such works , though , focus on learning mechanisms to boost performance beyond the basic distribution that defines the action policy , where a Gaussian-based policy or that with a squashing function is the most common choice as the basic policy to deal with continuous action spaces . However , the unimodal form of Gaussian distributions could experience difficulties when facing a multi-modal reward landscape during optimization and prematurely commit to suboptimal actions ( Daniel et al. , 2012 ; Haarnoja et al. , 2017 ) . To address the unimodality issue of Gaussian policies , people have been exploring more expressive distributions than Gaussians , with a simple solution being to discretize the action space and use categorical distributions as multi-modal action policies ( Andrychowicz et al. , 2020 ; Jaśkowski et al. , 2018 ; Tang & Agrawal , 2019 ) . However , categorical distributions can not be directly extended to many off-policy frameworks as their sampling process is not reparameterizable . Importantly , the performance of the action space discretization depends a lot on the choice of discrete atomic actions , which are usually picked uniformly due to lack of prior knowledge . On the surface , increasing the resolution of the discretized action space can make fine control more possible . However , in practice , this can be detrimental to the optimization during training , since the policy gradient variance increases with increasing number of atomic actions ( Tang & Agrawal , 2019 ) . Our work also focuses on action policies defined by an expressive , multimodal distribution . Instead of selecting fixed samples from the continuous action space , though , we exploit a particlebased approach to sample the action space dynamically during training and track the policy represented as a mixture distribution with state-independent components . We refer to the resulting policy network as Particle Filtering Policy Network ( PFPN ) . We evaluate PFPN on state-of-the-art on-policy and off-policy baselines using high-dimensional tasks from the PyBullet Roboschool en- vironments ( Coumans & Bai , 2016–2019 ) and the more challenging DeepMimic framework ( Peng et al. , 2018 ) . Our experiments show that baselines using PFPN exhibit better overall performance and/or speed of convergence and lead to more robust agent control . as compared to uniform discretization and to corresponding implementations with Gaussian policies . Main Contributions . Overall , we make the following contributions . We propose PFPN as a general framework for providing expressive action policies dealing with continuous action spaces . PFPN uses state-independent particles to represent atomic actions and optimizes their placement to meet the fine control demand of continuous control problems . We introduce a reparameterization trick that allows PFPN to be applicable to both on-policy and off-policy policy gradient methods . PFPN outperforms unimodal Gaussian policies and the uniform discretization scheme , and is more sampleefficient and stable across different training trials . In addition , it leads to high quality motion and generates controls that are more robust to external perturbations . Our work does not change the underlying model architecture or learning mechanisms of policy gradient algorithms and thus can be applied to most commonly used policy gradient algorithms . 2 BACKGROUND . We consider a standard reinforcement learning setup where given a time horizonH and the trajectory τ = ( s1 , a1 , · · · , sH , aH ) obtained by a transient modelM ( st+1|st , at ) and a parameterized action policy πθ ( at|st ) , with st ∈ Rn and at ∈ Rm denoting the state and action taken at time step t , respectively , the goal of learning is to optimize θ that maximize the cumulative reward : J ( θ ) = Eτ∼pθ ( τ ) [ rt ( τ ) ] = ∫ pθ ( τ ) r ( τ ) dτ . ( 1 ) Here , pθ ( τ ) denotes the state-action visitation distribution for the trajectory τ induced by the transient model M and the action policy πθ with parameter θ , and r ( τ ) = ∑ t r ( st , at ) where r ( st , at ) ∈ R is the reward received at time step t. We can maximize J ( θ ) by adjusting the policy parameters θ through the gradient ascent method , where the gradient of the expected reward can be determined according to the policy gradient theorem ( Sutton et al. , 2000 ) , i.e . ∇θJ ( θ ) = Eτ∼πθ ( ·|st ) [ At∇θ log πθ ( at|st ) |st ] . ( 2 ) whereAt ∈ R denotes an estimate to the reward term rt ( τ ) . In DRL , the estimator ofAt often relies on a separate network ( critic ) that is updated in tandem with the policy network ( actor ) . This gives rise to a family of policy gradient algorithms known as actor-critic . On-Policy and Off-Policy Actor-Critics . In on-policy learning , the update policy is also the behavior policy based on which a trajectory is obtained to estimate At . Common on-policy actor-critic algorithms include A3C ( Mnih et al. , 2016 ) and PPO ( Schulman et al. , 2017 ) , and directly employ Equation 2 for optimization . In off-policy learning , the policy can be updated without the knowledge of a whole trajectory . This results in more sample efficient approaches as samples are reusable . While algorithms such as Retrace ( Munos et al. , 2016 ) and PCL ( Nachum et al. , 2017 ) rely on Equation 2 , many off-policy algorithms exploit a critic network to estimate At given a state-action pair ( Q- or soft Q-value ) . Common off-policy actor-critic methods include DDPG ( Lillicrap et al. , 2015 ) , SAC ( Haarnoja et al. , 2018b ; d ) and their variants ( Haarnoja et al. , 2017 ; Fujimoto et al. , 2018 ) . These methods perform optimization to maximize a state-action value Q ( st , at ) . In order to update the policy network with parameter θ , they require the action policy to be reparameterizable such that the sampled action at can be rewritten as a function differentiable to the parameter θ , and the optimization can be done through the gradient∇atQ ( st , at ) ∇θat . Policy Representation . Given a multi-dimensional continuous action space , the most common choice in current DRL baselines is to model the policy πθ as a multivariate Gaussian distribution with independent components for each action dimension ( DDPG , SAC and their variants typically use Gaussian with a monotonic squashing function to stabilize the training ) . For simplicity , let us consider a simple case with a single action dimension and define the action policy as πθ ( ·|st ) : = N ( µθ ( st ) , σ2θ ( st ) ) . Then , we can obtain log πθ ( at|st ) ∝ − ( at − µθ ( st ) ) 2 . Given a sampled action at and the estimate of cumulative rewards At , the optimization process based on the above expression can be imagined as that of shifting µ θ ( st ) towards the direction of at ifAt is higher than the expectation , or to the opposite direction if At is smaller . Such an approach , though , can easily converge to a suboptimal solution , if , for example , the reward landscape has a basis between the current location of µ θ ( st ) and the optimal solution , or hard to be optimized if the reward land- scape is symmetric around µ θ ( st ) . These issues arise due to the fact that the Gaussian distribution is inherently unimodal , while the reward landscape could be multi-modal ( Haarnoja et al. , 2017 ) . Similar problems also could occur in Q-value based optimization , like DDPG and SAC . We refer to Appendix F for further discussion about the limitations of unimodal Gaussian policies and the value of expressive multimodal policies . 3 PARTICLE FILTERING POLICY NETWORK . In this section , we describe our Particle Filtering Policy Network ( PFPN ) that addresses the unimodality issues from which typical Gaussian-based policy networks suffer . Our approach represents the action policy as a mixture distribution obtained by adaptively discretizing the action space using state-independent particles , each capturing a Gaussian distribution . The policy network , instead of directly generating actions , it is tasked with choosing particles , while the final actions are obtained by sampling from the selected particles . 3.1 PARTICLE-BASED ACTION POLICY . Generally , we define P : = { 〈µi , k , wi , k ( st|θ ) 〉|i = 1 , · · · , n ; k = 1 , · · · , m } as a weighted set of particles for continuous control problems with a m-dimension action space and n particles distributed on each action space , where µi , k ∈ R representing an atomic action location on the kth dimension of the action space , and wi , k ( st|θ ) , satisfying ∑ i wi , k ( st|θ ) = 1 , denotes the associated weight generated by the policy network with parameter θ given the input state st. Let pi , k ( ai , k|µi , k , ξi , k ) denote the probability density function of the distribution defined by the location µi , k and a noise process ξi , k . Given P , we define the action policy as factorized across the action dimensions : πPθ ( at|st ) = ∏ k ∑ i wi , k ( st|θ ) pi , k ( at , k|µi , k , ξi , k ) , ( 3 ) where at = { at,1 , · · · , at , m } , at , k ∈ R is the sampled action at the time step t for the action dimension k , and wi , k ( ·|θ ) can be obtained by applying a softmax operation to the output neurons of the policy network for the k-th dimension . The state-independent parameter set , { µi , k } , gives us an adaptive discretization scheme that can be optimized during training . The choice of noise ξi , k relies on certain algorithms . It can be a scalar , e.g. , the Ornstein–Uhlenbeck noise in DDPG ( Lillicrap et al. , 2015 ) or an independent sample drawn from the standard normal distribution N ( 0 , 1 ) in soft Q-learning ( Haarnoja et al. , 2017 ) , or be decided by a learnable variable , for example , a sample drawn fromN ( 0 , ξ2i , k ) with a learnable standard deviation ξi , k . In the later case , a particle become a Gaussian componentN ( µi , k , ξ2i , k ) . Without loss of generality , we define the parameters of a particle as φi , k = [ µi , k , ξi , k ] for the following discussion . While the softmax operation gives us a categorical distribution defined by w· , k ( st|θ ) , the nature of the policy for each dimension is a mixture distribution with state-independent components defined by φi , k . The number of output neurons in PFPN increases linearly with the increase in the number of action dimensions and thus makes it suitable for high-dimensional control problems . Drawing samples from the mixture distribution can be done in two steps : first , based on the weights w· , k ( st|θ ) , we perform sampling on the categorical distribution to choose a particle jk for each dimension k , i.e . jk ( st ) ∼ P ( ·|w· , k ( st ) ) ; then , we can draw actions from the components represented by the chosen particles with noise as at , k ∼ pjk ( st ) ( ·|φjk ( st ) ) . Certain algorithms , like A3C and IMPALA , introduce differential entropy loss to encourage exploration . However , it may be infeasible to analytically evaluate the differential entropy of a mixture distribution without approximation ( Huber et al. , 2008 ) . As such , we use the entropy of the categorical distribution if a differential entropy term is needed during optimization . We refer to Appendix C for the action policy representation in DDPG and SAC where an invertible squashing function is applied to Gaussian components .
In the paper "Adaptive Discretization for Continuous Control using Particle Filtering Policy Network", the authors introduce a new way to discretise the action space of agent in RL settings by using a Particule Filtering approach. The main idea is that the learned policy will output the weight of each particle to define which one should be used, while the position of the particle changes during the learning process. Particles that are not moved (because they have a weight that is systematically too low) are removed and resampled from other particles.
SP:ce4b30f5da82d5d28aabe201cf6180b230ff4e26
Drop-Bottleneck: Learning Discrete Compressed Representation for Noise-Robust Exploration
1 INTRODUCTION . Data with noise or task-irrelevant information easily harm the training of a model ; for instance , the noisy-TV problem ( Burda et al. , 2019a ) is one of well-known such phenomena in reinforcement learning . If observations from the environment are modified to contain a TV screen , which changes its channel randomly based on the agent ’ s actions , the performance of curiosity-based exploration methods dramatically degrades ( Burda et al. , 2019a ; b ; Kim et al. , 2019 ; Savinov et al. , 2019 ) . The information bottleneck ( IB ) theory ( Tishby et al. , 2000 ; Tishby & Zaslavsky , 2015 ) provides a framework for dealing with such task-irrelevant information , and has been actively adopted to exploration in reinforcement learning ( Kim et al. , 2019 ; Igl et al. , 2019 ) . For an input variable X and a target variable Y , the IB theory introduces another variable Z , which is a compressed representation of X . The IB objective trains Z to contain less information about X but more information about Y as possible , where the two are quantified by mutual information terms of I ( Z ; X ) and I ( Z ; Y ) , respectively . IB methods such as Variational Information Bottleneck ( VIB ) ( Alemi et al. , 2017 ; Chalk et al. , 2016 ) and Information Dropout ( Achille & Soatto , 2018 ) show that the compression of the input variable X can be done by neural networks . In this work , we propose a novel information bottleneck method named Drop-Bottleneck that compresses the input variable by discretely dropping a subset of its input features that are irrelevant to the target variable . Drop-Bottleneck provides some nice properties as follows : • The compression term of Drop-Bottleneck ’ s objective is simple and is optimized as a tractable solution . • Drop-Bottleneck provides a deterministic compressed representation that still maintains majority of the learned indistinguishability i.e . compression . It is useful for inference tasks that require the input representation to be consistent and stable . • Drop-Bottleneck jointly trains a feature extractor and performs feature selection , as it learns the feature-wise drop probability taking into account each feature dimension ’ s relevance to the target task . Hence , unlike the compression provided by most neural network-based IB methods , our deterministic representation reduces the feature dimensionality , which makes the following inference better efficient with less amount of data . • Compared to VIB , both of Drop-Bottleneck ’ s original ( stochastic ) and deterministic compressed representations can greatly improve the robustness to adversarial examples . Based on the newly proposed Drop-Bottleneck , we design an exploration method that is robust against noisy observations in very sparse reward environments for reinforcement learning . Our exploration maintains an episodic memory and generates intrinsic rewards based on the predictability of new observations from the compressed representations of the ones in the memory . As a result , our method achieves state-of-the-art performance on multiple environments of VizDoom ( Kempka et al. , 2016 ) and DMLab ( Beattie et al. , 2016 ) . We also show that combining our exploration method with VIB instead of Drop-Bottleneck degrades the performance by meaningful margins . Additionally , we empirically compare with VIB to show Drop-Bottleneck ’ s superior robustness to adversarial examples and ability to reduce feature dimensionality for inference with ImageNet dataset ( Russakovsky et al. , 2015 ) . We also demonstrate that Drop-Bottleneck ’ s deterministic representation can be a reasonable replacement for its original representation in terms of the learned indistinguishability , with Occluded CIFAR dataset ( Achille & Soatto , 2018 ) . 2 RELATED WORK . 2.1 INFORMATION BOTTLENECK METHODS . There have been a number of IB methods that are approximations or special forms of the original IB objective . Variational Information Bottleneck ( VIB ) ( Alemi et al. , 2017 ) approximates the original IB objective by establishing variational bounds on the compression and prediction terms . Chalk et al . ( 2016 ) propose the same variational bound on the IB objective in the context of sparse coding tasks . Conditional Entropy Bottleneck ( CEB ) and Variational Conditional Entropy Bottleneck ( VCEB ) ( Fischer , 2020 ; Fischer & Alemi , 2020 ) use an alternative form of the original IB objective derived under the Minimum Necessary Information ( MNI ) criterion to preserve only a necessary amount of information . The IB theory ( Tishby et al. , 2000 ) has been used for various problems that require restriction of information or dealing with task-irrelevant information . Information Dropout ( Achille & Soatto , 2018 ) relates the IB principle to multiple practices in deep learning , including Dropout , disentanglement and variational autoencoding . Moyer et al . ( 2018 ) obtain representations invariant to specific factors under the variational autoencoder ( VAE ) ( Kingma & Welling , 2013 ) and VIB frameworks . Amjad & Geiger ( 2019 ) discuss the use of IB theory for classification tasks from a theoretical point of view . Dai et al . ( 2018 ) employ IB theory for compressing neural networks by pruning neurons in networks . Schulz et al . ( 2020 ) propose an attribution method that determines each input feature ’ s importance by enforcing compression of the input variable via the IB framework . Similar to our goal , some previous research has proposed variants of the original IB objective . Deterministic information bottleneck ( DIB ) ( Strouse & Schwab , 2017 ) replaces the compression term with an entropy term and solves the new objective using a deterministic encoder . Nonlinear information bottleneck ( NIB ) ( Kolchinsky et al. , 2019 ) modifies the IB objective by squaring the compression term and uses a non-parametric upper bound on the compression term . While DIB is always in the deterministic form , we can flexibly choose the stochastic one for training and the deterministic one for test . Compared to NIB , which is more computationally demanding than VIB due to its non-parametric upper bound , our method is faster . 2.2 REINFORCEMENT LEARNING WITH INFORMATION BOTTLENECK METHODS . The IB theory has been applied to several reinforcement learning ( RL ) tasks . Variational discriminator bottleneck ( Peng et al. , 2019 ) regulates the discriminator ’ s accuracy using the IB objective to improve adversarial training , and use it for imitation learning . Information Bottleneck Actor Critic ( Igl et al. , 2019 ) employs VIB to make the features generalize better and encourage the compression of states as input to the actor-critic algorithm . Curiosity-Bottleneck ( Kim et al. , 2019 ) employs the VIB framework to train a compressor that compresses the representation of states , which is still informative about the value function , and uses the compressiveness as exploration signals . InfoBot ( Goyal et al. , 2019 ) proposes a conditional version of VIB to improve the transferability of a goal-conditioned policy by minimizing the policy ’ s dependence on the goal . Variational bandwidth bottleneck ( Goyal et al. , 2020 ) uses a modified , conditional version of VIB , and solves RL tasks with privileged inputs ( i.e . valuable information that comes with a cost ) . Our exploration method differs from these methods in two aspects . First , we propose a new information bottleneck method that is not limited to exploration in RL but generally applicable to the problems for which the IB theory is used . Second , our method generates exploration signals based on the noise-robust predictability i.e . the predictability between noise-robust representations of observations . 3 DROP-BOTTLENECK . 3.1 PRELIMINARIES OF INFORMATION BOTTLENECK . Given an input random variable X , the information bottleneck ( IB ) framework ( Tishby et al. , 2000 ; Tishby & Zaslavsky , 2015 ) formalizes a problem of obtaining X ’ s compressed representation Z , which still and only preserves information relevant to the target variable Y . Its objective function is minimize−I ( Z ; Y ) + βI ( Z ; X ) , ( 1 ) where β is a Lagrangian multiplier . The first and second terms are prediction and compression terms , respectively . The prediction term I ( Z ; Y ) encourages Z to preserve task-relevant information while the compression term I ( Z ; X ) compresses the input information as much as possible . As reviewed in the previous section , there have been several IB methods ( Alemi et al. , 2017 ; Chalk et al. , 2016 ; Achille & Soatto , 2018 ; Strouse & Schwab , 2017 ; Kolchinsky et al. , 2019 ) , among which the ones derived using variational inference such as Variational Information Bottleneck ( VIB ) ( Alemi et al. , 2017 ) have become dominant due to its applicability to general problems . 3.2 DROP-BOTTLENECK . We propose a novel information bottleneck method called Drop-Bottleneck ( DB ) , where the input information is compressed by discretely dropping a subset of input features . Thus , its compression objective is simple and easy to optimize . Moreover , its representation is easily convertible to a deterministic version for inference tasks ( Section 3.3 ) , and it allows joint training with a feature extractor ( Section 3.4 ) . While discrete dropping of features has been explored by prior works including Dropout ( Srivastava et al. , 2014 ) , DB differs in that its goal is to assign different drop probabilities to feature variables based on their relevance to the target variable . For an input variableX = [ X1 , . . . , Xd ] and a drop probability p = [ p1 , . . . , pd ] ∈ [ 0 , 1 ] d , we define its compressed representation as Z = Cp ( X ) = [ c ( X1 , p1 ) , . . . , c ( Xd , pd ) ] such that c ( Xi , pi ) = b · Bernoulli ( 1− pi ) ·Xi , where b = d d−∑k pk , ( 2 ) for i = 1 , . . . , d. That is , the compression procedure drops the i-th input feature ( i.e . replaced by zero ) with probability pi . Since the drop probability is to be learned , we use a scaling factor b to keep the scale of Z constant . We use a single scaling factor for all feature dimensions in order to preserve the relative scales between the features . With the definition in Equation ( 2 ) , we derive the compression term of DB to minimize as I ( Z ; X ) = d∑ i=1 I ( Zi ; X1 , . . . , Xd|Z1 , . . . , Zi−1 ) ( 3 ) = d∑ i=1 [ I ( Zi ; Xi|Z1 , . . . , Zi−1 ) + I ( Zi ; X1 , . . . , Xd \Xi|Z1 , . . . , Zi−1 , Xi ) ] ( 4 ) = d∑ i=1 I ( Zi ; Xi|Z1 , . . . , Zi−1 ) ≤ d∑ i=1 I ( Zi ; Xi ) = Î ( Z ; X ) ( 5 ) using that Zi⊥X1 , . . . , Xi−1 , Xi+1 , . . . , Xd|Z1 , . . . , Zi−1 , Xi and Zi⊥Z1 , . . . , Zi−1|Xi . Note that Î ( Z ; X ) − I ( Z ; X ) = ( ∑d i=1H ( Zi ) ) − H ( Z1 , . . . , Zd ) = TC ( Z ) where TC ( Z ) is the total correlation of Z and H ( · ) denotes the entropy , and Î ( Z ; X ) = I ( Z ; X ) if X1 , . . . , Xd are independent . To provide a rough view on the gap , due to the joint optimization with the compression term Î ( Z ; X ) and the prediction term I ( Z ; Y ) , Z becomes likely to preserve less redundant and less correlated features , and TC ( Z ) could decrease as the optimization progresses . Finally , DB ’ s new compression term , Î ( Z ; X ) , is computed as Î ( Z ; X ) = d∑ i=1 I ( Zi ; Xi ) = d∑ i=1 ( H ( Xi ) −H ( Xi|Zi ) ) ( 6 ) = d∑ i=1 ( H ( Xi ) − pi ·H ( Xi|Zi = 0 ) − ( 1− pi ) ·H ( Xi|Zi = bXi ) ) ( 7 ) ≈ d∑ i=1 ( H ( Xi ) − pi ·H ( Xi ) − ( 1− pi ) · 0 ) = d∑ i=1 H ( Xi ) ( 1− pi ) . ( 8 ) From Equation ( 7 ) to Equation ( 8 ) , we use the two ideas : ( i ) H ( Xi|Zi = 0 ) = H ( Xi ) because Zi = 0 means it contains no information about Xi , and ( ii ) H ( Xi|Zi = bXi ) = 0 because Zi = bXi means Zi preserves the feature ( i.e . Zi fully identifies Xi ) and thus their conditional entropy becomes zero . Importantly , DB ’ s compression term is computed as the simple tractable expression in Equation ( 8 ) . As the goal of the compression term is to penalize I ( Z ; X ) not H ( X ) , the drop probability p is the only parameter optimized with our compression term . Thus , each H ( Xi ) can be computed with any entropy estimation method such as the binning-based estimation , which involves quantization for continuous Xi , since the computation has no need to be differentiable . However , one issue of Equation ( 8 ) is that Z is not differentiable with respect to p as Bernoulli distributions are not differentiable . We thus use the Concrete relaxation ( Maddison et al. , 2017 ; Jang et al. , 2016 ) of the Bernoulli distribution to update p via gradients from Z : Bernoulli ( p ) ≈ σ ( 1 λ ( log p− log ( 1− p ) + log u− log ( 1− u ) ) ) , ( 9 ) where u ∼ Uniform ( 0 , 1 ) and λ is a temperature for the Concrete distribution . Intuitively , p is trained to assign a high drop probability to the feature that is irrelevant to or redundant for predicting the target variable Y .
The paper contributes a novel method, Drop-Bottleneck (DB), for discretely dropping input features that are irrelevant for predicting the target variable. Key idea is to instantiate the compression term of the information bottleneck framework with learned term that sets irrelevant feature dimensions to 0. To this end, a drop probability is learned for each dimension. Dimensions that have a lower probability than 0.5 (a fixed threshold) of being relevant are set to 0.
SP:eaeee8eeb85378f774e98259a43e7b8d794a3560
Drop-Bottleneck: Learning Discrete Compressed Representation for Noise-Robust Exploration
1 INTRODUCTION . Data with noise or task-irrelevant information easily harm the training of a model ; for instance , the noisy-TV problem ( Burda et al. , 2019a ) is one of well-known such phenomena in reinforcement learning . If observations from the environment are modified to contain a TV screen , which changes its channel randomly based on the agent ’ s actions , the performance of curiosity-based exploration methods dramatically degrades ( Burda et al. , 2019a ; b ; Kim et al. , 2019 ; Savinov et al. , 2019 ) . The information bottleneck ( IB ) theory ( Tishby et al. , 2000 ; Tishby & Zaslavsky , 2015 ) provides a framework for dealing with such task-irrelevant information , and has been actively adopted to exploration in reinforcement learning ( Kim et al. , 2019 ; Igl et al. , 2019 ) . For an input variable X and a target variable Y , the IB theory introduces another variable Z , which is a compressed representation of X . The IB objective trains Z to contain less information about X but more information about Y as possible , where the two are quantified by mutual information terms of I ( Z ; X ) and I ( Z ; Y ) , respectively . IB methods such as Variational Information Bottleneck ( VIB ) ( Alemi et al. , 2017 ; Chalk et al. , 2016 ) and Information Dropout ( Achille & Soatto , 2018 ) show that the compression of the input variable X can be done by neural networks . In this work , we propose a novel information bottleneck method named Drop-Bottleneck that compresses the input variable by discretely dropping a subset of its input features that are irrelevant to the target variable . Drop-Bottleneck provides some nice properties as follows : • The compression term of Drop-Bottleneck ’ s objective is simple and is optimized as a tractable solution . • Drop-Bottleneck provides a deterministic compressed representation that still maintains majority of the learned indistinguishability i.e . compression . It is useful for inference tasks that require the input representation to be consistent and stable . • Drop-Bottleneck jointly trains a feature extractor and performs feature selection , as it learns the feature-wise drop probability taking into account each feature dimension ’ s relevance to the target task . Hence , unlike the compression provided by most neural network-based IB methods , our deterministic representation reduces the feature dimensionality , which makes the following inference better efficient with less amount of data . • Compared to VIB , both of Drop-Bottleneck ’ s original ( stochastic ) and deterministic compressed representations can greatly improve the robustness to adversarial examples . Based on the newly proposed Drop-Bottleneck , we design an exploration method that is robust against noisy observations in very sparse reward environments for reinforcement learning . Our exploration maintains an episodic memory and generates intrinsic rewards based on the predictability of new observations from the compressed representations of the ones in the memory . As a result , our method achieves state-of-the-art performance on multiple environments of VizDoom ( Kempka et al. , 2016 ) and DMLab ( Beattie et al. , 2016 ) . We also show that combining our exploration method with VIB instead of Drop-Bottleneck degrades the performance by meaningful margins . Additionally , we empirically compare with VIB to show Drop-Bottleneck ’ s superior robustness to adversarial examples and ability to reduce feature dimensionality for inference with ImageNet dataset ( Russakovsky et al. , 2015 ) . We also demonstrate that Drop-Bottleneck ’ s deterministic representation can be a reasonable replacement for its original representation in terms of the learned indistinguishability , with Occluded CIFAR dataset ( Achille & Soatto , 2018 ) . 2 RELATED WORK . 2.1 INFORMATION BOTTLENECK METHODS . There have been a number of IB methods that are approximations or special forms of the original IB objective . Variational Information Bottleneck ( VIB ) ( Alemi et al. , 2017 ) approximates the original IB objective by establishing variational bounds on the compression and prediction terms . Chalk et al . ( 2016 ) propose the same variational bound on the IB objective in the context of sparse coding tasks . Conditional Entropy Bottleneck ( CEB ) and Variational Conditional Entropy Bottleneck ( VCEB ) ( Fischer , 2020 ; Fischer & Alemi , 2020 ) use an alternative form of the original IB objective derived under the Minimum Necessary Information ( MNI ) criterion to preserve only a necessary amount of information . The IB theory ( Tishby et al. , 2000 ) has been used for various problems that require restriction of information or dealing with task-irrelevant information . Information Dropout ( Achille & Soatto , 2018 ) relates the IB principle to multiple practices in deep learning , including Dropout , disentanglement and variational autoencoding . Moyer et al . ( 2018 ) obtain representations invariant to specific factors under the variational autoencoder ( VAE ) ( Kingma & Welling , 2013 ) and VIB frameworks . Amjad & Geiger ( 2019 ) discuss the use of IB theory for classification tasks from a theoretical point of view . Dai et al . ( 2018 ) employ IB theory for compressing neural networks by pruning neurons in networks . Schulz et al . ( 2020 ) propose an attribution method that determines each input feature ’ s importance by enforcing compression of the input variable via the IB framework . Similar to our goal , some previous research has proposed variants of the original IB objective . Deterministic information bottleneck ( DIB ) ( Strouse & Schwab , 2017 ) replaces the compression term with an entropy term and solves the new objective using a deterministic encoder . Nonlinear information bottleneck ( NIB ) ( Kolchinsky et al. , 2019 ) modifies the IB objective by squaring the compression term and uses a non-parametric upper bound on the compression term . While DIB is always in the deterministic form , we can flexibly choose the stochastic one for training and the deterministic one for test . Compared to NIB , which is more computationally demanding than VIB due to its non-parametric upper bound , our method is faster . 2.2 REINFORCEMENT LEARNING WITH INFORMATION BOTTLENECK METHODS . The IB theory has been applied to several reinforcement learning ( RL ) tasks . Variational discriminator bottleneck ( Peng et al. , 2019 ) regulates the discriminator ’ s accuracy using the IB objective to improve adversarial training , and use it for imitation learning . Information Bottleneck Actor Critic ( Igl et al. , 2019 ) employs VIB to make the features generalize better and encourage the compression of states as input to the actor-critic algorithm . Curiosity-Bottleneck ( Kim et al. , 2019 ) employs the VIB framework to train a compressor that compresses the representation of states , which is still informative about the value function , and uses the compressiveness as exploration signals . InfoBot ( Goyal et al. , 2019 ) proposes a conditional version of VIB to improve the transferability of a goal-conditioned policy by minimizing the policy ’ s dependence on the goal . Variational bandwidth bottleneck ( Goyal et al. , 2020 ) uses a modified , conditional version of VIB , and solves RL tasks with privileged inputs ( i.e . valuable information that comes with a cost ) . Our exploration method differs from these methods in two aspects . First , we propose a new information bottleneck method that is not limited to exploration in RL but generally applicable to the problems for which the IB theory is used . Second , our method generates exploration signals based on the noise-robust predictability i.e . the predictability between noise-robust representations of observations . 3 DROP-BOTTLENECK . 3.1 PRELIMINARIES OF INFORMATION BOTTLENECK . Given an input random variable X , the information bottleneck ( IB ) framework ( Tishby et al. , 2000 ; Tishby & Zaslavsky , 2015 ) formalizes a problem of obtaining X ’ s compressed representation Z , which still and only preserves information relevant to the target variable Y . Its objective function is minimize−I ( Z ; Y ) + βI ( Z ; X ) , ( 1 ) where β is a Lagrangian multiplier . The first and second terms are prediction and compression terms , respectively . The prediction term I ( Z ; Y ) encourages Z to preserve task-relevant information while the compression term I ( Z ; X ) compresses the input information as much as possible . As reviewed in the previous section , there have been several IB methods ( Alemi et al. , 2017 ; Chalk et al. , 2016 ; Achille & Soatto , 2018 ; Strouse & Schwab , 2017 ; Kolchinsky et al. , 2019 ) , among which the ones derived using variational inference such as Variational Information Bottleneck ( VIB ) ( Alemi et al. , 2017 ) have become dominant due to its applicability to general problems . 3.2 DROP-BOTTLENECK . We propose a novel information bottleneck method called Drop-Bottleneck ( DB ) , where the input information is compressed by discretely dropping a subset of input features . Thus , its compression objective is simple and easy to optimize . Moreover , its representation is easily convertible to a deterministic version for inference tasks ( Section 3.3 ) , and it allows joint training with a feature extractor ( Section 3.4 ) . While discrete dropping of features has been explored by prior works including Dropout ( Srivastava et al. , 2014 ) , DB differs in that its goal is to assign different drop probabilities to feature variables based on their relevance to the target variable . For an input variableX = [ X1 , . . . , Xd ] and a drop probability p = [ p1 , . . . , pd ] ∈ [ 0 , 1 ] d , we define its compressed representation as Z = Cp ( X ) = [ c ( X1 , p1 ) , . . . , c ( Xd , pd ) ] such that c ( Xi , pi ) = b · Bernoulli ( 1− pi ) ·Xi , where b = d d−∑k pk , ( 2 ) for i = 1 , . . . , d. That is , the compression procedure drops the i-th input feature ( i.e . replaced by zero ) with probability pi . Since the drop probability is to be learned , we use a scaling factor b to keep the scale of Z constant . We use a single scaling factor for all feature dimensions in order to preserve the relative scales between the features . With the definition in Equation ( 2 ) , we derive the compression term of DB to minimize as I ( Z ; X ) = d∑ i=1 I ( Zi ; X1 , . . . , Xd|Z1 , . . . , Zi−1 ) ( 3 ) = d∑ i=1 [ I ( Zi ; Xi|Z1 , . . . , Zi−1 ) + I ( Zi ; X1 , . . . , Xd \Xi|Z1 , . . . , Zi−1 , Xi ) ] ( 4 ) = d∑ i=1 I ( Zi ; Xi|Z1 , . . . , Zi−1 ) ≤ d∑ i=1 I ( Zi ; Xi ) = Î ( Z ; X ) ( 5 ) using that Zi⊥X1 , . . . , Xi−1 , Xi+1 , . . . , Xd|Z1 , . . . , Zi−1 , Xi and Zi⊥Z1 , . . . , Zi−1|Xi . Note that Î ( Z ; X ) − I ( Z ; X ) = ( ∑d i=1H ( Zi ) ) − H ( Z1 , . . . , Zd ) = TC ( Z ) where TC ( Z ) is the total correlation of Z and H ( · ) denotes the entropy , and Î ( Z ; X ) = I ( Z ; X ) if X1 , . . . , Xd are independent . To provide a rough view on the gap , due to the joint optimization with the compression term Î ( Z ; X ) and the prediction term I ( Z ; Y ) , Z becomes likely to preserve less redundant and less correlated features , and TC ( Z ) could decrease as the optimization progresses . Finally , DB ’ s new compression term , Î ( Z ; X ) , is computed as Î ( Z ; X ) = d∑ i=1 I ( Zi ; Xi ) = d∑ i=1 ( H ( Xi ) −H ( Xi|Zi ) ) ( 6 ) = d∑ i=1 ( H ( Xi ) − pi ·H ( Xi|Zi = 0 ) − ( 1− pi ) ·H ( Xi|Zi = bXi ) ) ( 7 ) ≈ d∑ i=1 ( H ( Xi ) − pi ·H ( Xi ) − ( 1− pi ) · 0 ) = d∑ i=1 H ( Xi ) ( 1− pi ) . ( 8 ) From Equation ( 7 ) to Equation ( 8 ) , we use the two ideas : ( i ) H ( Xi|Zi = 0 ) = H ( Xi ) because Zi = 0 means it contains no information about Xi , and ( ii ) H ( Xi|Zi = bXi ) = 0 because Zi = bXi means Zi preserves the feature ( i.e . Zi fully identifies Xi ) and thus their conditional entropy becomes zero . Importantly , DB ’ s compression term is computed as the simple tractable expression in Equation ( 8 ) . As the goal of the compression term is to penalize I ( Z ; X ) not H ( X ) , the drop probability p is the only parameter optimized with our compression term . Thus , each H ( Xi ) can be computed with any entropy estimation method such as the binning-based estimation , which involves quantization for continuous Xi , since the computation has no need to be differentiable . However , one issue of Equation ( 8 ) is that Z is not differentiable with respect to p as Bernoulli distributions are not differentiable . We thus use the Concrete relaxation ( Maddison et al. , 2017 ; Jang et al. , 2016 ) of the Bernoulli distribution to update p via gradients from Z : Bernoulli ( p ) ≈ σ ( 1 λ ( log p− log ( 1− p ) + log u− log ( 1− u ) ) ) , ( 9 ) where u ∼ Uniform ( 0 , 1 ) and λ is a temperature for the Concrete distribution . Intuitively , p is trained to assign a high drop probability to the feature that is irrelevant to or redundant for predicting the target variable Y .
This paper proposes an information bottleneck method, Drop-Bottleneck, that allows the input to be compressed by dropping each input feature with probability p_i. The model then learns the drop probability vector p = [p_1, ... , p_n], where dropping "redundant" features will reduce the "compression penalty" term I(XZ). The approach is demonstrated in experiments in (1) robust exploration setting for RL, (2) adversarial attacks on ImageNet, and (3) an experiment showing that their approach is able to maintain performance on ImageNet with reduced dimensionality.
SP:eaeee8eeb85378f774e98259a43e7b8d794a3560
Cross-Modal Domain Adaptation for Reinforcement Learning
To overcome the unbearable reinforcement training of agents in the real-world , the sim-to-real approach , i.e. , training in simulators and adapting to target environments , is a promising direction . However , crafting a delicately simulator can also be difficult and costly . For example , to simulate vision-based robotics , simulators have to render high-fidelity images , which can cost tremendous effort . This work aims at learning a cross-modal mapping between intrinsic states of the simulator and high-dimensional observations of the target environments . This cross-modal mapping allows agents trained on the source domain of state input to adapt well to the target domain of image input . However , learning the cross-modal mapping can be ill-posed for previous same-modal domain adaptation methods , since the structural constraints no longer exist . We propose to leveraging the sequential information in the trajectories and incorporating the policy to guide the training process . Experiments on MuJoCo environments show that the proposed crossmodal domain adaptation approach enables the agents to be deployed directly in the target domain with only a small performance gap , while previous methods designed for same-modal domain adaptation fail on this task . 1 INTRODUCTION . Deep Reinforcement Learning ( DRL ) for vision-based robotic-control tasks has achieved remarkable success in recent years ( Francis et al. , 2020 ; Zhang et al. , 2019 ; Zeng et al. , 2018 ; Riedmiller et al. , 2018 ; Levine et al. , 2018 ) . However , current RL algorithms necessitate a substantial number of interactions with the environment , which is costly both in time and money on real robots . An appealing alternative is to train policies in simulators , then transfer these policies onto real-world systems ( Rao et al. , 2020 ; James et al. , 2019 ; Yan et al. , 2017 ) . Due to inevitable differences between simulators and the real world , which is also known as the “ reality gap ” ( Jakobi et al. , 1995 ) , applying policies trained in one domain directly to another almost surely fail , especially in visual-input tasks , due to the poor generalization of RL polices ( Cobbe et al. , 2019 ) . Domain adaptation is a common way to improve transferability by mapping inputs from two domains to an aligned distribution . Although distribution alignment is difficult with limited data , many recent works have adopted unsupervised visual domain adaptation ( Hoffman et al. , 2018 ; Ganin et al. , 2017 ; Yi et al. , 2017 ; Kim et al. , 2017 ) to learn the mapping function without a groundtruth pairing . These adaptation methods exploit structural constraints ( Fu et al. , 2019 ) in two samemodal domains ( i.e. , learned on simulated images and deployed on real images ) to overcome the intrinsic ill-posedness of distribution matching as shown in Fig . 1 ( a ) — mapping an instance in the target domain to anything of a similar probability in the source domain is “ reasonable ” if we only consider distribution matching . However , training on simulated images introduces unwanted costs and difficulties , which are ignored in current works . First , a rendering engine needs more human engineering and runs much slower ( can be up to 20× slower according to Xia et al . ( 2018 ) ) than a pure rigid body simulator , which adds considerable cost to the overall process . Second , using RL methods to train a policy with image inputs is usually harder than training with state inputs ( Kaiser et al. , 2020 ; Tenenbaum , 2018 ) , resulting in a sub-optimal simulation policy . An ideal solution to avoid such problems is to train policies with simulated states and adapt the learned polices to real-world images . However , all the structural constraints based on the modality consistency can not be used and the distribution alignment task by learning a mapping function becomes hard to solve . In this paper , we propose Cross-mOdal Domain Adaptation with Sequential structure ( CODAS ) that learns a mapping function from images in the target domain to states in the source domain . With the help of the learned mapping function , policies trained on states in the source domain can be deployed in the target domain of images directly . Specifically , based on the sequential nature of reinforcement learning problems , we formulate the cross-domain adaptation problem as a sequential variational inference problem and derive a series of solvable optimization objectives in CODAS . It is worth noting that our work is different from recent works that learn state embeddings from image inputs , which map images to an arbitrary subspace in a low-dimensional vector space . In CODAS , we embed the image space into a vector space with clear meanings ( defined in the statebased simulator ) , which improves the interpretability of the policy when deployed in the real world . We evaluate our method on 6 MuJoCo ( Todorov et al. , 2012 ) environments provided in OpenAI Gym ( Brockman et al. , 2016 ) , where we treat states as the source domain , and rendered images as the target domain , respectively . Experiments are conducted in the scenario where only offline real data are available . Experiment results show that the mapping function learned by our method can help transfer the policy to target domain images with a small performance degradation . Previous methods that use unaligned Generative Adversarial Networks ( GANs ) suffer from a severe performance degradation on this cross-modal transfer problem . The experiments provide an optimistic result which indicates cross-modal domain adaptation can serve as a low-cost Sim2Real approach . 2 RELATED WORK . To our best knowledge , this work is the first to address cross-modal domain adaptation in RL setting . We will discuss two research areas closely related to this topic , which are , ( 1 ) unsupervised visual domain adaptation in RL and ( 2 ) image-input representation learning in RL . 2.1 VISUAL DOMAIN ADAPTATION IN RL . Unsupervised visual domain adaptation aims to map the source domain and the target domain to an aligned distribution without pairing the data . Prior methods fall into two major categories : featurelevel adaptation , where domain-invariant features are learnt ( Gopalan et al. , 2011 ; Caseiro et al. , 2015 ; Long et al. , 2015 ; Ganin et al. , 2017 ) , and pixel-level adaptation , where pixels from a source image used to generate an image that looks like one from the target domain ( Bousmalis et al. , 2017 ; Yoo et al. , 2016 ; Taigman et al. , 2017 ; Hoffman et al. , 2018 ) . Pixel-level adaptation is challenging when data from two domains are unpaired . Prior works tackle this problem by using GANs ( Goodfellow et al. , 2014 ) conditioned on simulated images to generate realistic images . Gamrian & Goldberg ( 2019 ) transfers policies from Atari Games ( Bellemare et al. , 2015 ) to modified variants by training a GAN to map images from the target domain to the source domain . GraspGAN ( Bousmalis et al. , 2018 ) addresses domain adaptation in robotic grasping by having the GAN reproduce the segmentation mask for the simulated image as an auxiliary task , including the robot arm , objects , and the bin . RCAN ( James et al. , 2019 ) adopts ideas from domain randomization by learning a mapping of images from randomized simulations to a canonical simulation and treating the real world just as one of the random simulations . RL-CycleGAN ( Rao et al. , 2020 ) unifies the learning of a CycleGAN ( Zhu et al. , 2017 ) and an RL policy , claiming better performance by learning features that are most crucial to the Q-function in RL . Image-to-image domain adaptation can somewhat bypass the ill-posedness for distribution matching ( See Fig . 1 ( a ) ) since it often enjoys an implicit advantage that images differ locally , in color , textile , lighting , but resembles globally between two domains , while images and states differ essentially . Some works impose extra structural constraints ( e.g. , segmentation , geometry ) ( Fu et al. , 2019 ; Bousmalis et al. , 2018 ) , but such tricks fail in image-to-state domain adaptation either . In this work , we force the mapped states to follow transition consistency by using a recurrent structure ( See Fig . 1 ( b ) ) and to be able to recover the pre-learned policy . We also employ a stochastic mapping function with the help of a variational encoder that is more robust to target domain data noise . 2.2 REPRESENTATION LEARNING IN RL . Representation learning aims to transform high-dimensional data into lower-dimensional vector representations , which suit RL better . It is widely accepted that learning policies from states ( embeddings ) is significantly more sample-efficient than learning from pixels , both empirically ( Kaiser et al. , 2020 ; Tenenbaum , 2018 ; Tassa et al. , 2018 ) and theoretically ( Jin et al. , 2020 ) . Sequential auto-encoder is a common network structure to learn state representations by minimizing reconstruction loss . Early works on DRL from images ( Ha & Schmidhuber , 2018 ; Lange et al. , 2012 ; Lange & Riedmiller , 2010 ) use a two-step learning process where an auto-encoder is first trained to learn a low-dimensional representation , and subsequently a policy or model is learned based on this representation . Later works on model-based RL improve representation learning by jointly training the encoder and the dynamics model end-to-end ( Watter et al. , 2015 ) – this has been proved effective in learning useful task-oriented representations . PlaNet ( Hafner et al. , 2019 ) learns a hybrid of stochastic and deterministic latent state models using a reconstruction loss . SOLAR ( Zhang et al. , 2019 ) combines probabilistic graphic models with a simple network structure to fit local linear transitions . Some recent works adopt advancements in unsupervised representation learning . CURL ( Laskin et al. , 2020b ) utilizes contrastive learning methods to capture essential information in an image that distinguishes from others , though later works ( Laskin et al. , 2020a ; Kostrikov et al. , 2020 ) point out that data augmentation may play the major role here . Our work utilizes a sequential variational encoder structure to capture sequential information from trajectories . The main difference between our work and representation learning is whether the state space is predefined . We add extra supervised information to guide the training of the mapping by minimizing the distance between the distributions of the mapped states and the original states , and by enforcing the policy to recover the actions from the mapped states . As a result , we successfully learn states that match the ground-truth simulator states well . The mapped states can be directly fed into the pre-trained policy network . 3 CROSS-MODAL DOMAIN ADAPTATION WITH SEQUENTIAL STRUCTURE . Our work follows the problem setting similar to previous methods that tackle visual domain adaptation problems in RL . We have a policy π pre-trained in the source domain ( state ) and a dataset pre-collected in the target domain ( image ) . The task is to learn a mapping qφ from images to states . In the deployment , agents interact with a new policy π̃ ( o ) = ( π ◦ qφ ) ( o ) , where ◦ denotes function composition . During the training of the mapping function , only the source domain is accessible . This section is organized as follows . Sec . 3.1 formulates the cross-modal domain adaptation as a variational inference problem . Sec . 3.2 decomposes the variational inference problem into several feasible optimization objectives . Sec . 3.3 proposes a residual network structure to handle the complex long-horizon training of the sequential structure .
The paper proposes a new approach for performing cross-modal domain adaptation, i.e. adapting a policy trained with inputs from modality A (eg low-dimensional environment state) to work with inputs from domain B (eg images). The main use case demonstrated in the paper is the adaptation of policies trained on states in a simulator to work on image inputs, which can be useful for eg real world deployment where states might not be available. While it is a very classic approach to separately train a perception module images --> state (eg in robotics), the main novelty of the presented method is, that this mapping can be learned without the need for paired [image, state] data.
SP:3d06de343694b2f9db428428f68dee272e459486
Cross-Modal Domain Adaptation for Reinforcement Learning
To overcome the unbearable reinforcement training of agents in the real-world , the sim-to-real approach , i.e. , training in simulators and adapting to target environments , is a promising direction . However , crafting a delicately simulator can also be difficult and costly . For example , to simulate vision-based robotics , simulators have to render high-fidelity images , which can cost tremendous effort . This work aims at learning a cross-modal mapping between intrinsic states of the simulator and high-dimensional observations of the target environments . This cross-modal mapping allows agents trained on the source domain of state input to adapt well to the target domain of image input . However , learning the cross-modal mapping can be ill-posed for previous same-modal domain adaptation methods , since the structural constraints no longer exist . We propose to leveraging the sequential information in the trajectories and incorporating the policy to guide the training process . Experiments on MuJoCo environments show that the proposed crossmodal domain adaptation approach enables the agents to be deployed directly in the target domain with only a small performance gap , while previous methods designed for same-modal domain adaptation fail on this task . 1 INTRODUCTION . Deep Reinforcement Learning ( DRL ) for vision-based robotic-control tasks has achieved remarkable success in recent years ( Francis et al. , 2020 ; Zhang et al. , 2019 ; Zeng et al. , 2018 ; Riedmiller et al. , 2018 ; Levine et al. , 2018 ) . However , current RL algorithms necessitate a substantial number of interactions with the environment , which is costly both in time and money on real robots . An appealing alternative is to train policies in simulators , then transfer these policies onto real-world systems ( Rao et al. , 2020 ; James et al. , 2019 ; Yan et al. , 2017 ) . Due to inevitable differences between simulators and the real world , which is also known as the “ reality gap ” ( Jakobi et al. , 1995 ) , applying policies trained in one domain directly to another almost surely fail , especially in visual-input tasks , due to the poor generalization of RL polices ( Cobbe et al. , 2019 ) . Domain adaptation is a common way to improve transferability by mapping inputs from two domains to an aligned distribution . Although distribution alignment is difficult with limited data , many recent works have adopted unsupervised visual domain adaptation ( Hoffman et al. , 2018 ; Ganin et al. , 2017 ; Yi et al. , 2017 ; Kim et al. , 2017 ) to learn the mapping function without a groundtruth pairing . These adaptation methods exploit structural constraints ( Fu et al. , 2019 ) in two samemodal domains ( i.e. , learned on simulated images and deployed on real images ) to overcome the intrinsic ill-posedness of distribution matching as shown in Fig . 1 ( a ) — mapping an instance in the target domain to anything of a similar probability in the source domain is “ reasonable ” if we only consider distribution matching . However , training on simulated images introduces unwanted costs and difficulties , which are ignored in current works . First , a rendering engine needs more human engineering and runs much slower ( can be up to 20× slower according to Xia et al . ( 2018 ) ) than a pure rigid body simulator , which adds considerable cost to the overall process . Second , using RL methods to train a policy with image inputs is usually harder than training with state inputs ( Kaiser et al. , 2020 ; Tenenbaum , 2018 ) , resulting in a sub-optimal simulation policy . An ideal solution to avoid such problems is to train policies with simulated states and adapt the learned polices to real-world images . However , all the structural constraints based on the modality consistency can not be used and the distribution alignment task by learning a mapping function becomes hard to solve . In this paper , we propose Cross-mOdal Domain Adaptation with Sequential structure ( CODAS ) that learns a mapping function from images in the target domain to states in the source domain . With the help of the learned mapping function , policies trained on states in the source domain can be deployed in the target domain of images directly . Specifically , based on the sequential nature of reinforcement learning problems , we formulate the cross-domain adaptation problem as a sequential variational inference problem and derive a series of solvable optimization objectives in CODAS . It is worth noting that our work is different from recent works that learn state embeddings from image inputs , which map images to an arbitrary subspace in a low-dimensional vector space . In CODAS , we embed the image space into a vector space with clear meanings ( defined in the statebased simulator ) , which improves the interpretability of the policy when deployed in the real world . We evaluate our method on 6 MuJoCo ( Todorov et al. , 2012 ) environments provided in OpenAI Gym ( Brockman et al. , 2016 ) , where we treat states as the source domain , and rendered images as the target domain , respectively . Experiments are conducted in the scenario where only offline real data are available . Experiment results show that the mapping function learned by our method can help transfer the policy to target domain images with a small performance degradation . Previous methods that use unaligned Generative Adversarial Networks ( GANs ) suffer from a severe performance degradation on this cross-modal transfer problem . The experiments provide an optimistic result which indicates cross-modal domain adaptation can serve as a low-cost Sim2Real approach . 2 RELATED WORK . To our best knowledge , this work is the first to address cross-modal domain adaptation in RL setting . We will discuss two research areas closely related to this topic , which are , ( 1 ) unsupervised visual domain adaptation in RL and ( 2 ) image-input representation learning in RL . 2.1 VISUAL DOMAIN ADAPTATION IN RL . Unsupervised visual domain adaptation aims to map the source domain and the target domain to an aligned distribution without pairing the data . Prior methods fall into two major categories : featurelevel adaptation , where domain-invariant features are learnt ( Gopalan et al. , 2011 ; Caseiro et al. , 2015 ; Long et al. , 2015 ; Ganin et al. , 2017 ) , and pixel-level adaptation , where pixels from a source image used to generate an image that looks like one from the target domain ( Bousmalis et al. , 2017 ; Yoo et al. , 2016 ; Taigman et al. , 2017 ; Hoffman et al. , 2018 ) . Pixel-level adaptation is challenging when data from two domains are unpaired . Prior works tackle this problem by using GANs ( Goodfellow et al. , 2014 ) conditioned on simulated images to generate realistic images . Gamrian & Goldberg ( 2019 ) transfers policies from Atari Games ( Bellemare et al. , 2015 ) to modified variants by training a GAN to map images from the target domain to the source domain . GraspGAN ( Bousmalis et al. , 2018 ) addresses domain adaptation in robotic grasping by having the GAN reproduce the segmentation mask for the simulated image as an auxiliary task , including the robot arm , objects , and the bin . RCAN ( James et al. , 2019 ) adopts ideas from domain randomization by learning a mapping of images from randomized simulations to a canonical simulation and treating the real world just as one of the random simulations . RL-CycleGAN ( Rao et al. , 2020 ) unifies the learning of a CycleGAN ( Zhu et al. , 2017 ) and an RL policy , claiming better performance by learning features that are most crucial to the Q-function in RL . Image-to-image domain adaptation can somewhat bypass the ill-posedness for distribution matching ( See Fig . 1 ( a ) ) since it often enjoys an implicit advantage that images differ locally , in color , textile , lighting , but resembles globally between two domains , while images and states differ essentially . Some works impose extra structural constraints ( e.g. , segmentation , geometry ) ( Fu et al. , 2019 ; Bousmalis et al. , 2018 ) , but such tricks fail in image-to-state domain adaptation either . In this work , we force the mapped states to follow transition consistency by using a recurrent structure ( See Fig . 1 ( b ) ) and to be able to recover the pre-learned policy . We also employ a stochastic mapping function with the help of a variational encoder that is more robust to target domain data noise . 2.2 REPRESENTATION LEARNING IN RL . Representation learning aims to transform high-dimensional data into lower-dimensional vector representations , which suit RL better . It is widely accepted that learning policies from states ( embeddings ) is significantly more sample-efficient than learning from pixels , both empirically ( Kaiser et al. , 2020 ; Tenenbaum , 2018 ; Tassa et al. , 2018 ) and theoretically ( Jin et al. , 2020 ) . Sequential auto-encoder is a common network structure to learn state representations by minimizing reconstruction loss . Early works on DRL from images ( Ha & Schmidhuber , 2018 ; Lange et al. , 2012 ; Lange & Riedmiller , 2010 ) use a two-step learning process where an auto-encoder is first trained to learn a low-dimensional representation , and subsequently a policy or model is learned based on this representation . Later works on model-based RL improve representation learning by jointly training the encoder and the dynamics model end-to-end ( Watter et al. , 2015 ) – this has been proved effective in learning useful task-oriented representations . PlaNet ( Hafner et al. , 2019 ) learns a hybrid of stochastic and deterministic latent state models using a reconstruction loss . SOLAR ( Zhang et al. , 2019 ) combines probabilistic graphic models with a simple network structure to fit local linear transitions . Some recent works adopt advancements in unsupervised representation learning . CURL ( Laskin et al. , 2020b ) utilizes contrastive learning methods to capture essential information in an image that distinguishes from others , though later works ( Laskin et al. , 2020a ; Kostrikov et al. , 2020 ) point out that data augmentation may play the major role here . Our work utilizes a sequential variational encoder structure to capture sequential information from trajectories . The main difference between our work and representation learning is whether the state space is predefined . We add extra supervised information to guide the training of the mapping by minimizing the distance between the distributions of the mapped states and the original states , and by enforcing the policy to recover the actions from the mapped states . As a result , we successfully learn states that match the ground-truth simulator states well . The mapped states can be directly fed into the pre-trained policy network . 3 CROSS-MODAL DOMAIN ADAPTATION WITH SEQUENTIAL STRUCTURE . Our work follows the problem setting similar to previous methods that tackle visual domain adaptation problems in RL . We have a policy π pre-trained in the source domain ( state ) and a dataset pre-collected in the target domain ( image ) . The task is to learn a mapping qφ from images to states . In the deployment , agents interact with a new policy π̃ ( o ) = ( π ◦ qφ ) ( o ) , where ◦ denotes function composition . During the training of the mapping function , only the source domain is accessible . This section is organized as follows . Sec . 3.1 formulates the cross-modal domain adaptation as a variational inference problem . Sec . 3.2 decomposes the variational inference problem into several feasible optimization objectives . Sec . 3.3 proposes a residual network structure to handle the complex long-horizon training of the sequential structure .
The authors pose a problem of learning a mapping when when a low-dimensional state simulation is given along with target image tragectories. The goal of the paper is to learn a mapping from image to state such that at test time the agent can directly use this mapping with a trained policy from the simulator to perform in the target domain. The contribution of this paper lies in its problem formulation and an algorithm named Cross-mOdal Domain Adaptation with Sequential structure (CODAS).
SP:3d06de343694b2f9db428428f68dee272e459486
Effective Regularization Through Loss-Function Metalearning
Loss-function metalearning can be used to discover novel , customized loss functions for deep neural networks , resulting in improved performance , faster training , and improved data utilization . A likely explanation is that such functions discourage overfitting , leading to effective regularization . This paper demonstrates theoretically that this is indeed the case for the TaylorGLO method : Decomposition of learning rules makes it possible to characterize the training dynamics and show that the loss functions evolved by TaylorGLO balance the pull to zero error , and a push away from it to avoid overfitting . This observation leads to an invariant that can be utilized to make the metalearning process more efficient in practice , and result in networks that are robust against adversarial attacks . Loss-function optimization can thus be seen as a well-founded new aspect of metalearning in neural networks . 1 INTRODUCTION . Regularization is a key concept in deep learning : it guides learning towards configurations that are likely to perform robustly on unseen data . Different regularization approaches originate from intuitive understanding of the learning process and have been shown to be effective empirically . However , the understanding of the underlying mechanisms , the different types of regularization , and their interactions , is limited . Recently , loss function optimization has emerged as a new area of metalearning , and shown great potential in training better models . Experiments suggest that metalearned loss functions serve as regularizers in a surprising but transparent way : they prevent the network from learning too confident predictions ( e.g . Baikal loss ; Gonzalez & Miikkulainen , 2020a ) . While it may be too early to develop a comprehensive theory of regularization , given the relatively nascent state of this area , it may be possible to make progress in understanding regularization of this specific type . That is the goal of this paper . Since metalearned loss functions are customized to a given architecture-task pair , there needs to be a shared framework under which loss functions can be analyzed and compared . The TaylorGLO ( Gonzalez & Miikkulainen , 2020b ) technique for loss function metalearning lends itself well to such analysis : It represents loss functions as multivariate Taylor polynomials , and leverages evolution to optimize a fixed number of parameters in this representation . In this framework , the SGD learning rule is decomposed to coefficient expressions that can be defined for a wide range of loss functions . These expressions provide an intuitive understanding of the training dynamics in specific contexts . Using this framework , mean squared error ( MSE ) , cross-entropy , Baikal , and TaylorGLO loss functions are analyzed at the null epoch , when network weights are similarly distributed ( Appendix C ) , and in a zero training error regime , where the training samples ’ labels have been perfectly memorized . For any intermediate point in the training process , the strength of the zero training error regime as an attractor is analyzed and a constraint on this property is derived on TaylorGLO parameters by characterizing how the output distribution ’ s entropy changes . In a concrete TaylorGLO loss function that has been metalearned , these attraction dynamics are calculated for individual samples at every epoch in a real training run , and contrasted with those for the cross-entropy loss . This comparison provides clarity on how TaylorGLO avoids becoming overly confident in its predictions . Further , the analysis shows ( in Appendix D.2 ) how label smoothing ( Szegedy et al. , 2016 ) , a traditional type of regularization , can be implicitly encoded by TaylorGLO loss functions : Any representable loss function has label-smoothed variants that are also representable by the parameterization . From these analyses , practical opportunities arise . First , at the null epoch , where the desired behavior can be characterized clearly , an invariant can be derived on a TaylorGLO loss function ’ s parameters that must hold true for networks to be trainable . This constraint is then applied within the TaylorGLO algorithm to guide the search process towards good loss functions more efficiently . Second , lossfunction-based regularization results in robustness that should e.g . make them more resilient to adversarial attacks . This property is demonstrated experimentally by incorporating adversarial robustness as an objective within the TaylorGLO search process . Thus , loss-function metalearning can be seen as a well-founded and practical approach to effective regularization in deep learning . 2 BACKGROUND . Regularization traditionally refers to methods for encouraging smoother mappings by adding a regularizing term to the objective function , i.e. , to the loss function in neural networks . It can be defined more broadly , however , e.g . as “ any modification we make to a learning algorithm that is intended to reduce its generalization error but not its training error ” ( Goodfellow et al. , 2015 ) . To that end , many regularization techniques have been developed that aim to improve the training process in neural networks . These techniques can be architectural in nature , such as Dropout ( Srivastava et al. , 2014 ) and Batch Normalization ( Ioffe & Szegedy , 2015 ) , or they can alter some aspect of the training process , such as label smoothing ( Szegedy et al. , 2016 ) or the minimization of a weight norm ( Hanson & Pratt , 1989 ) . These techniques are briefly reviewed in this section , providing context for loss-function metalearning . 2.1 IMPLICIT BIASES IN OPTIMIZERS . It may seem surprising that overparameterized neural networks are able to generalize at all , given that they have the capacity to memorize a training set perfectly , and in fact sometimes do ( i.e. , zero training error is reached ) . Different optimizers have different implicit biases that determine which solutions are ultimately found . These biases are helpful in providing implicit regularization to the optimization process ( Neyshabur et al. , 2015 ) . Such implicit regularization is the result of a network norm—a measure of complexity—that is minimized as optimization progresses . This is why models continue to improve even after training set has been memorized ( i.e. , the training error global optima is reached ) ( Neyshabur et al. , 2017 ) . For example , the process of stochastic gradient descent ( SGD ) itself has been found to provide regularization implicitly when learning on data with noisy labels ( Blanc et al. , 2020 ) . In overparameterized networks , adaptive optimizers find very different solutions than basic SGD . These solutions tend to have worse generalization properties , even though they tend to have lower training errors ( Wilson et al. , 2017 ) . 2.2 REGULARIZATION APPROACHES . While optimizers may minimize a network norm implicitly , regularization approaches supplement this process and make it explicit . For example , a common way to restrict the parameter norm explicitly is through weight decay . This approach discourages network complexity by placing a cost on weights ( Hanson & Pratt , 1989 ) . Generalization and regularization are often characterized at the end of training , i.e . as a behavior that results from the optimization process . Various findings have influenced work in regularization . For example , flat landscapes have better generalization properties ( Keskar et al. , 2017 ; Li et al. , 2018 ; Chaudhari et al. , 2019 ) . In overparameterized cases , the solutions at the center of these landscapes may have zero training error ( i.e. , perfect memorization ) , and under certain conditions , zero training error empirically leads to lower generalization error ( Belkin et al. , 2019 ; Nakkiran et al. , 2019 ) . However , when a training loss of zero is reached , generalization suffers ( Ishida et al. , 2020 ) . This behavior can be thought of as overtraining , and techniques have been developed to reduce it at the end of the training process , such as early stopping ( Morgan & Bourlard , 1990 ) and flooding ( Ishida et al. , 2020 ) . Both flooding and early stopping assume that overfitting happens at the end of training , which is not always true ( Golatkar et al. , 2019 ) . In fact , the order in which easy-to-generalize and hard-togeneralize concepts are learned is important for the network ’ s ultimate generalization . For instance , larger learning rates early in the training process often lead to better generalization in the final model ( Li et al. , 2019 ) . Similarly , low-error solutions found by SGD in a relatively quick manner—such as through high learning rates—often have good generalization properties ( Yao et al. , 2007 ) . Other techniques tackle overfitting by making it more difficult . Dropout ( Srivastava et al. , 2014 ) makes some connections disappear . Cutout ( DeVries & Taylor , 2017 ) , Mixup ( Zhang et al. , 2018 ) , and their composition , CutMix ( Yun et al. , 2019 ) , augment training data with a broader variation of examples . Notably , regularization is not a one-dimensional continuum . Different techniques regularize in different ways that often interact . For example , flooding invalidates performance gains from early stopping ( Ishida et al. , 2020 ) . However , ultimately all regularization techniques alter the gradients that result from the training loss . This observation suggests loss-function optimization might be an effective way to regularize the training process . 2.3 LOSS-FUNCTION METALEARNING . The idea of metalearning loss-functions has a deep history with many recent developments that have shown promise in practical settings . Prior work in reinforcement learning showed that metalearning various types of objectives is useful . For instance , in evolving policy gradients ( Houthooft et al. , 2018 ) , the policy loss is not represented symbolically , but rather as a neural network that convolves over a temporal sequence of context vectors . In reward function search ( Niekum et al. , 2010 ) , the task is framed as a genetic programming problem , leveraging PushGP ( Spector et al. , 2001 ) . Various actor-critic reinforcement learning approaches have tackled learning a meta-critic neural network that can generate losses ( Sung et al. , 2017 ; Zhou et al. , 2020 ) . Metalearned critic network techniques have also been applied outside of reinforcement learning to train better few-shot classifiers ( Antoniou & Storkey , 2019 ) . In unsupervised representation learning , weight update rules for semi-supervised learning have themselves been metalearned successfully ( Metz et al. , 2018 ) . The update rules were constrained to fit a biological neuron model and transferred well between tasks . Concrete loss-function metalearning for deep networks was first introduced by Gonzalez & Miikkulainen ( 2020a ) as an automatic way to find customized loss functions that aim to optimize a performance metric for a model . The technique , a genetic programming approach , named GLO , discovered one particular loss function , Baikal , that improves classification accuracy , training speed , and data utilization . Baikal appeared to achieve these properties through a form of regularization that ensured the model would not become overly confident in its predictions . That is , instead of monotonically decreasing the loss when the output gets closer to the correct value , Baikal loss increases rapidly when the output is almost correct , thus discouraging extreme accuracy . This paper shows how training dynamics are specifically impacted in this manner when training with the Baikal loss . Overall , GLO demonstrated that while learned loss functions ’ generalization effects transfer across datasets and models to some extent , they are most powerful when they are customized to individual tasks and architectures . Different loss functions can take advantage of the different characteristics of each such setting . Other techniques have advanced this new field further , for example by metalearning state-dependent loss functions for inverse dynamics models ( Morse et al. , 2020 ) , and using a trained network that is itself a metalearned loss function ( Bechtle et al. , 2019 ) . One particular technique , TaylorGLO ( Gonzalez & Miikkulainen , 2020b ) , lends itself well to analyzing what makes loss-function metalearning effective . TaylorGLO represents loss functions as parameterizations of multivariate Taylor polynomials . This parameterization allows it to scale to models with millions of trainable parameters , including a variety of deep learning architectures in image classification tasks . TaylorGLO loss functions have a tunable complexity based on the order of the polynomial ; third-order functions were identified to work best in practical settings . The third-order TaylorGLO loss function parameterization provides a fixed representation that can be used to analyze a large family of loss functions through a unified methodology . In prior work , TaylorGLO loss functions were shown to improve generalization empirically ( Gonzalez & Miikkulainen , 2020b ) . This paper complements that work , aiming to explain why that is the case by analyzing the dynamics of training theoretically .
This paper analyzes a learned loss function called TaylorGLO based on third-order Taylor expansion and its regularization properties. This approach is novel and interesting in that the loss function is also learned on data. The analysis of the TaylorGLO loss and another learned loss function Baikal loss near zero error reveals interesting properties of preventing overconfident predictions.
SP:3021e8b74146a257b5befec014cd17d5d7bd3362