필터 지우기
필터 지우기

how to assign the output of trained Pattern Recognition Neural Network to a class for each instant

조회 수: 1 (최근 30일)
i have a trained pattern recognition neural network with 8 outputs ranges under [0 1] (e.g for instant [0,0.2,0.25,0.35,0.02,0.08,0.1,0] with the sum equal to 1 at the each (1e-6)). Now i would like to assign the max value of the array to a specified class and rest value of the array to be zero for each instant. what is the best posible way to do it. Your help will be appreciated
Best regards

답변 (1개)

yanqi liu
yanqi liu 2021년 11월 26일
sir,may be find the max index to get the result,such as
% assign the max value of the array to a specified class and rest value of the array to be zero for each insta
p = net(data);
% such as
% p = [0,0.2,0.25,0.35,0.02,0.08,0.1,0];
[~, index] = max(p);
classes = {'A', 'B', 'C','D','E','F','G', 'H'};
result = classes{index}
  댓글 수: 1
muhammad usama
muhammad usama 2021년 11월 26일
Thanks for the response. It’s much appreciated. I solve the problem by just using the [m,ind]=max(data from NN) And then using the IF functions to assign the class.

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

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by