e90157e7f01c85e9ef22f9679f1a40bda0efb51f,src/utils/utils.py,,split_data,#,26
Before Change
return imresize(image_array, size)
def split_data(ground_truth_data, training_ratio=.8, do_shuffle=False):
ground_truth_keys = sorted(ground_truth_data.keys())
if do_shuffle == True:
shuffle(ground_truth_keys)
num_train = int(round(training_ratio * len(ground_truth_keys)))
train_keys = ground_truth_keys[:num_train]
validation_keys = ground_truth_keys[num_train:]
return train_keys, validation_keys
def display_image(image_array):
image_array = np.squeeze(image_array).astype("uint8")
plt.imshow(image_array)
After Change
def split_data(x, y, validation_split=.2):
num_samples = len(x)
num_train_samples = int((1 - validation_split)*num_samples)
train_x = x[:num_train_samples]
train_y = y[:num_train_samples]
val_x = x[num_train_samples:]
val_y = y[num_train_samples:]
train_data = (train_x, train_y)
val_data = (val_x, val_y)
return train_data, val_data
def display_image(image_array):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances
Project Name: oarriaga/face_classification
Commit Name: e90157e7f01c85e9ef22f9679f1a40bda0efb51f
Time: 2017-06-30
Author: arriaga.camargo@gmail.com
File Name: src/utils/utils.py
Class Name:
Method Name: split_data
Project Name: ikostrikov/pytorch-a2c-ppo-acktr
Commit Name: 82833059b7ee72896c07489bfc0369079ccedd77
Time: 2018-05-21
Author: ikostrikov@gmail.com
File Name: algo/ppo.py
Class Name: PPO
Method Name: update
Project Name: tensorflow/ranking
Commit Name: 6bf3f51cd0a312da842157665663c2dad9983248
Time: 2021-01-29
Author: xuanhui@google.com
File Name: tensorflow_ranking/python/losses_impl.py
Class Name: ClickEMLoss
Method Name: _compute_latent_prob