PhysAugNet 1.0.1
VQ-VQE powered augmentation for metal defect segmentation
Loading...
Searching...
No Matches
vqvae.VQVAE Class Reference
Inheritance diagram for vqvae.VQVAE:

Public Member Functions

 __init__ (self, in_channels=3, embedding_dim=64, num_embeddings=512)
 forward (self, x)

Public Attributes

 encoder
 vq = VectorQuantizer(num_embeddings, embedding_dim)
 decoder

Detailed Description

Definition at line 23 of file vqvae.py.

Constructor & Destructor Documentation

◆ __init__()

vqvae.VQVAE.__init__ ( self,
in_channels = 3,
embedding_dim = 64,
num_embeddings = 512 )

Definition at line 24 of file vqvae.py.

Member Function Documentation

◆ forward()

vqvae.VQVAE.forward ( self,
x )

Definition at line 37 of file vqvae.py.

Member Data Documentation

◆ decoder

vqvae.VQVAE.decoder
Initial value:
= nn.Sequential(
nn.ConvTranspose2d(embedding_dim, 64, 4, 2, 1), nn.ReLU(),
nn.ConvTranspose2d(64, 32, 4, 2, 1), nn.ReLU(),
nn.Conv2d(32, in_channels, 3, 1, 1), nn.Sigmoid(),
)

Definition at line 31 of file vqvae.py.

◆ encoder

vqvae.VQVAE.encoder
Initial value:
= nn.Sequential(
nn.Conv2d(in_channels, 32, 4, 2, 1), nn.ReLU(),
nn.Conv2d(32, embedding_dim, 4, 2, 1), nn.ReLU(),
)

Definition at line 26 of file vqvae.py.

◆ vq

vqvae.VQVAE.vq = VectorQuantizer(num_embeddings, embedding_dim)

Definition at line 30 of file vqvae.py.


The documentation for this class was generated from the following file: