Comparison of CNN training results using image datastore and image arrays
2 次查看(过去 30 天)
显示 更早的评论
Hello,
The question pertains to the following example:
You can see the loss results when the image datastore object is used (as it is in the original example) below with the following function call:
net = trainNetwork(dsTrain,layers,options);
However, if you extract the same datastore (dsTrain) into 4d array of images and split the input and target images into XTrain and YTrain as follows:
dsTrainNoisy_transformed_combined_augmented_temp=readall(dsTrain);
dsTrainNoisy_transformed_combined_augmented=dsTrainNoisy_transformed_combined_augmented_temp(:,1);
dsTrainNoisy_transformed_combined_augmented_2=zeros(32,32,1,9500);
for i=1:9500
dsTrainNoisy_transformed_combined_augmented_2(:,:,:,i)=dsTrainNoisy_transformed_combined_augmented{i,1};
end
dsTrainNoiseless_transformed_combined_augmented_temp=readall(dsTrain);
dsTrainNoiseless_transformed_combined_augmented=dsTrainNoiseless_transformed_combined_augmented_temp(:,2);
dsTrainNoiseless_transformed_combined_augmented_2=zeros(32,32,1,9500);
for i=1:9500
dsTrainNoiseless_transformed_combined_augmented_2(:,:,:,i)=dsTrainNoiseless_transformed_combined_augmented{i,1};
end
XTrain=dsTrainNoisy_transformed_combined_augmented_2;
YTrain=dsTrainNoiseless_transformed_combined_augmented_2;
net = trainNetwork(XTrain,YTrain,layers,options);
The following Loss curve is obtained:
I don't understand why this is the case, since XTrain and YTrain represent the same images as in the data store itself, and nothing else is changed, so why are the results different this time around?
Any help would be highly appreciated.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!