Skip to content

drawcodeboy/Disentangling-by-VAE

Repository files navigation

Disentangling by VAE

  • Disentangled Representation Learning(DRL) by VAE Repository
  • VAE, Beta-VAE are available.
  • This repository helps you understand how to implement DRL with a VAE.
  • I hope you can use this repository as a tutorial.
  • If you find anything strange, please report it through Issues or send me an email (dobylive01@gmail.com ).

Preview

  • The image below shows the result of the VAE after 100 epochs.
  • By training for more epochs and using a Beta-VAE, you can obtain more effective results.
  • VAE Results - DCI (Disentanglement): 0.327, MAE (Reconstruction): 0.037

Ground Truth

Reconstruction

Intervention (wall hue)

How to use

1. Setings

conda create -n drl_base python=3.12
conda activate drl_base
pip install -r requirements.txt

# Download 3dshapes.h5 and put it in the 'data' directory.
python subtasks/data_save/exec.py # This will save images and labels for the PyTorch dataset.

2. Train, Test, and Intervention(Manipulation)

# Train
python train.py --config=vae.3dshapes

# Test
python test.py --config=vae.3dshapes

# Intervention(Manipulation)
python subtasks/intervention/exec.py --config=vae.3dshapes

About

Disentangle Representation Learning by VAE | DRL Base Repository

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages