Plz, Edit the NEWFF according to the latest version of MATLAB.
Show older comments
when i simulate the below code it is showing some errors.
like obsolete way of using NEWFF.
what is the new model for it ?
Can some one edit the NEWFF according to the latest version.
- load data.txt
- P = data(1:15,1);
- T = data(16:30,1);
- a = data(31:45,1);
- s = data(46:60,1);
- [py, pys] = mapminmax(P');
- [ay, ays] = mapminmax(a');
- [ty, tys] = mapminmax(T');
- [sy, sys] = mapminmax(s');
- net = newff(minmax(py),[6 1], {'logsig','logsig'}, 'triangdm')
- net.trainParam.epochs = 3000;
- net.trainParam.lr = 0.5;
- net.trainParm.mc = 0.8;
- net = train(net,py,ty);
- y = sim(net,ay);
6 Comments
Greg Heath
on 7 Aug 2013
Edited: Greg Heath
on 7 Aug 2013
0. help newff
doc newff
type newff
1. Do you think it is inconsiderate of you to not include one of the MATLAB data sets for us to use as an example?
>> help nndatasets
2. Do you think it is inconsiderate of you to not include your error messages"
3. Why not use the defaults as in the help newff example?
4. Why not use the transpose in statements 2-5?
5. traingdm is misspelled
6. net.trainParam is misspelled
7. mapminmax is a default
8. {'tansig' 'tansig' } is the natural combination to use with the mapminmax transformations to [ -1, 1 ]
net = newff(P,T, 6 ,{'tansig' 'tansig'},'traingdm')
9. The defaults settings for 'traingdm' are
net.trainParam.epochs = 1000
net.trainParam.lr = 0.01
net.trainParam.mc = 0.9
Anjireddy Thatiparthy
on 10 Aug 2013
Greg Heath
on 10 Aug 2013
How many hidden nodes did you need to get a satisfactory answer?
Anjireddy Thatiparthy
on 13 Aug 2013
Greg Heath
on 13 Aug 2013
Edited: Greg Heath
on 13 Aug 2013
1. That is not a clear explanation AND it seems to have little to do with your original post.
2. Why are you posting an equation that
a. is obsolete
b. has inappropriate transfer functions
c. has a misspelled training function (to which you were alerted earlier)
3. If you have 2012a, why are you trying to use the obsolete newff?
4. Now it seems that you might want the simple classifier
output = hardlim(input-5663)
4. Please clarify.
a. Single output y(t) = ( 566x.xx or 0/1?)
b. Corresponding input y( t-d:t-1)
Anjireddy Thatiparthy
on 19 Aug 2013
Accepted Answer
More Answers (1)
Greg Heath
on 7 Aug 2013
if true
% code
end
clear all, clc
[ inputs, targets ] = simplefit_dataset;
P = inputs(1:2:end);
T = targets(1:2:end);
[ I N ] = size(P)
[ O N ] = size(T)
MSE00 = var(T,1) % 8.3328 Reference MSE
Neq = N*O % No. of equations = prod(size(T)
a = inputs(2:2:end);
s = targets(2:2:end);
% Nw = (I+1)*H+(H+1)*O % No. of weights = Nw
{Hub = -1+ceil( (Neq-O)/(I+O+1)) % 15 (Neq >= Nw)
Hmin = 0
dH = 2
Hmax =ceil(Hub/2)
Ntrials = 10
MSEgoal = MSE00/100
MinGrad = MSEgoal/10
rng(0)
j = 0
for h = Hmin:dH:Hmax
j=j+1
if h ==0
net = newff(P,T, []);
else
net=newff(P,T,h);
end
for i = 1:Ntrials
hidden = h
ntrials = i
net.trainParam.goal = MSEgoal;
net.trainParam.min_grad = MinGrad;
[ net tr Y E ]= train(net,P,T);
NMSE(i,j) = mse(E)/MSE00;
end
end
NMSEtst = mse(s-net(a))/var(s,1) %4.0567e-005
H = Hmin:dH:Hmax
NMSE=NMSE
2 Comments
Anjireddy Thatiparthy
on 13 Aug 2013
Greg Heath
on 24 Oct 2013
Sorry I missed your comment. If you have any SPECIFIC questions on the code,
please post.
Categories
Find more on Univariate Discrete Distributions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!