# Neural Variational Dropout Processes

## Meta-Learning

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2FAf5PUo5XetneD2yt8V2e%2Fimage.png?alt=media&#x26;token=33ba75d8-cbf0-4e27-9645-5f1e05be5e64" alt="" width="375"><figcaption></figcaption></figure>

Human can generalize well even from only a few learning examples. But conventional Neural Networks (NN) based machine learning approaches require many training data to learn a new task. A goal in meta-learning is to develop a model that can generalize well on new tasks even from small learning examples.

## Bayesian Meta-Learning

For efficient model adaptation in meta-learning, a probabilistic optimization objective based on the task-specific parameter of likelihood and the conditional posterior can be utilized. Given a collection of T tasks, the evidence lower-bound (ELBO) over the multi-task dataset can be defined as:

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2FzQipactQjV5CqYjaEDGM%2Fimage.png?alt=media&#x26;token=df996692-9081-417d-89bd-dbd80039c891" alt="" width="563"><figcaption></figcaption></figure>

p(y|x) is the likelihood (or NN model) on t-th training data. q(ϕ^t│D^t;θ) is a tractable conditional posterior over the task-specific variable ϕ^t. p(ϕ^t )  provides a regularization to the conditional posterior. θ is the parameter (or structure) shared across multiple tasks. Essentially, the goal here is to learn and leverage the common structure θ  to approximate the task-conditional posterior for each given task. The learned conditional posterior and shared structure enable a fast model adaptation to a new task and also provide uncertainty modeling in the prediction.

## Neural Variational Dropout Processes

We propose a new model-based Bayesian meta-learning approach that extends the probabilistic regularization method for NN, Variational Dropout.

### Conditional Dropout Posterior

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2Fr6QtyMen9OnXE1xVKhHu%2Fimage.png?alt=media&#x26;token=3168cedc-320b-4db1-ab04-466c6171212c" alt="" width="375"><figcaption><p>Figure 3: the low-rank product of Bernoulli experts' conditional posterior model. </p></figcaption></figure>

A conditional posterior in NVDPs is based on task-specifically predicted Bernoulli dropout. The conditional posterior over the task-specific parameter in NVDPs is defined as follows:

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2F6ead2MidafVhmAYEW03U%2Fimage.png?alt=media&#x26;token=1cda0c0a-5e92-4158-8cb0-6fcb708bfe56" alt="" width="563"><figcaption></figcaption></figure>

Here, the shared structure 𝜃 is the conventional NN’s deterministic parameter, while the dropout rate 𝑷^𝒕 is for each task. The key is to employ an NN-based meta-model 𝑔\_𝜓 ("⋅") to predict the task-specific dropout rates from the small context set 𝐷\_𝐶^𝑡.

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2FV194mQXwVju2IKHXvjqG%2Fimage.png?alt=media&#x26;token=1a0fd16e-2a82-4488-a8ce-a764dcf820aa" alt="" width="563"><figcaption></figcaption></figure>

Here 𝑠(⋅) is the sigmoid function. The set representation 𝑟^𝑡 is defined as the mean of features obtained from each data point in the 𝑡-th context set, summarizing the task conditional information. The conditional dropout posterior modeling in NVDPs can greatly reduce the complexity over the output space and also bypass the under-fitting or the posterior collapsing issues of the previous model-based Bayesian meta-learning approaches.

### Variational Prior



<figure><img src="https://lh5.googleusercontent.com/hbCY-4wXefBe5oDD6PRb3WgXPizb-td6-x3DIHQrrOCIIim39nNqirONscWxEqsObw_KWvzq80WeuF5hRa2--rGE8QvDgo1MrElUv5aE7LnIamEHIZJcJuvoxJ-ZPoqfxRHEuDRmNoNIG5bPayusrg=s2048" alt="" width="375"><figcaption><p>The probabilistic graphical model of NVDPs with the concept of variational prior.</p></figcaption></figure>

A prior distribution in NVDPs is defined as the same dropout posterior model, but the whole task dataset is used instead of the context set. The analytical derivation of the KL divergence is given as:

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2Fb6w8WLul34k8O3QfWNF8%2Fimage.png?alt=media&#x26;token=50b1288e-90c3-41c8-a7fd-7fc74ea2e8c4" alt="" width="563"><figcaption></figcaption></figure>

Where 𝑷^𝒕 is obtained from the small context set, while 𝑷 ̂^𝑡 is from the whole tasks set 𝐷^𝑡. The analytical derivation of KL does not depend on the deterministic shared parameter 𝜃, this ensures the constant optimization of the ELBO objective w.r.t all independent parameters in the Variational Inference framework. The overall optimization procedure can be easily performed with the SGD algorithm.

## Experiments

We tested NVDPs on various few-shot learning tasks such as 1D regression, image in-painting, and classification.

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2FuD2M9D7aNTnUSyNTreEW%2Fimage.png?alt=media&#x26;token=4f37aef3-242e-4c9a-890f-9888f592d1af" alt="" width="563"><figcaption><p>Figure 4.: The 1D few-shot regression results on GP dataset. The black (dash-line) represents the true unknown task function. Black dots are a few context points (S = 5) given to the posteriors. The blue lines (and light blue area in learned variance settings) are mean values (and variance) predicted from the sampled NNs.</p></figcaption></figure>

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2FocwrbeyHLhqRc5GX1hpo%2Fimage.png?alt=media&#x26;token=18e7f00d-5442-464d-aa7e-9f1c4e08ffcf" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2FhYbhuETeE18hgFBWp7Tk%2Fimage.png?alt=media&#x26;token=1759307d-01a3-46eb-b03c-955b783a5aab" alt="" width="563"><figcaption><p>Figure 5.: The result of 2D image in-painting tasks on the MNIST, CelebA, and Omniglot dataset.</p></figcaption></figure>

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2FRoq0M8smk3hmHLxmEKFv%2Fimage.png?alt=media&#x26;token=5aca9068-6639-4f05-a4c8-268fd3afd2d8" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://704680750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M01K_pXDa9D-2q3E1yB%2Fuploads%2F2wqyaAjVMOIBBXVt2xN1%2Fimage.png?alt=media&#x26;token=8a7d2ddd-6568-49fe-a94e-595385a4fdda" alt="" width="563"><figcaption><p>Figure 6. Few-shot classification results on Omniglot and MiniImageNet dataset</p></figcaption></figure>

## Conclusion

NVDPs extend Variational Dropout in the context of the Bayesian meta-learning framework. NVDPs introduce a new concept of variational prior that can be universally applied to other Bayesian meta-learning approaches. NVDPs could bypass the under-fitting and posterior collapsing behavior of the previous model-based conditional posterior approaches and improve likelihood, prediction accuracy, and generalization in various few-shot learning tasks.

