I made a patternnet, and i cannot understand what target values mean

조회 수: 2 (최근 30일)
SOUGLES STAMATIS
SOUGLES STAMATIS 2021년 1월 12일
답변: Anshika Chaurasia 2021년 1월 20일
I have a set of image feature data and i have made my target matrix as:
targets = zeros(3,900);
targets(1,1:300) = 1;
targets(2,301:600) = 1;
targets(3,601:900) = 1;
what would change if i changed the 1 values as:
targets = zeros(3,900);
targets(1,1:300) = 1;
targets(2,301:600) = 2;
targets(3,601:900) = 1;
can anyone explain me what is their role?

답변 (1개)

Anshika Chaurasia
Anshika Chaurasia 2021년 1월 20일
Hi Sougles,
In the following code, the dataset labels/target/classes are in one-hot encoding format.
targets = zeros(3,900);
targets(1,1:300) = 1;
targets(2,301:600) = 1;
targets(3,601:900) = 1;
Looking at the shape of targets, there are 3 classes in your dataset.
Let's say there are three classses A, B and C. So, we will need three binary variables for one-hot encoding. A "1" value is place in the binary variable for the class and "0" for the other classes.
Hence,
targets(1,1:300) = 1; % samples 1 to 300 belong to first class
targets(2,301:600) = 1;% samples 301 to 600 belong to second class
targets(3,601:900) = 1;% samples 601 to 900 belong to third class

카테고리

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