AntixK / PyTorch-VAE

A Collection of Variational Autoencoders (VAE) in PyTorch.
Apache License 2.0
6.44k stars 1.05k forks source link

Wrong order of channel numbers for encoder vs. decoder? #89

Closed brockbrownwork closed 5 months ago

brockbrownwork commented 5 months ago

The number of channels in the encoder layers vs. the decoder layers seem like they might be reversed by default in these examples. The number of channels is supposed be smallest at the bottleneck, right?

In the vanilla VAE we have: hidden_dims = [32, 64, 128, 256, 512]

It uses that to define the number of channels for the convolutional layers in the encoder, then reverses hidden_dims to define the channels for the decoder.

brockbrownwork commented 5 months ago

Never mind, missed the fact that there's a stride of 2, so it does create a bottleneck in the middle. Also didn't know there are VAEs that increase the channels as you go toward the middle. image