Deep Learning Models -- A collection of various deep learning architectures, models, and tips for TensorFlow and PyTorch in Jupyter Notebooks.

In [1]:
%load_ext watermark
%watermark -a 'Sebastian Raschka' -v -p torch
Sebastian Raschka 

CPython 3.7.3
IPython 7.6.1

torch 1.2.0
  • Runs on CPU or GPU (if available)

Model Zoo -- Wasserstein Generative Adversarial Networks (GAN)

Implementation of a very simple/rudimentary Wasserstein GAN using just fully connected layers.

The Wasserstein GAN is based on the paper

The main differences to a regular GAN are annotated in the code. In short, the main differences are

  1. Not using a sigmoid activation function and just using a linear output layer for the critic (i.e., discriminator).
  2. Using label -1 instead of 1 for the real images; using label 1 instead of 0 for fake images.
  3. Using Wasserstein distance (loss) for training both the critic and the generator.
  4. After each weight update, clip the weights to be in range [-0.1, 0.1].
  5. Train the critic 5 times for each generator training update.

Imports

In [2]:
import time
import numpy as np
import torch
import torch.nn.functional as F
from torchvision import datasets
from torchvision import transforms
import torch.nn as nn
from torch.utils.data import DataLoader


if torch.cuda.is_available():
    torch.backends.cudnn.deterministic = True

Settings and Dataset

In [3]:
##########################
### SETTINGS
##########################

# Device
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

# Hyperparameters
random_seed = 0
generator_learning_rate = 0.0005
discriminator_learning_rate = 0.0005
NUM_EPOCHS = 100
BATCH_SIZE = 128
LATENT_DIM = 50
IMG_SHAPE = (1, 28, 28)
IMG_SIZE = 1
for x in IMG_SHAPE:
    IMG_SIZE *= x

## WGAN-specific settings
num_iter_critic = 5
weight_clip_value = 0.01



##########################
### MNIST DATASET
##########################

# Note transforms.ToTensor() scales input images
# to 0-1 range
train_dataset = datasets.MNIST(root='data', 
                               train=True, 
                               transform=transforms.ToTensor(),
                               download=True)

test_dataset = datasets.MNIST(root='data', 
                              train=False, 
                              transform=transforms.ToTensor())


train_loader = DataLoader(dataset=train_dataset, 
                          batch_size=BATCH_SIZE, 
                          shuffle=True)

test_loader = DataLoader(dataset=test_dataset, 
                         batch_size=BATCH_SIZE, 
                         shuffle=False)

# Checking the dataset
for images, labels in train_loader:  
    print('Image batch dimensions:', images.shape)
    print('Image label dimensions:', labels.shape)
    break
Image batch dimensions: torch.Size([128, 1, 28, 28])
Image label dimensions: torch.Size([128])

Model

In [4]:
##########################
### MODEL
##########################


def wasserstein_loss(y_true, y_pred):
    return torch.mean(y_true * y_pred)


class GAN(torch.nn.Module):

    def __init__(self):
        super(GAN, self).__init__()
        
        
        self.generator = nn.Sequential(
            nn.Linear(LATENT_DIM, 128),
            nn.LeakyReLU(inplace=True),
            #nn.Dropout(p=0.5),
            nn.Linear(128, IMG_SIZE),
            nn.Tanh()
        )
        
        self.discriminator = nn.Sequential(
            nn.Linear(IMG_SIZE, 128),
            nn.LeakyReLU(inplace=True),
            #nn.Dropout(p=0.5),
            nn.Linear(128, 1),
            nn.Sigmoid()
        )

            
    def generator_forward(self, z):
        img = self.generator(z)
        return img
    
    def discriminator_forward(self, img):
        pred = model.discriminator(img)
        return pred.view(-1)
In [5]:
torch.manual_seed(random_seed)

model = GAN()
model = model.to(device)

optim_gener = torch.optim.Adam(model.generator.parameters(), lr=generator_learning_rate)
optim_discr = torch.optim.Adam(model.discriminator.parameters(), lr=discriminator_learning_rate)

Training

In [6]:
start_time = time.time()    

discr_costs = []
gener_costs = []
for epoch in range(NUM_EPOCHS):
    model = model.train()
    for batch_idx, (features, targets) in enumerate(train_loader):

        
        
        features = (features - 0.5)*2.
        features = features.view(-1, IMG_SIZE).to(device) 
        targets = targets.to(device)

        # Regular GAN:
        # valid = torch.ones(targets.size(0)).float().to(device)
        # fake = torch.zeros(targets.size(0)).float().to(device)
        
        # WGAN:
        valid = -(torch.ones(targets.size(0)).float()).to(device)
        fake = torch.ones(targets.size(0)).float().to(device)
        

        ### FORWARD AND BACK PROP
        
        
        # --------------------------
        # Train Generator
        # --------------------------
        
        # Make new images
        z = torch.zeros((targets.size(0), LATENT_DIM)).uniform_(-1.0, 1.0).to(device)
        generated_features = model.generator_forward(z)
        
        # Loss for fooling the discriminator
        discr_pred = model.discriminator_forward(generated_features)
        
        
        # Regular GAN:
        # gener_loss = F.binary_cross_entropy_with_logits(discr_pred, valid)
        
        # WGAN:
        gener_loss = wasserstein_loss(valid, discr_pred)
        
        optim_gener.zero_grad()
        gener_loss.backward()
        optim_gener.step()
        
        # --------------------------
        # Train Discriminator
        # --------------------------        

        
        # WGAN: 5 loops for discriminator
        for _ in range(num_iter_critic):
        
            discr_pred_real = model.discriminator_forward(features.view(-1, IMG_SIZE))
            # Regular GAN:
            # real_loss = F.binary_cross_entropy_with_logits(discr_pred_real, valid)
            # WGAN:
            real_loss = wasserstein_loss(valid, discr_pred_real)

            discr_pred_fake = model.discriminator_forward(generated_features.detach())

            # Regular GAN:
            # fake_loss = F.binary_cross_entropy_with_logits(discr_pred_fake, fake)
            # WGAN:
            fake_loss = wasserstein_loss(fake, discr_pred_fake)

            # Regular GAN:
            discr_loss = (real_loss + fake_loss)
            # WGAN:
            #discr_loss = -(real_loss - fake_loss)

            optim_discr.zero_grad()
            discr_loss.backward()
            optim_discr.step()        

            # WGAN:
            for p in model.discriminator.parameters():
                p.data.clamp_(-weight_clip_value, weight_clip_value)

        
        discr_costs.append(discr_loss.item())
        gener_costs.append(gener_loss.item())
        
        
        
        
        ### LOGGING
        if not batch_idx % 100:
            print ('Epoch: %03d/%03d | Batch %03d/%03d | Gen/Dis Loss: %.4f/%.4f' 
                   %(epoch+1, NUM_EPOCHS, batch_idx, 
                     len(train_loader), gener_loss, discr_loss))

    print('Time elapsed: %.2f min' % ((time.time() - start_time)/60))
    
