https://github.com/bv7dev/vae-lab
Experimenting with simple VAEs for image generation
https://github.com/bv7dev/vae-lab
Last synced: about 1 year ago
JSON representation
Experimenting with simple VAEs for image generation
- Host: GitHub
- URL: https://github.com/bv7dev/vae-lab
- Owner: bv7dev
- License: mit
- Created: 2024-12-15T11:53:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T12:12:32.000Z (over 1 year ago)
- Last Synced: 2025-02-13T18:46:12.571Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 23.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vae-lab
Experiments with simple Variational-Autoencoder (VAE) in PyTorch
1. create a Python venv
2. install PyTorch
3. explore scripts & notebook
```python
# Explore the latent space
with torch.no_grad():
dd = d[2] # desired direction
iter = torch.arange(10, device=device)
x = t + 50*iter[:, None]*dd[None, :]
path = vae.decode(x)
util.plot_image_grid(1, 10, path.cpu())
```

```python
# Decode random latent vectors
with torch.no_grad():
z = torch.randn(10, LATENT_SIZE).to(device)
recon = vae.decode(z*3)
util.plot_image_grid(2, 5, recon.cpu())
```

#### ideas
- try a round gaussian mask for original and reconstruction to give the center
of the image, the face, most weight for mse loss (fade into black, transparency?)
