Skip to content
PyTorch implementation of BasisVAE: Translation-invariant feature-level clustering with Variational Autoencoders
Python R
Branch: master
Clone or download

Latest commit

Latest commit 6edf914 Mar 16, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.


This is the PyTorch implementation of our AISTATS 2020 paper BasisVAE: Translation-invariant feature-level clustering with Variational Autoencoders


It would be desirable to construct a joint modelling framework for simultaneous dimensionality reduction and clustering of features. Here, we focus on embedding such capabilities within the Variational Autoencoder (VAE) framework. Specifically, we propose the BasisVAE: a combination of the VAE and a probabilistic clustering prior, which lets us learn a one-hot basis function representation as part of the decoder network. This has been illustrated below. Furthermore, for scenarios where not all features are aligned, we develop an extension to handle translation-invariant basis functions.

Illustrations on synthetic data

We illustrate BasisVAE model fitting on the following toy data set that has four groups of features:

Here is the inferred scale-invariant BasisVAE:

and here we additionally allow translation invariance

Demo notebook

See this Colab notebook for a toy example demo.

Implementation details

The core component of BasisVAE is its specialised decoder. See for details about its usage and implementation. Our current implementation supports the following likelihoods Gaussian, Bernoulli, NB, ZINB.


pip install git+
You can’t perform that action at this time.