print('Total Training Time: %.2f min' % ((time.time() - start_time)/60))
Epoch: 001/100 | Batch 000/469 | Gen/Dis Loss: -0.5135/-0.0640
Epoch: 001/100 | Batch 100/469 | Gen/Dis Loss: -0.6194/-0.1880
Epoch: 001/100 | Batch 200/469 | Gen/Dis Loss: -0.5824/-0.1102
Epoch: 001/100 | Batch 300/469 | Gen/Dis Loss: -0.5471/-0.0933
Epoch: 001/100 | Batch 400/469 | Gen/Dis Loss: -0.5313/-0.0952
Time elapsed: 0.31 min
Epoch: 002/100 | Batch 000/469 | Gen/Dis Loss: -0.5421/-0.0747
Epoch: 002/100 | Batch 100/469 | Gen/Dis Loss: -0.5374/-0.0782
Epoch: 002/100 | Batch 200/469 | Gen/Dis Loss: -0.5264/-0.0668
Epoch: 002/100 | Batch 300/469 | Gen/Dis Loss: -0.5445/-0.0666
Epoch: 002/100 | Batch 400/469 | Gen/Dis Loss: -0.5525/-0.0531
Time elapsed: 0.67 min
Epoch: 003/100 | Batch 000/469 | Gen/Dis Loss: -0.5433/-0.0530
Epoch: 003/100 | Batch 100/469 | Gen/Dis Loss: -0.5621/-0.0404
Epoch: 003/100 | Batch 200/469 | Gen/Dis Loss: -0.5358/-0.0523
Epoch: 003/100 | Batch 300/469 | Gen/Dis Loss: -0.5589/-0.0481
Epoch: 003/100 | Batch 400/469 | Gen/Dis Loss: -0.5147/-0.0620
Time elapsed: 0.99 min
Epoch: 004/100 | Batch 000/469 | Gen/Dis Loss: -0.5347/-0.0536
Epoch: 004/100 | Batch 100/469 | Gen/Dis Loss: -0.5992/-0.0476
Epoch: 004/100 | Batch 200/469 | Gen/Dis Loss: -0.5231/-0.0504
Epoch: 004/100 | Batch 300/469 | Gen/Dis Loss: -0.5679/-0.0426
Epoch: 004/100 | Batch 400/469 | Gen/Dis Loss: -0.5395/-0.0475
Time elapsed: 1.33 min
Epoch: 005/100 | Batch 000/469 | Gen/Dis Loss: -0.4806/-0.0564
Epoch: 005/100 | Batch 100/469 | Gen/Dis Loss: -0.6035/-0.0468
Epoch: 005/100 | Batch 200/469 | Gen/Dis Loss: -0.5137/-0.0450
Epoch: 005/100 | Batch 300/469 | Gen/Dis Loss: -0.5013/-0.0563
Epoch: 005/100 | Batch 400/469 | Gen/Dis Loss: -0.5868/-0.0287
Time elapsed: 1.66 min
Epoch: 006/100 | Batch 000/469 | Gen/Dis Loss: -0.4917/-0.0369
Epoch: 006/100 | Batch 100/469 | Gen/Dis Loss: -0.5030/-0.0502
Epoch: 006/100 | Batch 200/469 | Gen/Dis Loss: -0.4951/-0.0464
Epoch: 006/100 | Batch 300/469 | Gen/Dis Loss: -0.6160/-0.0365
Epoch: 006/100 | Batch 400/469 | Gen/Dis Loss: -0.5193/-0.0601
Time elapsed: 1.97 min
Epoch: 007/100 | Batch 000/469 | Gen/Dis Loss: -0.5331/-0.0579
Epoch: 007/100 | Batch 100/469 | Gen/Dis Loss: -0.5478/-0.0290
Epoch: 007/100 | Batch 200/469 | Gen/Dis Loss: -0.4940/-0.0487
Epoch: 007/100 | Batch 300/469 | Gen/Dis Loss: -0.5937/-0.0365
Epoch: 007/100 | Batch 400/469 | Gen/Dis Loss: -0.5475/-0.0380
Time elapsed: 2.30 min
Epoch: 008/100 | Batch 000/469 | Gen/Dis Loss: -0.5870/-0.0421
Epoch: 008/100 | Batch 100/469 | Gen/Dis Loss: -0.5566/-0.0393
Epoch: 008/100 | Batch 200/469 | Gen/Dis Loss: -0.4578/-0.0559
Epoch: 008/100 | Batch 300/469 | Gen/Dis Loss: -0.5766/-0.0405
Epoch: 008/100 | Batch 400/469 | Gen/Dis Loss: -0.5155/-0.0310
Time elapsed: 2.62 min
Epoch: 009/100 | Batch 000/469 | Gen/Dis Loss: -0.4966/-0.0448
Epoch: 009/100 | Batch 100/469 | Gen/Dis Loss: -0.4337/-0.0660
Epoch: 009/100 | Batch 200/469 | Gen/Dis Loss: -0.5877/-0.0370
Epoch: 009/100 | Batch 300/469 | Gen/Dis Loss: -0.5682/-0.0198
Epoch: 009/100 | Batch 400/469 | Gen/Dis Loss: -0.5051/-0.0430
Time elapsed: 2.95 min
Epoch: 010/100 | Batch 000/469 | Gen/Dis Loss: -0.4873/-0.0286
Epoch: 010/100 | Batch 100/469 | Gen/Dis Loss: -0.4787/-0.0412
Epoch: 010/100 | Batch 200/469 | Gen/Dis Loss: -0.6193/-0.0297
Epoch: 010/100 | Batch 300/469 | Gen/Dis Loss: -0.5719/-0.0421
Epoch: 010/100 | Batch 400/469 | Gen/Dis Loss: -0.5004/-0.0257
Time elapsed: 3.26 min
Epoch: 011/100 | Batch 000/469 | Gen/Dis Loss: -0.5055/-0.0461
Epoch: 011/100 | Batch 100/469 | Gen/Dis Loss: -0.4339/-0.0311
Epoch: 011/100 | Batch 200/469 | Gen/Dis Loss: -0.6052/-0.0417
Epoch: 011/100 | Batch 300/469 | Gen/Dis Loss: -0.5660/-0.0375
Epoch: 011/100 | Batch 400/469 | Gen/Dis Loss: -0.5332/-0.0258
Time elapsed: 3.58 min
Epoch: 012/100 | Batch 000/469 | Gen/Dis Loss: -0.4895/-0.0338
Epoch: 012/100 | Batch 100/469 | Gen/Dis Loss: -0.4584/-0.0317
Epoch: 012/100 | Batch 200/469 | Gen/Dis Loss: -0.5424/-0.0308
Epoch: 012/100 | Batch 300/469 | Gen/Dis Loss: -0.5662/-0.0438
Epoch: 012/100 | Batch 400/469 | Gen/Dis Loss: -0.4723/-0.0480
Time elapsed: 3.90 min
Epoch: 013/100 | Batch 000/469 | Gen/Dis Loss: -0.5315/-0.0265
Epoch: 013/100 | Batch 100/469 | Gen/Dis Loss: -0.4478/-0.0395
Epoch: 013/100 | Batch 200/469 | Gen/Dis Loss: -0.6145/-0.0308
Epoch: 013/100 | Batch 300/469 | Gen/Dis Loss: -0.5426/-0.0317
Epoch: 013/100 | Batch 400/469 | Gen/Dis Loss: -0.5044/-0.0273
Time elapsed: 4.24 min
Epoch: 014/100 | Batch 000/469 | Gen/Dis Loss: -0.5857/-0.0308
Epoch: 014/100 | Batch 100/469 | Gen/Dis Loss: -0.4632/-0.0271
Epoch: 014/100 | Batch 200/469 | Gen/Dis Loss: -0.4915/-0.0430
Epoch: 014/100 | Batch 300/469 | Gen/Dis Loss: -0.4571/-0.0239
Epoch: 014/100 | Batch 400/469 | Gen/Dis Loss: -0.4950/-0.0555
Time elapsed: 4.56 min
Epoch: 015/100 | Batch 000/469 | Gen/Dis Loss: -0.5115/-0.0419
Epoch: 015/100 | Batch 100/469 | Gen/Dis Loss: -0.5577/-0.0200
Epoch: 015/100 | Batch 200/469 | Gen/Dis Loss: -0.5806/-0.0407
Epoch: 015/100 | Batch 300/469 | Gen/Dis Loss: -0.5311/-0.0247
Epoch: 015/100 | Batch 400/469 | Gen/Dis Loss: -0.4802/-0.0566
Time elapsed: 4.92 min
Epoch: 016/100 | Batch 000/469 | Gen/Dis Loss: -0.4536/-0.0400
Epoch: 016/100 | Batch 100/469 | Gen/Dis Loss: -0.5354/-0.0286
Epoch: 016/100 | Batch 200/469 | Gen/Dis Loss: -0.5230/-0.0277
Epoch: 016/100 | Batch 300/469 | Gen/Dis Loss: -0.4963/-0.0256
Epoch: 016/100 | Batch 400/469 | Gen/Dis Loss: -0.5028/-0.0228
Time elapsed: 5.27 min
Epoch: 017/100 | Batch 000/469 | Gen/Dis Loss: -0.5002/-0.0224
Epoch: 017/100 | Batch 100/469 | Gen/Dis Loss: -0.4974/-0.0233
Epoch: 017/100 | Batch 200/469 | Gen/Dis Loss: -0.4967/-0.0251
Epoch: 017/100 | Batch 300/469 | Gen/Dis Loss: -0.5007/-0.0202
Epoch: 017/100 | Batch 400/469 | Gen/Dis Loss: -0.5016/-0.0198
Time elapsed: 5.59 min
Epoch: 018/100 | Batch 000/469 | Gen/Dis Loss: -0.5041/-0.0187
Epoch: 018/100 | Batch 100/469 | Gen/Dis Loss: -0.4997/-0.0150
Epoch: 018/100 | Batch 200/469 | Gen/Dis Loss: -0.5153/-0.0248
Epoch: 018/100 | Batch 300/469 | Gen/Dis Loss: -0.4866/-0.0284
Epoch: 018/100 | Batch 400/469 | Gen/Dis Loss: -0.4979/-0.0143
Time elapsed: 5.92 min
Epoch: 019/100 | Batch 000/469 | Gen/Dis Loss: -0.5012/-0.0175
Epoch: 019/100 | Batch 100/469 | Gen/Dis Loss: -0.4956/-0.0285
Epoch: 019/100 | Batch 200/469 | Gen/Dis Loss: -0.4957/-0.0239
Epoch: 019/100 | Batch 300/469 | Gen/Dis Loss: -0.4967/-0.0165
Epoch: 019/100 | Batch 400/469 | Gen/Dis Loss: -0.4951/-0.0361
Time elapsed: 6.28 min
Epoch: 020/100 | Batch 000/469 | Gen/Dis Loss: -0.4956/-0.0271
Epoch: 020/100 | Batch 100/469 | Gen/Dis Loss: -0.4974/-0.0174
Epoch: 020/100 | Batch 200/469 | Gen/Dis Loss: -0.5101/-0.0281
Epoch: 020/100 | Batch 300/469 | Gen/Dis Loss: -0.5421/-0.0134
Epoch: 020/100 | Batch 400/469 | Gen/Dis Loss: -0.5162/-0.0199
Time elapsed: 6.60 min
Epoch: 021/100 | Batch 000/469 | Gen/Dis Loss: -0.5339/-0.0183
Epoch: 021/100 | Batch 100/469 | Gen/Dis Loss: -0.5280/-0.0215
Epoch: 021/100 | Batch 200/469 | Gen/Dis Loss: -0.5358/-0.0175
Epoch: 021/100 | Batch 300/469 | Gen/Dis Loss: -0.5243/-0.0169
Epoch: 021/100 | Batch 400/469 | Gen/Dis Loss: -0.5205/-0.0170
Time elapsed: 6.94 min
Epoch: 022/100 | Batch 000/469 | Gen/Dis Loss: -0.5277/-0.0142
Epoch: 022/100 | Batch 100/469 | Gen/Dis Loss: -0.5203/-0.0218
Epoch: 022/100 | Batch 200/469 | Gen/Dis Loss: -0.5025/-0.0174
Epoch: 022/100 | Batch 300/469 | Gen/Dis Loss: -0.4963/-0.0200
Epoch: 022/100 | Batch 400/469 | Gen/Dis Loss: -0.5015/-0.0262
Time elapsed: 7.28 min
Epoch: 023/100 | Batch 000/469 | Gen/Dis Loss: -0.4411/-0.0624
Epoch: 023/100 | Batch 100/469 | Gen/Dis Loss: -0.3992/-0.0383
Epoch: 023/100 | Batch 200/469 | Gen/Dis Loss: -0.4401/-0.0334
Epoch: 023/100 | Batch 300/469 | Gen/Dis Loss: -0.5975/-0.0422
Epoch: 023/100 | Batch 400/469 | Gen/Dis Loss: -0.5350/-0.0105
Time elapsed: 7.61 min
Epoch: 024/100 | Batch 000/469 | Gen/Dis Loss: -0.6127/-0.0073
Epoch: 024/100 | Batch 100/469 | Gen/Dis Loss: -0.5962/-0.0066
Epoch: 024/100 | Batch 200/469 | Gen/Dis Loss: -0.5505/-0.0109
Epoch: 024/100 | Batch 300/469 | Gen/Dis Loss: -0.5428/-0.0151
Epoch: 024/100 | Batch 400/469 | Gen/Dis Loss: -0.5220/-0.0129
Time elapsed: 7.94 min
Epoch: 025/100 | Batch 000/469 | Gen/Dis Loss: -0.5298/-0.0157
Epoch: 025/100 | Batch 100/469 | Gen/Dis Loss: -0.5273/-0.0156
Epoch: 025/100 | Batch 200/469 | Gen/Dis Loss: -0.5280/-0.0135
Epoch: 025/100 | Batch 300/469 | Gen/Dis Loss: -0.5153/-0.0122
Epoch: 025/100 | Batch 400/469 | Gen/Dis Loss: -0.5199/-0.0169
Time elapsed: 8.28 min
Epoch: 026/100 | Batch 000/469 | Gen/Dis Loss: -0.5183/-0.0158
Epoch: 026/100 | Batch 100/469 | Gen/Dis Loss: -0.5154/-0.0142
Epoch: 026/100 | Batch 200/469 | Gen/Dis Loss: -0.5109/-0.0104
Epoch: 026/100 | Batch 300/469 | Gen/Dis Loss: -0.4933/-0.0196
Epoch: 026/100 | Batch 400/469 | Gen/Dis Loss: -0.4977/-0.0119
Time elapsed: 8.62 min
Epoch: 027/100 | Batch 000/469 | Gen/Dis Loss: -0.4141/-0.0329
Epoch: 027/100 | Batch 100/469 | Gen/Dis Loss: -0.4162/-0.0315
Epoch: 027/100 | Batch 200/469 | Gen/Dis Loss: -0.4167/-0.0266
Epoch: 027/100 | Batch 300/469 | Gen/Dis Loss: -0.4595/-0.0283
Epoch: 027/100 | Batch 400/469 | Gen/Dis Loss: -0.5303/-0.0371
Time elapsed: 8.96 min
Epoch: 028/100 | Batch 000/469 | Gen/Dis Loss: -0.5231/-0.0361
Epoch: 028/100 | Batch 100/469 | Gen/Dis Loss: -0.4554/-0.0312
Epoch: 028/100 | Batch 200/469 | Gen/Dis Loss: -0.7106/-0.0115
Epoch: 028/100 | Batch 300/469 | Gen/Dis Loss: -0.5543/-0.0177
Epoch: 028/100 | Batch 400/469 | Gen/Dis Loss: -0.6160/-0.0154
Time elapsed: 9.30 min
Epoch: 029/100 | Batch 000/469 | Gen/Dis Loss: -0.6364/-0.0123
Epoch: 029/100 | Batch 100/469 | Gen/Dis Loss: -0.5711/-0.0187
Epoch: 029/100 | Batch 200/469 | Gen/Dis Loss: -0.4897/-0.0145
Epoch: 029/100 | Batch 300/469 | Gen/Dis Loss: -0.5124/-0.0121
Epoch: 029/100 | Batch 400/469 | Gen/Dis Loss: -0.5241/-0.0105
Time elapsed: 9.63 min
Epoch: 030/100 | Batch 000/469 | Gen/Dis Loss: -0.5315/-0.0108
Epoch: 030/100 | Batch 100/469 | Gen/Dis Loss: -0.5224/-0.0134
Epoch: 030/100 | Batch 200/469 | Gen/Dis Loss: -0.5097/-0.0133
Epoch: 030/100 | Batch 300/469 | Gen/Dis Loss: -0.5200/-0.0090
Epoch: 030/100 | Batch 400/469 | Gen/Dis Loss: -0.5248/-0.0105
Time elapsed: 9.98 min
Epoch: 031/100 | Batch 000/469 | Gen/Dis Loss: -0.5087/-0.0090
Epoch: 031/100 | Batch 100/469 | Gen/Dis Loss: -0.5033/-0.0110
Epoch: 031/100 | Batch 200/469 | Gen/Dis Loss: -0.5164/-0.0088
Epoch: 031/100 | Batch 300/469 | Gen/Dis Loss: -0.4947/-0.0122
Epoch: 031/100 | Batch 400/469 | Gen/Dis Loss: -0.5088/-0.0133
Time elapsed: 10.32 min
Epoch: 032/100 | Batch 000/469 | Gen/Dis Loss: -0.5059/-0.0182
Epoch: 032/100 | Batch 100/469 | Gen/Dis Loss: -0.5062/-0.0120
Epoch: 032/100 | Batch 200/469 | Gen/Dis Loss: -0.4882/-0.0181
Epoch: 032/100 | Batch 300/469 | Gen/Dis Loss: -0.5167/-0.0123
Epoch: 032/100 | Batch 400/469 | Gen/Dis Loss: -0.4355/-0.0403
Time elapsed: 10.65 min
Epoch: 033/100 | Batch 000/469 | Gen/Dis Loss: -0.4432/-0.0723
Epoch: 033/100 | Batch 100/469 | Gen/Dis Loss: -0.5519/-0.0591
Epoch: 033/100 | Batch 200/469 | Gen/Dis Loss: -0.4846/-0.0375
Epoch: 033/100 | Batch 300/469 | Gen/Dis Loss: -0.4178/-0.0216
Epoch: 033/100 | Batch 400/469 | Gen/Dis Loss: -0.4613/-0.0146
Time elapsed: 11.00 min
Epoch: 034/100 | Batch 000/469 | Gen/Dis Loss: -0.4342/-0.0706
Epoch: 034/100 | Batch 100/469 | Gen/Dis Loss: -0.4615/-0.0238
Epoch: 034/100 | Batch 200/469 | Gen/Dis Loss: -0.3540/-0.0359
Epoch: 034/100 | Batch 300/469 | Gen/Dis Loss: -0.5712/-0.0543
Epoch: 034/100 | Batch 400/469 | Gen/Dis Loss: -0.6412/-0.0186
Time elapsed: 11.35 min
Epoch: 035/100 | Batch 000/469 | Gen/Dis Loss: -0.6714/-0.0031
Epoch: 035/100 | Batch 100/469 | Gen/Dis Loss: -0.6070/-0.0054
Epoch: 035/100 | Batch 200/469 | Gen/Dis Loss: -0.5227/-0.0107
Epoch: 035/100 | Batch 300/469 | Gen/Dis Loss: -0.5110/-0.0098
Epoch: 035/100 | Batch 400/469 | Gen/Dis Loss: -0.5154/-0.0102
Time elapsed: 11.67 min
Epoch: 036/100 | Batch 000/469 | Gen/Dis Loss: -0.5224/-0.0131
Epoch: 036/100 | Batch 100/469 | Gen/Dis Loss: -0.5149/-0.0125
Epoch: 036/100 | Batch 200/469 | Gen/Dis Loss: -0.5129/-0.0117
Epoch: 036/100 | Batch 300/469 | Gen/Dis Loss: -0.5269/-0.0085
Epoch: 036/100 | Batch 400/469 | Gen/Dis Loss: -0.5165/-0.0101
Time elapsed: 12.00 min
Epoch: 037/100 | Batch 000/469 | Gen/Dis Loss: -0.5115/-0.0081
Epoch: 037/100 | Batch 100/469 | Gen/Dis Loss: -0.5068/-0.0089
Epoch: 037/100 | Batch 200/469 | Gen/Dis Loss: -0.5203/-0.0099
Epoch: 037/100 | Batch 300/469 | Gen/Dis Loss: -0.6883/-0.0153
Epoch: 037/100 | Batch 400/469 | Gen/Dis Loss: -0.5024/-0.0118
Time elapsed: 12.34 min
Epoch: 038/100 | Batch 000/469 | Gen/Dis Loss: -0.5234/-0.0365
Epoch: 038/100 | Batch 100/469 | Gen/Dis Loss: -0.4579/-0.0261
Epoch: 038/100 | Batch 200/469 | Gen/Dis Loss: -0.5098/-0.0212
Epoch: 038/100 | Batch 300/469 | Gen/Dis Loss: -0.4729/-0.0302
Epoch: 038/100 | Batch 400/469 | Gen/Dis Loss: -0.4838/-0.0219
Time elapsed: 12.67 min
Epoch: 039/100 | Batch 000/469 | Gen/Dis Loss: -0.5327/-0.0189
Epoch: 039/100 | Batch 100/469 | Gen/Dis Loss: -0.4758/-0.0155
Epoch: 039/100 | Batch 200/469 | Gen/Dis Loss: -0.4985/-0.0180
Epoch: 039/100 | Batch 300/469 | Gen/Dis Loss: -0.4737/-0.0193
Epoch: 039/100 | Batch 400/469 | Gen/Dis Loss: -0.4705/-0.0269
Time elapsed: 12.99 min
Epoch: 040/100 | Batch 000/469 | Gen/Dis Loss: -0.4603/-0.0263
Epoch: 040/100 | Batch 100/469 | Gen/Dis Loss: -0.4751/-0.0199
Epoch: 040/100 | Batch 200/469 | Gen/Dis Loss: -0.4686/-0.0207
Epoch: 040/100 | Batch 300/469 | Gen/Dis Loss: -0.5360/-0.0169
Epoch: 040/100 | Batch 400/469 | Gen/Dis Loss: -0.6049/-0.0596
Time elapsed: 13.33 min
Epoch: 041/100 | Batch 000/469 | Gen/Dis Loss: -0.6496/-0.0281
Epoch: 041/100 | Batch 100/469 | Gen/Dis Loss: -0.5531/-0.0407
Epoch: 041/100 | Batch 200/469 | Gen/Dis Loss: -0.6386/0.0135
Epoch: 041/100 | Batch 300/469 | Gen/Dis Loss: -0.6813/-0.0239
Epoch: 041/100 | Batch 400/469 | Gen/Dis Loss: -0.5506/-0.0002
Time elapsed: 13.66 min
Epoch: 042/100 | Batch 000/469 | Gen/Dis Loss: -0.5998/-0.0058
Epoch: 042/100 | Batch 100/469 | Gen/Dis Loss: -0.4141/-0.0027
Epoch: 042/100 | Batch 200/469 | Gen/Dis Loss: -0.4707/-0.0013
Epoch: 042/100 | Batch 300/469 | Gen/Dis Loss: -0.4913/-0.0009
Epoch: 042/100 | Batch 400/469 | Gen/Dis Loss: -0.4970/-0.0010
Time elapsed: 13.99 min
Epoch: 043/100 | Batch 000/469 | Gen/Dis Loss: -0.4962/-0.0006
Epoch: 043/100 | Batch 100/469 | Gen/Dis Loss: -0.5052/-0.0012
Epoch: 043/100 | Batch 200/469 | Gen/Dis Loss: -0.5064/-0.0010
Epoch: 043/100 | Batch 300/469 | Gen/Dis Loss: -0.5079/-0.0012
Epoch: 043/100 | Batch 400/469 | Gen/Dis Loss: -0.4998/-0.0010
Time elapsed: 14.33 min
Epoch: 044/100 | Batch 000/469 | Gen/Dis Loss: -0.5121/-0.0015
Epoch: 044/100 | Batch 100/469 | Gen/Dis Loss: -0.5056/-0.0010
Epoch: 044/100 | Batch 200/469 | Gen/Dis Loss: -0.5047/-0.0012
Epoch: 044/100 | Batch 300/469 | Gen/Dis Loss: -0.5081/-0.0010
Epoch: 044/100 | Batch 400/469 | Gen/Dis Loss: -0.5133/-0.0007
Time elapsed: 14.68 min
Epoch: 045/100 | Batch 000/469 | Gen/Dis Loss: -0.5155/-0.0010
Epoch: 045/100 | Batch 100/469 | Gen/Dis Loss: -0.5078/-0.0011
Epoch: 045/100 | Batch 200/469 | Gen/Dis Loss: -0.5059/-0.0011
Epoch: 045/100 | Batch 300/469 | Gen/Dis Loss: -0.5207/-0.0011
Epoch: 045/100 | Batch 400/469 | Gen/Dis Loss: -0.5002/-0.0003
Time elapsed: 15.01 min
Epoch: 046/100 | Batch 000/469 | Gen/Dis Loss: -0.5206/-0.0010
Epoch: 046/100 | Batch 100/469 | Gen/Dis Loss: -0.5157/-0.0005
Epoch: 046/100 | Batch 200/469 | Gen/Dis Loss: -0.5434/0.0001
Epoch: 046/100 | Batch 300/469 | Gen/Dis Loss: -0.5366/-0.0013
Epoch: 046/100 | Batch 400/469 | Gen/Dis Loss: -0.5257/-0.0014
Time elapsed: 15.34 min
Epoch: 047/100 | Batch 000/469 | Gen/Dis Loss: -0.5006/-0.0001
Epoch: 047/100 | Batch 100/469 | Gen/Dis Loss: -0.5025/-0.0004
Epoch: 047/100 | Batch 200/469 | Gen/Dis Loss: -0.5043/-0.0003
Epoch: 047/100 | Batch 300/469 | Gen/Dis Loss: -0.5245/-0.0033
Epoch: 047/100 | Batch 400/469 | Gen/Dis Loss: -0.4847/-0.0107
Time elapsed: 15.67 min
Epoch: 048/100 | Batch 000/469 | Gen/Dis Loss: -0.5049/0.0003
Epoch: 048/100 | Batch 100/469 | Gen/Dis Loss: -0.5225/-0.0009
Epoch: 048/100 | Batch 200/469 | Gen/Dis Loss: -0.5005/-0.0018
Epoch: 048/100 | Batch 300/469 | Gen/Dis Loss: -0.5225/-0.0006
Epoch: 048/100 | Batch 400/469 | Gen/Dis Loss: -0.5155/-0.0025
Time elapsed: 15.98 min
Epoch: 049/100 | Batch 000/469 | Gen/Dis Loss: -0.5135/-0.0034
Epoch: 049/100 | Batch 100/469 | Gen/Dis Loss: -0.5281/-0.0018
Epoch: 049/100 | Batch 200/469 | Gen/Dis Loss: -0.5114/-0.0005
Epoch: 049/100 | Batch 300/469 | Gen/Dis Loss: -0.5071/-0.0013
Epoch: 049/100 | Batch 400/469 | Gen/Dis Loss: -0.5111/-0.0011
Time elapsed: 16.33 min
Epoch: 050/100 | Batch 000/469 | Gen/Dis Loss: -0.5187/-0.0012
Epoch: 050/100 | Batch 100/469 | Gen/Dis Loss: -0.4168/-0.0256
Epoch: 050/100 | Batch 200/469 | Gen/Dis Loss: -0.4484/-0.0350
Epoch: 050/100 | Batch 300/469 | Gen/Dis Loss: -0.5676/-0.0066
Epoch: 050/100 | Batch 400/469 | Gen/Dis Loss: -0.5349/-0.0024
Time elapsed: 16.66 min
Epoch: 051/100 | Batch 000/469 | Gen/Dis Loss: -0.5686/-0.0007
Epoch: 051/100 | Batch 100/469 | Gen/Dis Loss: -0.5810/0.0022
Epoch: 051/100 | Batch 200/469 | Gen/Dis Loss: -0.4438/-0.0046
Epoch: 051/100 | Batch 300/469 | Gen/Dis Loss: -0.4393/-0.0023
Epoch: 051/100 | Batch 400/469 | Gen/Dis Loss: -0.5755/0.0053
Time elapsed: 16.99 min
Epoch: 052/100 | Batch 000/469 | Gen/Dis Loss: -0.4925/0.0103
Epoch: 052/100 | Batch 100/469 | Gen/Dis Loss: -0.5260/-0.0100
Epoch: 052/100 | Batch 200/469 | Gen/Dis Loss: -0.5333/0.0018
Epoch: 052/100 | Batch 300/469 | Gen/Dis Loss: -0.5024/-0.0213
Epoch: 052/100 | Batch 400/469 | Gen/Dis Loss: -0.5430/-0.0025
Time elapsed: 17.34 min
Epoch: 053/100 | Batch 000/469 | Gen/Dis Loss: -0.5829/-0.0004
Epoch: 053/100 | Batch 100/469 | Gen/Dis Loss: -0.5723/-0.0023
Epoch: 053/100 | Batch 200/469 | Gen/Dis Loss: -0.5355/-0.0050
Epoch: 053/100 | Batch 300/469 | Gen/Dis Loss: -0.5303/-0.0001
Epoch: 053/100 | Batch 400/469 | Gen/Dis Loss: -0.5371/-0.0007
Time elapsed: 17.66 min
Epoch: 054/100 | Batch 000/469 | Gen/Dis Loss: -0.5082/-0.0001
Epoch: 054/100 | Batch 100/469 | Gen/Dis Loss: -0.5390/-0.0015
Epoch: 054/100 | Batch 200/469 | Gen/Dis Loss: -0.4982/-0.0002
Epoch: 054/100 | Batch 300/469 | Gen/Dis Loss: -0.5167/-0.0011
Epoch: 054/100 | Batch 400/469 | Gen/Dis Loss: -0.5119/-0.0010
Time elapsed: 17.99 min
Epoch: 055/100 | Batch 000/469 | Gen/Dis Loss: -0.4969/-0.0014
Epoch: 055/100 | Batch 100/469 | Gen/Dis Loss: -0.5009/-0.0034
Epoch: 055/100 | Batch 200/469 | Gen/Dis Loss: -0.5014/-0.0006
Epoch: 055/100 | Batch 300/469 | Gen/Dis Loss: -0.4971/-0.0019
Epoch: 055/100 | Batch 400/469 | Gen/Dis Loss: -0.5323/0.0006
Time elapsed: 18.33 min
Epoch: 056/100 | Batch 000/469 | Gen/Dis Loss: -0.5050/-0.0004
Epoch: 056/100 | Batch 100/469 | Gen/Dis Loss: -0.5021/0.0003
Epoch: 056/100 | Batch 200/469 | Gen/Dis Loss: -0.5068/-0.0003
Epoch: 056/100 | Batch 300/469 | Gen/Dis Loss: -0.4968/-0.0002
Epoch: 056/100 | Batch 400/469 | Gen/Dis Loss: -0.5033/-0.0003
Time elapsed: 18.65 min
Epoch: 057/100 | Batch 000/469 | Gen/Dis Loss: -0.4989/0.0002
Epoch: 057/100 | Batch 100/469 | Gen/Dis Loss: -0.5037/-0.0011
Epoch: 057/100 | Batch 200/469 | Gen/Dis Loss: -0.5484/-0.0086
Epoch: 057/100 | Batch 300/469 | Gen/Dis Loss: -0.5550/-0.0085
Epoch: 057/100 | Batch 400/469 | Gen/Dis Loss: -0.4872/-0.0482
Time elapsed: 18.98 min
Epoch: 058/100 | Batch 000/469 | Gen/Dis Loss: -0.5460/-0.0154
Epoch: 058/100 | Batch 100/469 | Gen/Dis Loss: -0.5258/-0.0130
Epoch: 058/100 | Batch 200/469 | Gen/Dis Loss: -0.5730/-0.0151
Epoch: 058/100 | Batch 300/469 | Gen/Dis Loss: -0.5880/-0.0066
Epoch: 058/100 | Batch 400/469 | Gen/Dis Loss: -0.5276/-0.0017
Time elapsed: 19.32 min
Epoch: 059/100 | Batch 000/469 | Gen/Dis Loss: -0.5009/-0.0001
Epoch: 059/100 | Batch 100/469 | Gen/Dis Loss: -0.5275/-0.0017
Epoch: 059/100 | Batch 200/469 | Gen/Dis Loss: -0.5311/-0.0007
Epoch: 059/100 | Batch 300/469 | Gen/Dis Loss: -0.5059/-0.0051
Epoch: 059/100 | Batch 400/469 | Gen/Dis Loss: -0.4749/-0.0049
Time elapsed: 19.67 min
Epoch: 060/100 | Batch 000/469 | Gen/Dis Loss: -0.4892/-0.0026
Epoch: 060/100 | Batch 100/469 | Gen/Dis Loss: -0.4848/-0.0038
Epoch: 060/100 | Batch 200/469 | Gen/Dis Loss: -0.5323/-0.0019
Epoch: 060/100 | Batch 300/469 | Gen/Dis Loss: -0.5086/-0.0020
Epoch: 060/100 | Batch 400/469 | Gen/Dis Loss: -0.4910/-0.0010
Time elapsed: 20.01 min
Epoch: 061/100 | Batch 000/469 | Gen/Dis Loss: -0.4976/-0.0008
Epoch: 061/100 | Batch 100/469 | Gen/Dis Loss: -0.5041/-0.0012
Epoch: 061/100 | Batch 200/469 | Gen/Dis Loss: -0.4993/-0.0012
Epoch: 061/100 | Batch 300/469 | Gen/Dis Loss: -0.4994/-0.0012
Epoch: 061/100 | Batch 400/469 | Gen/Dis Loss: -0.5033/-0.0015
Time elapsed: 20.35 min
Epoch: 062/100 | Batch 000/469 | Gen/Dis Loss: -0.5482/-0.0118
Epoch: 062/100 | Batch 100/469 | Gen/Dis Loss: -0.4645/-0.0004
Epoch: 062/100 | Batch 200/469 | Gen/Dis Loss: -0.5043/-0.0009
Epoch: 062/100 | Batch 300/469 | Gen/Dis Loss: -0.5003/-0.0042
Epoch: 062/100 | Batch 400/469 | Gen/Dis Loss: -0.4903/-0.0025
Time elapsed: 20.67 min
Epoch: 063/100 | Batch 000/469 | Gen/Dis Loss: -0.5466/-0.0051
Epoch: 063/100 | Batch 100/469 | Gen/Dis Loss: -0.5092/-0.0039
Epoch: 063/100 | Batch 200/469 | Gen/Dis Loss: -0.5159/-0.0006
Epoch: 063/100 | Batch 300/469 | Gen/Dis Loss: -0.5257/-0.0003
Epoch: 063/100 | Batch 400/469 | Gen/Dis Loss: -0.5294/-0.0015
Time elapsed: 21.00 min
Epoch: 064/100 | Batch 000/469 | Gen/Dis Loss: -0.5153/-0.0013
Epoch: 064/100 | Batch 100/469 | Gen/Dis Loss: -0.5105/0.0000
Epoch: 064/100 | Batch 200/469 | Gen/Dis Loss: -0.4765/-0.0003
Epoch: 064/100 | Batch 300/469 | Gen/Dis Loss: -0.5048/-0.0014
Epoch: 064/100 | Batch 400/469 | Gen/Dis Loss: -0.4918/-0.0005
Time elapsed: 21.32 min
Epoch: 065/100 | Batch 000/469 | Gen/Dis Loss: -0.5068/0.0001
Epoch: 065/100 | Batch 100/469 | Gen/Dis Loss: -0.5119/-0.0008
Epoch: 065/100 | Batch 200/469 | Gen/Dis Loss: -0.4892/-0.0004
Epoch: 065/100 | Batch 300/469 | Gen/Dis Loss: -0.4936/-0.0001
Epoch: 065/100 | Batch 400/469 | Gen/Dis Loss: -0.4926/-0.0001
Time elapsed: 21.66 min
Epoch: 066/100 | Batch 000/469 | Gen/Dis Loss: -0.4988/0.0000
Epoch: 066/100 | Batch 100/469 | Gen/Dis Loss: -0.5103/-0.0004
Epoch: 066/100 | Batch 200/469 | Gen/Dis Loss: -0.4922/-0.0004
Epoch: 066/100 | Batch 300/469 | Gen/Dis Loss: -0.4989/-0.0002
Epoch: 066/100 | Batch 400/469 | Gen/Dis Loss: -0.5048/-0.0019
Time elapsed: 21.99 min
Epoch: 067/100 | Batch 000/469 | Gen/Dis Loss: -0.5015/-0.0024
Epoch: 067/100 | Batch 100/469 | Gen/Dis Loss: -0.5198/-0.0024
Epoch: 067/100 | Batch 200/469 | Gen/Dis Loss: -0.4921/-0.0017
Epoch: 067/100 | Batch 300/469 | Gen/Dis Loss: -0.5008/-0.0028
Epoch: 067/100 | Batch 400/469 | Gen/Dis Loss: -0.5131/-0.0021
Time elapsed: 22.32 min
Epoch: 068/100 | Batch 000/469 | Gen/Dis Loss: -0.4900/-0.0063
Epoch: 068/100 | Batch 100/469 | Gen/Dis Loss: -0.4959/-0.0015
Epoch: 068/100 | Batch 200/469 | Gen/Dis Loss: -0.5173/-0.0020
Epoch: 068/100 | Batch 300/469 | Gen/Dis Loss: -0.5096/-0.0038
Epoch: 068/100 | Batch 400/469 | Gen/Dis Loss: -0.5546/-0.0015
Time elapsed: 22.66 min
Epoch: 069/100 | Batch 000/469 | Gen/Dis Loss: -0.5353/-0.0017
Epoch: 069/100 | Batch 100/469 | Gen/Dis Loss: -0.5418/0.0001
Epoch: 069/100 | Batch 200/469 | Gen/Dis Loss: -0.4909/-0.0024
Epoch: 069/100 | Batch 300/469 | Gen/Dis Loss: -0.4976/-0.0024
Epoch: 069/100 | Batch 400/469 | Gen/Dis Loss: -0.5184/-0.0018
Time elapsed: 23.00 min
Epoch: 070/100 | Batch 000/469 | Gen/Dis Loss: -0.5407/-0.0057
Epoch: 070/100 | Batch 100/469 | Gen/Dis Loss: -0.2587/-0.0069
Epoch: 070/100 | Batch 200/469 | Gen/Dis Loss: -0.4635/-0.0057
Epoch: 070/100 | Batch 300/469 | Gen/Dis Loss: -0.4772/-0.0102
Epoch: 070/100 | Batch 400/469 | Gen/Dis Loss: -0.4399/-0.0302
Time elapsed: 23.34 min
Epoch: 071/100 | Batch 000/469 | Gen/Dis Loss: -0.4708/-0.0118
Epoch: 071/100 | Batch 100/469 | Gen/Dis Loss: -0.5367/-0.0193
Epoch: 071/100 | Batch 200/469 | Gen/Dis Loss: -0.4875/-0.0226
Epoch: 071/100 | Batch 300/469 | Gen/Dis Loss: -0.4844/-0.0030
Epoch: 071/100 | Batch 400/469 | Gen/Dis Loss: -0.4174/-0.0123
Time elapsed: 23.70 min
Epoch: 072/100 | Batch 000/469 | Gen/Dis Loss: -0.4664/-0.0101
Epoch: 072/100 | Batch 100/469 | Gen/Dis Loss: -0.4391/0.0001
Epoch: 072/100 | Batch 200/469 | Gen/Dis Loss: -0.5560/-0.0022
Epoch: 072/100 | Batch 300/469 | Gen/Dis Loss: -0.5898/-0.0008
Epoch: 072/100 | Batch 400/469 | Gen/Dis Loss: -0.5763/-0.0010
Time elapsed: 24.02 min
Epoch: 073/100 | Batch 000/469 | Gen/Dis Loss: -0.5196/-0.0027
Epoch: 073/100 | Batch 100/469 | Gen/Dis Loss: -0.5437/-0.0004
Epoch: 073/100 | Batch 200/469 | Gen/Dis Loss: -0.5042/-0.0007
Epoch: 073/100 | Batch 300/469 | Gen/Dis Loss: -0.4372/-0.0003
Epoch: 073/100 | Batch 400/469 | Gen/Dis Loss: -0.3764/-0.0199
Time elapsed: 24.33 min
Epoch: 074/100 | Batch 000/469 | Gen/Dis Loss: -0.4134/-0.0347
Epoch: 074/100 | Batch 100/469 | Gen/Dis Loss: -0.6345/-0.0140
Epoch: 074/100 | Batch 200/469 | Gen/Dis Loss: -0.4699/-0.0140
Epoch: 074/100 | Batch 300/469 | Gen/Dis Loss: -0.4119/-0.0144
Epoch: 074/100 | Batch 400/469 | Gen/Dis Loss: -0.4991/-0.0149
Time elapsed: 24.66 min
Epoch: 075/100 | Batch 000/469 | Gen/Dis Loss: -0.3295/-0.0345
Epoch: 075/100 | Batch 100/469 | Gen/Dis Loss: -0.5274/-0.0075
Epoch: 075/100 | Batch 200/469 | Gen/Dis Loss: -0.5596/-0.0007
Epoch: 075/100 | Batch 300/469 | Gen/Dis Loss: -0.5620/-0.0026
Epoch: 075/100 | Batch 400/469 | Gen/Dis Loss: -0.5708/-0.0008
Time elapsed: 25.00 min
Epoch: 076/100 | Batch 000/469 | Gen/Dis Loss: -0.5527/-0.0021
Epoch: 076/100 | Batch 100/469 | Gen/Dis Loss: -0.5448/-0.0029
Epoch: 076/100 | Batch 200/469 | Gen/Dis Loss: -0.5523/-0.0016
Epoch: 076/100 | Batch 300/469 | Gen/Dis Loss: -0.5130/-0.0018
Epoch: 076/100 | Batch 400/469 | Gen/Dis Loss: -0.4828/-0.0032
Time elapsed: 25.35 min
Epoch: 077/100 | Batch 000/469 | Gen/Dis Loss: -0.5601/-0.0026
Epoch: 077/100 | Batch 100/469 | Gen/Dis Loss: -0.5800/-0.0029
Epoch: 077/100 | Batch 200/469 | Gen/Dis Loss: -0.5020/-0.0055
Epoch: 077/100 | Batch 300/469 | Gen/Dis Loss: -0.5133/-0.0024
Epoch: 077/100 | Batch 400/469 | Gen/Dis Loss: -0.5388/-0.0032
Time elapsed: 25.66 min
Epoch: 078/100 | Batch 000/469 | Gen/Dis Loss: -0.5453/-0.0017
Epoch: 078/100 | Batch 100/469 | Gen/Dis Loss: -0.5146/-0.0041
Epoch: 078/100 | Batch 200/469 | Gen/Dis Loss: -0.5264/-0.0020
Epoch: 078/100 | Batch 300/469 | Gen/Dis Loss: -0.5192/-0.0036
Epoch: 078/100 | Batch 400/469 | Gen/Dis Loss: -0.5178/-0.0012
Time elapsed: 25.99 min
Epoch: 079/100 | Batch 000/469 | Gen/Dis Loss: -0.5092/-0.0012
Epoch: 079/100 | Batch 100/469 | Gen/Dis Loss: -0.5094/-0.0024
Epoch: 079/100 | Batch 200/469 | Gen/Dis Loss: -0.5215/-0.0021
Epoch: 079/100 | Batch 300/469 | Gen/Dis Loss: -0.5094/-0.0026
Epoch: 079/100 | Batch 400/469 | Gen/Dis Loss: -0.5103/-0.0022
Time elapsed: 26.32 min
Epoch: 080/100 | Batch 000/469 | Gen/Dis Loss: -0.5110/-0.0023
Epoch: 080/100 | Batch 100/469 | Gen/Dis Loss: -0.5115/-0.0024
Epoch: 080/100 | Batch 200/469 | Gen/Dis Loss: -0.5097/-0.0020
Epoch: 080/100 | Batch 300/469 | Gen/Dis Loss: -0.5151/-0.0162
Epoch: 080/100 | Batch 400/469 | Gen/Dis Loss: -0.5094/-0.0035
Time elapsed: 26.65 min
Epoch: 081/100 | Batch 000/469 | Gen/Dis Loss: -0.4744/-0.0154
Epoch: 081/100 | Batch 100/469 | Gen/Dis Loss: -0.5015/-0.0085
Epoch: 081/100 | Batch 200/469 | Gen/Dis Loss: -0.4256/-0.0220
Epoch: 081/100 | Batch 300/469 | Gen/Dis Loss: -0.5114/-0.0264
Epoch: 081/100 | Batch 400/469 | Gen/Dis Loss: -0.5249/-0.0219
Time elapsed: 26.97 min
Epoch: 082/100 | Batch 000/469 | Gen/Dis Loss: -0.5402/-0.0034
Epoch: 082/100 | Batch 100/469 | Gen/Dis Loss: -0.4999/-0.0112
Epoch: 082/100 | Batch 200/469 | Gen/Dis Loss: -0.5099/-0.0076
Epoch: 082/100 | Batch 300/469 | Gen/Dis Loss: -0.5023/-0.0015
Epoch: 082/100 | Batch 400/469 | Gen/Dis Loss: -0.5537/-0.0003
Time elapsed: 27.33 min
Epoch: 083/100 | Batch 000/469 | Gen/Dis Loss: -0.5181/-0.0019
Epoch: 083/100 | Batch 100/469 | Gen/Dis Loss: -0.5098/-0.0013
Epoch: 083/100 | Batch 200/469 | Gen/Dis Loss: -0.5034/-0.0004
Epoch: 083/100 | Batch 300/469 | Gen/Dis Loss: -0.5203/-0.0005
Epoch: 083/100 | Batch 400/469 | Gen/Dis Loss: -0.5169/-0.0004
Time elapsed: 27.68 min
Epoch: 084/100 | Batch 000/469 | Gen/Dis Loss: -0.5269/-0.0023
Epoch: 084/100 | Batch 100/469 | Gen/Dis Loss: -0.5413/0.0009
Epoch: 084/100 | Batch 200/469 | Gen/Dis Loss: -0.5025/-0.0005
Epoch: 084/100 | Batch 300/469 | Gen/Dis Loss: -0.4953/-0.0007
Epoch: 084/100 | Batch 400/469 | Gen/Dis Loss: -0.4954/-0.0002
Time elapsed: 28.01 min
Epoch: 085/100 | Batch 000/469 | Gen/Dis Loss: -0.5085/-0.0006
Epoch: 085/100 | Batch 100/469 | Gen/Dis Loss: -0.5094/-0.0003
Epoch: 085/100 | Batch 200/469 | Gen/Dis Loss: -0.4905/-0.0010
Epoch: 085/100 | Batch 300/469 | Gen/Dis Loss: -0.4985/-0.0005
Epoch: 085/100 | Batch 400/469 | Gen/Dis Loss: -0.5243/-0.0019
Time elapsed: 28.32 min
Epoch: 086/100 | Batch 000/469 | Gen/Dis Loss: -0.5194/-0.0017
Epoch: 086/100 | Batch 100/469 | Gen/Dis Loss: -0.4573/-0.0016
Epoch: 086/100 | Batch 200/469 | Gen/Dis Loss: -0.4788/-0.0000
Epoch: 086/100 | Batch 300/469 | Gen/Dis Loss: -0.4678/-0.0021
Epoch: 086/100 | Batch 400/469 | Gen/Dis Loss: -0.4891/-0.0018
Time elapsed: 28.65 min
Epoch: 087/100 | Batch 000/469 | Gen/Dis Loss: -0.5471/-0.0294
Epoch: 087/100 | Batch 100/469 | Gen/Dis Loss: -0.5285/-0.0102
Epoch: 087/100 | Batch 200/469 | Gen/Dis Loss: -0.5309/-0.0333
Epoch: 087/100 | Batch 300/469 | Gen/Dis Loss: -0.6362/-0.0185
Epoch: 087/100 | Batch 400/469 | Gen/Dis Loss: -0.4112/-0.0210
Time elapsed: 28.99 min
Epoch: 088/100 | Batch 000/469 | Gen/Dis Loss: -0.4944/-0.0390
Epoch: 088/100 | Batch 100/469 | Gen/Dis Loss: -0.4935/-0.0400
Epoch: 088/100 | Batch 200/469 | Gen/Dis Loss: -0.5029/-0.0067
Epoch: 088/100 | Batch 300/469 | Gen/Dis Loss: -0.5156/-0.0054
Epoch: 088/100 | Batch 400/469 | Gen/Dis Loss: -0.5058/-0.0001
Time elapsed: 29.32 min
Epoch: 089/100 | Batch 000/469 | Gen/Dis Loss: -0.4798/-0.0009
Epoch: 089/100 | Batch 100/469 | Gen/Dis Loss: -0.5277/0.0001
Epoch: 089/100 | Batch 200/469 | Gen/Dis Loss: -0.5040/0.0000
Epoch: 089/100 | Batch 300/469 | Gen/Dis Loss: -0.5422/0.0008
Epoch: 089/100 | Batch 400/469 | Gen/Dis Loss: -0.5238/0.0003
Time elapsed: 29.64 min
Epoch: 090/100 | Batch 000/469 | Gen/Dis Loss: -0.5062/-0.0008
Epoch: 090/100 | Batch 100/469 | Gen/Dis Loss: -0.5131/-0.0002
Epoch: 090/100 | Batch 200/469 | Gen/Dis Loss: -0.5049/-0.0001
Epoch: 090/100 | Batch 300/469 | Gen/Dis Loss: -0.4949/0.0002
Epoch: 090/100 | Batch 400/469 | Gen/Dis Loss: -0.4944/0.0001
Time elapsed: 29.98 min
Epoch: 091/100 | Batch 000/469 | Gen/Dis Loss: -0.5045/-0.0002
Epoch: 091/100 | Batch 100/469 | Gen/Dis Loss: -0.5035/-0.0003
Epoch: 091/100 | Batch 200/469 | Gen/Dis Loss: -0.4985/-0.0002
Epoch: 091/100 | Batch 300/469 | Gen/Dis Loss: -0.5009/-0.0007
Epoch: 091/100 | Batch 400/469 | Gen/Dis Loss: -0.5033/-0.0012
Time elapsed: 30.33 min
Epoch: 092/100 | Batch 000/469 | Gen/Dis Loss: -0.5053/-0.0002
Epoch: 092/100 | Batch 100/469 | Gen/Dis Loss: -0.5040/-0.0006
Epoch: 092/100 | Batch 200/469 | Gen/Dis Loss: -0.5090/-0.0003
Epoch: 092/100 | Batch 300/469 | Gen/Dis Loss: -0.4823/-0.0001
Epoch: 092/100 | Batch 400/469 | Gen/Dis Loss: -0.4990/-0.0004
Time elapsed: 30.66 min
Epoch: 093/100 | Batch 000/469 | Gen/Dis Loss: -0.5077/-0.0012
Epoch: 093/100 | Batch 100/469 | Gen/Dis Loss: -0.5071/-0.0007
Epoch: 093/100 | Batch 200/469 | Gen/Dis Loss: -0.4967/-0.0016
Epoch: 093/100 | Batch 300/469 | Gen/Dis Loss: -0.5844/-0.0025
Epoch: 093/100 | Batch 400/469 | Gen/Dis Loss: -0.4284/0.0000
Time elapsed: 30.98 min
Epoch: 094/100 | Batch 000/469 | Gen/Dis Loss: -0.5161/-0.0128
Epoch: 094/100 | Batch 100/469 | Gen/Dis Loss: -0.5243/-0.0205
Epoch: 094/100 | Batch 200/469 | Gen/Dis Loss: -0.4952/-0.0063
Epoch: 094/100 | Batch 300/469 | Gen/Dis Loss: -0.7724/-0.0133
Epoch: 094/100 | Batch 400/469 | Gen/Dis Loss: -0.6496/0.0011
Time elapsed: 31.30 min
Epoch: 095/100 | Batch 000/469 | Gen/Dis Loss: -0.5300/-0.0065
Epoch: 095/100 | Batch 100/469 | Gen/Dis Loss: -0.4371/-0.0022
Epoch: 095/100 | Batch 200/469 | Gen/Dis Loss: -0.5217/-0.0012
Epoch: 095/100 | Batch 300/469 | Gen/Dis Loss: -0.5196/-0.0022
Epoch: 095/100 | Batch 400/469 | Gen/Dis Loss: -0.4919/-0.0045
Time elapsed: 31.63 min
Epoch: 096/100 | Batch 000/469 | Gen/Dis Loss: -0.5167/-0.0010
Epoch: 096/100 | Batch 100/469 | Gen/Dis Loss: -0.5098/-0.0008
Epoch: 096/100 | Batch 200/469 | Gen/Dis Loss: -0.4873/-0.0005
Epoch: 096/100 | Batch 300/469 | Gen/Dis Loss: -0.4967/-0.0003
Epoch: 096/100 | Batch 400/469 | Gen/Dis Loss: -0.4824/-0.0007
Time elapsed: 31.97 min
Epoch: 097/100 | Batch 000/469 | Gen/Dis Loss: -0.4844/-0.0011
Epoch: 097/100 | Batch 100/469 | Gen/Dis Loss: -0.4870/-0.0010
Epoch: 097/100 | Batch 200/469 | Gen/Dis Loss: -0.4856/-0.0008
Epoch: 097/100 | Batch 300/469 | Gen/Dis Loss: -0.4727/-0.0015
Epoch: 097/100 | Batch 400/469 | Gen/Dis Loss: -0.4953/-0.0007
Time elapsed: 32.30 min
Epoch: 098/100 | Batch 000/469 | Gen/Dis Loss: -0.5012/-0.0007
Epoch: 098/100 | Batch 100/469 | Gen/Dis Loss: -0.5168/-0.0021
Epoch: 098/100 | Batch 200/469 | Gen/Dis Loss: -0.5064/-0.0004
Epoch: 098/100 | Batch 300/469 | Gen/Dis Loss: -0.5039/-0.0007
Epoch: 098/100 | Batch 400/469 | Gen/Dis Loss: -0.5418/-0.0339
Time elapsed: 32.61 min
Epoch: 099/100 | Batch 000/469 | Gen/Dis Loss: -0.5468/-0.0073
Epoch: 099/100 | Batch 100/469 | Gen/Dis Loss: -0.4540/-0.0241
Epoch: 099/100 | Batch 200/469 | Gen/Dis Loss: -0.5279/-0.0195
Epoch: 099/100 | Batch 300/469 | Gen/Dis Loss: -0.4611/-0.0213
Epoch: 099/100 | Batch 400/469 | Gen/Dis Loss: -0.4722/-0.0154
Time elapsed: 32.94 min
Epoch: 100/100 | Batch 000/469 | Gen/Dis Loss: -0.4558/-0.0172
Epoch: 100/100 | Batch 100/469 | Gen/Dis Loss: -0.5864/-0.0064
Epoch: 100/100 | Batch 200/469 | Gen/Dis Loss: -0.4810/-0.0077
Epoch: 100/100 | Batch 300/469 | Gen/Dis Loss: -0.4921/-0.0127
Epoch: 100/100 | Batch 400/469 | Gen/Dis Loss: -0.4773/-0.0143
Time elapsed: 33.30 min
Total Training Time: 33.30 min

