Hi All,
I have a question on sample generation from VAE.(need to generate only 1’s)
I am referring to VAE implementation in pytorch,

  
      github.com
  
  
    pytorch/examples/blob/master/vae/main.py 4
from __future__ import print_function
import argparse
import torch
import torch.utils.data
from torch import nn, optim
from torch.autograd import Variable
from torch.nn import functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image


parser = argparse.ArgumentParser(description='VAE MNIST Example')
parser.add_argument('--batch-size', type=int, default=128, metavar='N',
                    help='input batch size for training (default: 128)')
parser.add_argument('--epochs', type=int, default=10, metavar='N',
                    help='number of epochs to train (default: 10)')
parser.add_argument('--no-cuda', action='store_true', default=False,
                    help='enables CUDA training')
parser.add_argument('--seed', type=int, default=1, metavar='S',
                    help='random seed (default: 1)')


  This file has been truncated. show original

  
  
    
    
  
  


After training the code generates the samples
sample = Variable(torch.randn(64, 20))
sample = model.decode(sample).cpu()
save_image(sample.data.view(64, 1, 28, 28),  ‘results/sample_’ + str(epoch) + ‘.png’)
But it generates all the images is there any possibility that i can only sample 1’s separately and 2’s separately and…so on
Thanks,
Jay