Skip to content

Instantly share code, notes, and snippets.

@SuvroBaner
Created October 10, 2019 03:29
Show Gist options
  • Save SuvroBaner/f84a0287197fc9aef67ffdc6e5b5e83f to your computer and use it in GitHub Desktop.
Save SuvroBaner/f84a0287197fc9aef67ffdc6e5b5e83f to your computer and use it in GitHub Desktop.
def load_dataset():
train_dataset = h5py.File('/kaggle/input/aulas-keras/train_catvnoncat.h5', "r")
train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features
train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train set labels
test_dataset = h5py.File('/kaggle/input/aulas-keras/test_catvnoncat.h5', "r")
test_set_x_orig = np.array(test_dataset["test_set_x"][:]) # your test set features
test_set_y_orig = np.array(test_dataset["test_set_y"][:]) # your test set labels
classes = np.array(test_dataset["list_classes"][:]) # the list of classes
train_set_y_orig = train_set_y_orig.reshape((1, train_set_y_orig.shape[0]))
test_set_y_orig = test_set_y_orig.reshape((1, test_set_y_orig.shape[0]))
return train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment