【发布时间】:2021-11-04 02:55:17
【问题描述】:
您好,我是 MATLAB 新手,我一直在尝试弄清楚如何使用 MATLAB 加载 faces1000.mat 文件和 nonfaces1000.mat 图像,我有一个 load_mnist 代码
mnist_file = 'scrambled_mnist10000.bin';
fid = fopen(mnist_file, 'r');
[number, count] = fread(fid, 1, 'int32');
if count ~= 1
disp('failed to read number');
end
[mnist_permutation, count] = fread(fid, number, 'int32');
if count ~= mnist_permutation
disp('failed to read number');
end
[mnist_labels, count] = fread(fid, number, 'uchar');
if count ~= number
disp('failed to read number');
end
mnist_digits = fread(fid, [28, 28 * number], 'uchar');
mnist_digits = reshape(mnist_digits, [28, 28, number]);
fclose(fid);
disp('loaded mnist digits');
我只是不确定是否应该以相同的方式加载我的 faces1000.mat 和 nonfaces1000.mat 图像文件。我会很感激任何帮助,谢谢。
【问题讨论】:
标签: matlab