- Ensure that "P" is a Matrix, where each column represents a sample, and each row represents a feature of those samples.
- Ensure that "T" is also a Matrix, where each column represents to a target class of a sample in "P", and each row represent the corresponding one hot encoding of that class.
Unable to use newpnn command
조회 수: 12 (최근 30일)
이전 댓글 표시
When I am using the newpnn command as net_1 = newpnn(P,T,0.438644); P and T are the arguments.It is giving this error message ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1115760/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1115760/image.jpeg)
How can I remove this error?
댓글 수: 0
답변 (1개)
Meet
2024년 8월 20일 9:04
Hi Aritra,
The error message suggests that the input "P" is not in the expected format. To resolve this issue, you can consider the following steps:
Here is an example of the "newpnn" function:
% If you have 3 features and 5 samples
P = [
0.1, 0.2, 0.3, 0.4, 0.5;
0.5, 0.4, 0.3, 0.2, 0.1;
0.2, 0.3, 0.4, 0.5, 0.6
];
% If you have 2 classes
% Each column corresponds to the class of the sample in P
T = [
1, 0, 1, 0, 1; % Class 1
0, 1, 0, 1, 0 % Class 2
];
% Create the PNN with a specified spread
spread = 0.438644;
net_1 = newpnn(P, T, spread);
For more information on the "newpnn" function, please refer to the following documentation: https://www.mathworks.com/help/deeplearning/ref/newpnn.html
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!