搭建算法架构需要引入以下包
1.numpy 科学计算库
2.h5py 遍历存在于H5文件里的数据集
3.matplotlib python画图工具库
4.PIL和scipy 用自己的图片测试模型
数据data.h5中包括
1.训练集,标明了y=1(cat)和y=0(non cat)
2.测试集,标记了cat或者non-cat
3.每张图片shape为(num_px,num_px,3)
加载数据
# Loading the data (cat/non-cat)
train_set_x_orig, train_set_y, test_set_x_orig, test_set_y, classes = load_dataset()
查看数据集合信息
m_train = train_set_x_orig.shape[0]
m_test = test_set_x_orig.shape[0]
num_px = train_set_x_orig.shape[1]
将图片的shape((m_train, num_px, num_px, 3)转换成为shape(num_px*num_px*3,