This commit is contained in:
2024-06-14 17:25:12 +02:00
parent f0ec58430c
commit 9e208c70e8
2 changed files with 35 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
function norbload_arma()
fid=fopen('smallnorb-5x46789x9x18x6x2x96x96-training-dat.mat','r');
fread(fid,4,'uchar'); % result = [85 76 61 30], byte matrix(in base 16: [55 4C 3D 1E])
fread(fid,4,'uchar'); % result = [4 0 0 0], ndim = 4
numImages = fread(fid,4,'uchar'); % result = [236 94 0 0], dim0 = 24300 (=94*256+236)
fread(fid,4,'uchar'); % result = [2 0 0 0], dim1 = 2
fread(fid,4,'uchar'); % result = [96 0 0 0], dim2 = 96
fread(fid,4,'uchar'); % result = [96 0 0 0], dim3 = 96
ncase = 10;
nx = 96;
ny = 96;
npixl = nx*ny;
im = zeros(ncase, npixl);
n = 1
c = 1
while (n <= ncase)
if (mod(c, 2) == 0)
im(n, :) = fread(fid,npixl)/256;
n = n + 1;
end
c = c + 1;
end;
fclose (fid);
save ("-ascii", "norb.trainingStates.dat", 'im')
Executable
+3
View File
@@ -0,0 +1,3 @@
8.35966772e-02 4.35877914e-01 4.92330766e-02 1.77356648e-01
2.11135789e-01 6.69802888e-01 5.01491449e-01 7.72594091e-01
8.15111040e-01 2.97008737e-01 1.65219911e-01 2.62748551e-01