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

Before Change


    // Sample noise
    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: 3

Non-data size: 10

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: daavoo/pyntcloud
Commit Name: 59ec6660464bd378b20d4ae200c7614133a9a38b
Time: 2019-08-26
Author: hc.wang96@gmail.com
File Name: pyntcloud/samplers/points.py
Class Name: FarthestPointsSampler
Method Name: compute


Project Name: kymatio/kymatio
Commit Name: 60c2e01bfc93bc01da21b79ebe9f222e601e1931
Time: 2020-02-18
Author: janden@flatironinstitute.org
File Name: kymatio/scattering2d/core/scattering2d.py
Class Name:
Method Name: scattering2d