I want the same randomly split dataset for all the network so that i can compare the results.

조회 수: 7 (최근 30일)
Hello there.... This is my code...
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.8,'randomize');
I'm training the same dataset on three different architecture, I don't want the dataset to split different data randomly for each network. I want the same split dataset for all the network so that i can compare the results.
I want the same randomly splited data for all the network.
However, how do i use the residual 20% for the evaluation of my model obtained from the training dataset.

채택된 답변

Wan Ji
Wan Ji 2021년 8월 30일
편집: Wan Ji 2021년 8월 30일
You can save imdsTrain, imdsValidation for the first run
And then use load to get imdsTrain, imdsValidation for three different architecture
Here just run once for all
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.8,'randomize');
save imdsTrain.mat imdsTrain
save imdsValidation.mat imdsValidation
Then use load for the three different architectures.
At the beginning of each run m-file
load('imdsTrain.mat');
load('imdsValidation.mat');
  댓글 수: 2
Olalekan Adesina
Olalekan Adesina 2021년 8월 30일
Thanks for your response. I think i just need to include one or few lines of code with or along with [imdsTrain,imdsValidation] = splitEachLabel(imds,0.8,'randomize');
The issue is this..... I created different folder for each architecture. Each folder contains dataset and it's code i.e "code.mlx".
There are three different folders, each folder consist of the same dataset and its code.
In each of this folder, the code.mlx have [imdsTrain,imdsValidation] = splitEachLabel(imds,0.8,'randomize');
So, what can i do to randomly split the same data for all the three network? I will be using 80% for training and 20% to evaluate my model.
Wan Ji
Wan Ji 2021년 8월 30일
편집: Wan Ji 2021년 8월 30일
Do you know how datastore manipulates the dataset? IF so, I suggest you use rng function
rng('default'); % use fixed rand series
imds = shuffle(imds); % use the fixed rand number series to rearrange the dataset randomly
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.8);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by