Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/beta_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/betatc_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/cat_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())
self.sampling_dist = torch.distributions.OneHotCategorical(1. / categorical_dim * torch.ones((self.categorical_dim, 1)))

def encode(self, input: Tensor) -> List[Tensor]:
Expand Down
2 changes: 1 addition & 1 deletion models/cvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/dfcvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

self.feature_network = vgg19_bn(pretrained=True)

Expand Down
2 changes: 1 addition & 1 deletion models/dip_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/fvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

# Discriminator network for the Total Correlation (TC) loss
self.discriminator = nn.Sequential(nn.Linear(self.latent_dim, 1000),
Expand Down
2 changes: 1 addition & 1 deletion models/hvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

# ========================================================================#
# Pesudo Input for the Vamp-Prior
Expand Down
2 changes: 1 addition & 1 deletion models/info_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/iwae.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/joint_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())
self.sampling_dist = torch.distributions.OneHotCategorical(1. / categorical_dim * torch.ones((self.categorical_dim, 1)))

def encode(self, input: Tensor) -> List[Tensor]:
Expand Down
2 changes: 1 addition & 1 deletion models/logcosh_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/lvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())
hidden_dims.reverse()

def encode(self, input: Tensor) -> List[Tensor]:
Expand Down
2 changes: 1 addition & 1 deletion models/miwae.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/mssim_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

self.mssim_loss = MSSIM(self.in_channels,
window_size,
Expand Down
2 changes: 1 addition & 1 deletion models/swae.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> Tensor:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/twostage_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

#---------------------- Second VAE ---------------------------#
encoder2 = []
Expand Down
4 changes: 2 additions & 2 deletions models/vampvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

self.pseudo_input = torch.eye(self.num_components, requires_grad= False)
self.embed_pseudo = nn.Sequential(nn.Linear(self.num_components, 12288),
nn.Hardtanh(0.0, 1.0)) # 3x64x64 = 12288
nn.HardSigmoid(0.0, 1.0)) # 3x64x64 = 12288

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/vanilla_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> List[Tensor]:
"""
Expand Down
2 changes: 1 addition & 1 deletion models/vq_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(self,
out_channels=3,
kernel_size=4,
stride=2, padding=1),
nn.Tanh()))
nn.Sigmoid()))

self.decoder = nn.Sequential(*modules)

Expand Down
2 changes: 1 addition & 1 deletion models/wae_mmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self,
nn.LeakyReLU(),
nn.Conv2d(hidden_dims[-1], out_channels= 3,
kernel_size= 3, padding= 1),
nn.Tanh())
nn.Sigmoid())

def encode(self, input: Tensor) -> Tensor:
"""
Expand Down