Hi everybody, I am trying to design a CNN for regression following this Matlab example. It uses a 4D array to store the images and vector to store the values associated to every picture. I am using this code to create a 4D array called 'database' that contains my images and a vector 'labels' that contains the values.
k = 1;%2cm
for i = 1:1000 str = sprintf('images/2cm/%d.jpg', i); image_to_store = imread(str); database(:,:,1,k) = (image_to_store(:,:)); % images are in grey scale
labels(k) = 2; k = k+1;end%20cm
for i = 1:1000 str = sprintf('images/20cm/%d.jpg', i); image_to_store = imread(str); database(:,:,1,k) = (image_to_store(:,:)); labels(k) = 20; k = k+1;end% ...
Now, I have my 4D array and the vector, so I am trying to divide them into a Training Set and a Validation Set as suggested in the example linked. Can anyone please help me to understand how can I do that?
Thanks
Vale
Best Answer