9dfafadcea9f709132bce12341a32ff5e27ec33a,implementations/infogan/infogan.py,,sample_image,#,157

Before Change


    z = Variable(FloatTensor(np.random.normal(0, 1, (n_row**2, opt.latent_dim))))
    // Get labels ranging from 0 to n_classes for n rows
    labels = np.array([num for _ in range(n_row) for num in range(n_row)])
    labels = Variable(LongTensor(labels))
    code_input = Variable(FloatTensor(np.random.uniform(-1, 1, (n_row**2, opt.code_dim))))
    gen_imgs = generator(z, labels, code_input)
    save_image(gen_imgs.data, "images/%d.png" % batches_done, nrow=n_row, normalize=True)

After Change



    // Get varied c1 and c2
    zeros = np.zeros((n_row**2, 1))
    c_varied = np.repeat(np.linspace(-1, 1, n_row)[:, np.newaxis], n_row, 0)
    c1 = Variable(FloatTensor(np.concatenate((c_varied, zeros), -1)))
    c2 = Variable(FloatTensor(np.concatenate((zeros, c_varied), -1)))
    sample1 = generator(static_z, static_label, c1)
    sample2 = generator(static_z, static_label, c2)
    save_image(sample1.data, "images/varying_c1/%d.png" % batches_done, nrow=n_row, normalize=True)
    save_image(sample2.data, "images/varying_c2/%d.png" % batches_done, nrow=n_row, normalize=True)

// ----------
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 9dfafadcea9f709132bce12341a32ff5e27ec33a
Time: 2018-04-24
Author: eriklindernoren@gmail.com
File Name: implementations/infogan/infogan.py
Class Name:
Method Name: sample_image


Project Name: kevinzakka/recurrent-visual-attention
Commit Name: f3c5b75e59717c017fa3779b3f29b725e4ac6d9b
Time: 2018-01-24
Author: kevinarmandzakka@gmail.com
File Name: tests/test_retina.py
Class Name:
Method Name: main


Project Name: leftthomas/SRGAN
Commit Name: eab5e7909d647e363002b529e9d39911f4a2b028
Time: 2017-12-01
Author: leftthomas@qq.com
File Name: train2.py
Class Name:
Method Name: train


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: fc9e5824ad7bd3094f5012dc6fc3d2348481a2f4
Time: 2019-04-02
Author: eriklindernoren@live.se
File Name: implementations/bicyclegan/bicyclegan.py
Class Name:
Method Name: sample_images