资源简介
猫分类数据集读入程序,data.h5(https://www.floydhub.com/deeplearningai/datasets/cat -vs-noncat)含209个训练样本与50个测试样本,其中每个样本均为64×64大小的RGB彩色图片。
代码片段和文件信息
train_set_x_orig = h5read(‘train_catvnoncat.h5‘ ‘/train_set_x‘);
train_set_y_orig = h5read(‘train_catvnoncat.h5‘ ‘/train_set_y‘);
test_set_x_orig = h5read(‘test_catvnoncat.h5‘ ‘/test_set_x‘);
test_set_y_orig = h5read(‘test_catvnoncat.h5‘ ‘/test_set_y‘);
classes = h5read(‘test_catvnoncat.h5‘ ‘/list_classes‘);
m_train = size(train_set_x_orig 4);
m_test = size(test_set_x_orig 4);
num_px = size(train_set_x_orig 2);
num_channel = size(train_set_x_orig 1);
fprintf(‘Dataset dimensions: \n‘);
fprintf(‘Number of training examples: m_train = %d \n‘ m_train);
fprintf(‘Number of testing exa
- 上一篇:ADRC仿真程序
- 下一篇:从三维数组中提取出任意二维的数据,并保存在新的二维矩阵中
评论
共有 条评论