This is a PyTorch implementation of our AISTATS paper Neural Decomposition: Functional ANOVA with Variational Autoencoders (Märtens & Yau, 2020)
See the Colab noteboook for an example on synthetic data:
decoder.py
impements the class for the decomposable CVAE decoder, for the special case of a one-dimensional latent variable z and one-dimensional covariate c.encoder.py
implements the class for a standard CVAE encoderCVAE.py
provides a wrapper to combine the decoder and encoder for training purposes- Some comments on implementation details regarding integral penalties:
- When initialising the
decoder
, we provide the input grids on which the integrals are evaluated using quadrature - The penalty terms c and lambda are initialised with
lambda0
- If one chooses to replace a fixed constant c with a sequence of c values (this can lead to faster convergence), this can be done during optimisation via specifying
lambda_start
andlambda_end
values to CVAEoptimize()
. - Feature-level sparsity can optionally be turned on or off via
has_feature_level_sparsity
- When initialising the