Evaluation

In [7]:
%matplotlib inline
import matplotlib.pyplot as plt
In [8]:
ax1 = plt.subplot(1, 1, 1)
ax1.plot(range(len(gener_costs)), gener_costs, label='Generator loss')
ax1.plot(range(len(discr_costs)), discr_costs, label='Discriminator loss')
ax1.set_xlabel('Iterations')
ax1.set_ylabel('Loss')
ax1.legend()

###################
# Set scond x-axis
ax2 = ax1.twiny()
newlabel = list(range(NUM_EPOCHS+1))
iter_per_epoch = len(train_loader)
newpos = [e*iter_per_epoch for e in newlabel]

ax2.set_xticklabels(newlabel[::10])
ax2.set_xticks(newpos[::10])

ax2.xaxis.set_ticks_position('bottom')
ax2.xaxis.set_label_position('bottom')
ax2.spines['bottom'].set_position(('outward', 45))
ax2.set_xlabel('Epochs')
ax2.set_xlim(ax1.get_xlim())
###################

plt.show()
In [9]:
##########################
### VISUALIZATION
##########################


model.eval()
# Make new images
z = torch.zeros((5, LATENT_DIM)).uniform_(-1.0, 1.0).to(device)
generated_features = model.generator_forward(z)
imgs = generated_features.view(-1, 28, 28)

fig, axes = plt.subplots(nrows=1, ncols=5, figsize=(20, 2.5))


for i, ax in enumerate(axes):
    axes[i].imshow(imgs[i].to(torch.device('cpu')).detach(), cmap='binary')