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-1.0.2.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: vqvae-1.0.2.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-1.0.2.tar.gz
Algorithm Hash digest
SHA256 387b7e13caa5291b248676f2b3d9e14ccbb26440373f0778e9d4a49ad13ddd81
MD5 4827e025586177ced8204b99caddc658
BLAKE2b-256 54aae2bfa2c7393bf69386696c93c551b4f03fedb9ed10842c74cd1e174bc0f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vqvae-1.0.2-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-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b7c805ff0b6bd613e6e2bd477ee8cd634e8672523edb44fbf2977ef4be0ca532
MD5 9d95ff8550d0ad5d60644dd86f66a816
BLAKE2b-256 15c555a073b3e0ea61a3861f62d465472c41305029260ab59375915b221523a7

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