can u pls explain the logic of this program in detail?

1 view (last 30 days)
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))

Accepted Answer

Greg Heath
Greg Heath on 11 Apr 2014
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

More Answers (1)

Walter Roberson
Walter Roberson on 7 Apr 2014
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 Comment
Jan
Jan on 7 Apr 2014
@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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!