Skip to content

Instantly share code, notes, and snippets.

@miki998
Created March 28, 2020 14:18
Show Gist options
  • Save miki998/7710c1c2709bbfe0587363e4ede2026d to your computer and use it in GitHub Desktop.
Save miki998/7710c1c2709bbfe0587363e4ede2026d to your computer and use it in GitHub Desktop.
with h5py.File("./full_dataset_vectors.h5", "r") as hf:
# Split the data into training/test features/targets
X_train = hf["X_train"][:]
targets_train = hf["y_train"][:]
X_test = hf["X_test"][:]
targets_test = hf["y_test"][:]
# Determine sample shape
sample_shape = (16, 16, 16, 3)
# Reshape data into 3D format
X_train = rgb_data_transform(X_train)
X_test = rgb_data_transform(X_test)
# Convert target vectors to categorical targets
targets_train = to_categorical(targets_train).astype(np.integer)
targets_test = to_categorical(targets_test).astype(np.integer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment