fad73753f836de5cdd08d8e23d26c1170d19b386,src/dataset_unpair.py,dataset_unpair,__getitem__,#dataset_unpair#,21

Before Change



  def __getitem__(self, index):
    crop_img = self.load_img(self.images[index], flip=self.flip, random_crop=True)
    raw_data = crop_img.transpose((2, 0, 1))
    data = ((torch.FloatTensor(raw_data) / 255.0) - 0.5) * 2
    return data

After Change


  def __getitem__(self, index):
    if self.dataset_size == self.A_size:
      data_A = self.load_img(self.A[index], self.input_dim_A)
      data_B = self.load_img(self.B[random.randint(0, self.B_size - 1)], self.input_dim_B)
    else:
      data_A = self.load_img(self.A[random.randint(0, self.A_size - 1)], self.input_dim_A)
      data_B = self.load_img(self.B[index], self.input_dim_B)
    return data_A, data_B

  def load_img(self, img_name, input_dim):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: HsinYingLee/DRIT
Commit Name: fad73753f836de5cdd08d8e23d26c1170d19b386
Time: 2018-04-09
Author: hytseng0509@gmail.com
File Name: src/dataset_unpair.py
Class Name: dataset_unpair
Method Name: __getitem__


Project Name: david-abel/simple_rl
Commit Name: 335d758f3348cb2b7a1e03cb8248dfde39f8c439
Time: 2018-08-23
Author: david_abel@brown.edu
File Name: simple_rl/abstraction/state_abs/sa_helpers.py
Class Name:
Method Name: visualize_state_abstr_grid


Project Name: khaotik/DaNet-Tensorflow
Commit Name: 6adfd10c54ef3386abb69e48a75c274355c46d5c
Time: 2017-08-08
Author: junkkhaotik@gmail.com
File Name: main.py
Class Name: Model
Method Name: train