can u pls explain the logic of this program in detail?
조회 수: 2 (최근 30일)
이전 댓글 표시
clc;
clear all;
close all;
warning off all;
%%Load the normal data
load data1
load data2
load data3
load data4
load data5
load data1_1
load data1_2
load data1_3
load data1_4
load data1_5
load data2_1
load data2_2
load data2_3
load data2_4
load data2_5
load data3_1
load data3_2
load data3_3
load data3_4
load data3_5
T = [data1,data2,data3,data4,data5,data1_1,data1_2,data1_3,data1_4,data1_5,data2_1,data2_2,data2_3,data2_4,data2_5,data3_1,data3_2,data3_3,data3_4,data3_5];
x = [0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3];
%%create a feed forward neural network
net1 = newff(minmax(T),[30 20 1],{'logsig','logsig','purelin'},'trainrp');
net1.trainParam.show = 25;
net1.trainParam.lr = 0.01;
net1.trainParam.epochs = 3000;
net1.trainParam.goal = 0;
%%train the neural network using the input,target and the created network
[net1] = train(net1,T,x);
%%save the network
save net1 net1
%%simulate the network for a particular input
y = round(sim(net1,T))
댓글 수: 0
채택된 답변
Greg Heath
2014년 4월 11일
This is a very poorly designed classifier.
My advice is to ignore it and study the classification examples in the help and doc documentation of your MATLAB version
help patternnet % or the obsolete newpr
doc patternnet
Also search the NEWSGROUP and ANSWERS for posted code. For example, search using
greg patternet
greg newpr
greg classify
greg classifier
greg classification
If you find code that interests you, post your interpretation and I will check it for you.
Greg
댓글 수: 0
추가 답변 (1개)
Walter Roberson
2014년 4월 7일
Not a chance. It would take several pages just to describe in detail what the "clear all" does. The code is commented. If you don't know what feed forward networks are, then research feed forward networks. If you do not understand MATLAB constructs such as net1.trainParam.lr then study MATLAB instead of asking us to write a detailed explanation.
댓글 수: 1
Jan
2014년 4월 7일
@ASHA: Please take into account that Walter is very good in explaining. When he decides to suggest the "best ways to master matlab" thread, this is a really good answer.
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!