Skip to content

Commit 941c59c

Browse files
committed
add sdae
1 parent 96385a0 commit 941c59c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
This repository tries to provide unsupervised deep learning models with Pytorch for convenient use.
44

5+
## Denoising Autoencoder
6+
1-layer autoencoder. Corrupt the input (masking), then reconstruct the original input.
7+
8+
## Stacked Denoising Autoencoder
9+
Layerwise pretraining by denoising autoenocder. Then stack all layers and finetune further.
10+
11+
## VAE
12+
The famous Variational Autoencoder from the paper
13+
14+
`Kingma, Diederik P., and Max Welling. "Auto-encoding variational bayes." ICLR (2014).`
15+
516
## Convolutional VAE
617
VAE using convolutional and deconvolutional networks is demonstrated with SVHN dataset. Expample code is `test_convvae.py`. The reconstruction and samples generated is show as follows:
718

@@ -11,7 +22,7 @@ VAE using convolutional and deconvolutional networks is demonstrated with SVHN d
1122
## Variational Deep Embedding
1223
Implementation of Variational Deep Embedding from the IJCAI2017 paper:
1324

14-
Jiang, Zhuxi, et al. "Variational deep embedding: An unsupervised and generative approach to clustering." International Joint Conference on Artificial Intelligence. 2017.
25+
`Jiang, Zhuxi, et al. "Variational deep embedding: An unsupervised and generative approach to clustering." International Joint Conference on Artificial Intelligence. 2017.`
1526

1627
The original code is written in [Keras](https://github.com/slim1017/VaDE). However, the original code is incorrect when computing the loss function. And I have corrected the loss function part with my code. The example usage can be found in `test/test_vade-3layer.py`, and it uses the pretrained weights from autoencoder in `test/model/pretrained_vade-3layer.pt`.
1728

udlp/autoencoder/denoisingAutoencoder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def encode(self, x, train=True):
5151
return self.dropout(self.enc_act_func(F.linear(x, self.weight, self.bias)))
5252

5353
def encodeBatch(self, dataloader):
54+
use_cuda = torch.cuda.is_available()
5455
encoded = []
5556
for batch_idx, (inputs, _) in enumerate(dataloader):
5657
inputs = inputs.view(inputs.size(0), -1).float()

0 commit comments

Comments
 (0)