Skip to main content

PyTorch implementation of VQ-VAE

Project description

Pytorch VQVAE implementation

Example

from vqvae import VQVAE, sequential_encoder, sequential_decoder
from torch.optim import  Adam
from functools import partial

input_channels = 3
output_channels = 3
embedding_length = 256
hidden_channels = 64
beta = 0.25
embedding_size = 512
opt = partial(Adam, lr=2e-4)

encoder = sequential_encoder(input_channels, embedding_size, hidden_channels)  # Encoder from the paper
decoder = sequential_decoder(embedding_size, output_channels, hidden_channels)  # Decoder from the paper
vqvae = VQVAE(encoder, decoder, opt, beta, embedding_length, embedding_size)  # Pytorch-Lightning module, 
                                                                              # hence usable to train the model

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vqvae-0.0.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

vqvae-0.0.0-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file vqvae-0.0.0.tar.gz.

File metadata

  • Download URL: vqvae-0.0.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for vqvae-0.0.0.tar.gz
Algorithm Hash digest
SHA256 df903a9d2e1403186b71fa492a9edb4b168350eaf432c3e551ad8b766f0b6b2f
MD5 b55613de175772e469559b5e24b81bce
BLAKE2b-256 bd38179d6ed51ee0cbc0ad8928ffa3c2dae40fb1d3651d9323f4f1bf415c3520

See more details on using hashes here.

File details

Details for the file vqvae-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: vqvae-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for vqvae-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2522ad0e0f284b7f083f9f91b8af447ef5586ec13d39dd9c6a042e6e43b528
MD5 e8843a489976cba9370271625f954303
BLAKE2b-256 604528595da8050fad92b6dddbe502be0f876cf93ec31363d1b0b3247b783baa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page