8ff81bf47b897cb714839245301c207c1d13c24c,src/generate_class_specific_samples.py,ClassSpecificImageGeneration,generate,#ClassSpecificImageGeneration#,32

Before Change


            // Target specific class
            class_loss = -output[0, self.target_class]

            if i in np.linspace(0, iterations, 10, dtype=int):
                print("Iteration:", str(i), "Loss",
                      "{0:.2f}".format(class_loss.data.numpy()))
            // Zero grads

After Change


            self.created_image = recreate_image(self.processed_image)
            if i % 10 == 0 or i == iterations-1:
                // Save image
                im_path = "../generated/class_"+str(self.target_class)+"/c_"+str(self.target_class)+"_"+"iter_"+str(i)+".png"
                save_image(self.created_image, im_path)

        return self.processed_image
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: utkuozbulak/pytorch-cnn-visualizations
Commit Name: 8ff81bf47b897cb714839245301c207c1d13c24c
Time: 2020-04-07
Author: utku.ozbulak@gmail.com
File Name: src/generate_class_specific_samples.py
Class Name: ClassSpecificImageGeneration
Method Name: generate


Project Name: lingpy/lingpy
Commit Name: 1a9a57c99e34502c044030e51bbfbb9694737782
Time: 2013-03-04
Author: mattis.list@posteo.de
File Name: test/test_sca.py
Class Name:
Method Name:


Project Name: lmcinnes/umap
Commit Name: 953ec6dcd4388f96581a0856e55cf21f1c64c914
Time: 2021-02-11
Author: leland.mcinnes@gmail.com
File Name: umap/tests/test_umap_ops.py
Class Name:
Method Name: test_disconnected_data