text_plain_output_1.png
import h5py

import matplotlib.pyplot as plt

import numpy as np # linear algebra

def load_dataset():
    train_dataset = h5py.File('../input/hand-sign/train_signs.h5', 'r')
    train_set_x_orig = np.array(train_dataset['train_set_x'][:])
    train_set_y_orig = np.array(train_dataset['train_set_y'][:])
    test_dataset = h5py.File('../input/hand-sign-test/test_signs.h5', 'r')
    test_set_x_orig = np.array(test_dataset['test_set_x'][:])
    test_set_y_orig = np.array(test_dataset['test_set_y'][:])
    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)

train_x, train_y, test_x, test_y = load_dataset()
(train_x.shape, train_y.shape, test_x.shape, test_y.shape)

import matplotlib.pyplot as plt
plt.subplots(2, 2)
plt.subplots_adjust(top=0.92, bottom=0.08, left=0.1, right=0.95, hspace=0.45, wspace=0.45)
plt.subplot(2, 2, 1)
plt.title('train_x[5] label : 4')
plt.imshow(train_x[5])
plt.subplot(2, 2, 2)
plt.title('train_x[10] label : 2')
plt.imshow(train_x[10])
plt.subplot(2, 2, 3)
plt.title('test_x[5] label : 0')
plt.imshow(test_x[5])
plt.subplot(2, 2, 4)
plt.title('test_x[10] label : 5')
plt.imshow(test_x[10])