Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://archive.ics.uci.edu/ml/datasets/Yeast
- X=[1 1; 2 2; 2 1; 1 2];
- Y=[1;1;0;0];
- net=newff([0 3; 0 3], [2 1], {'tansig' 'purelin'}, 'trainlm');
- net=init(net);
- net.trainParam.epochs=20;
- net.trainParam.goal=0.00001;
- net=train(net,X',Y');
- [X1 Y1]=meshgrid(0:0.1:3);
- Z=X1;
- Z(:)=sim(net,[X1(:)'; Y1(:)']);
- surf(X1, Y1,Z);
- X=-1:0.05:1;
- X2=-1:0.01:1;
- Y=sin(3*pi*X).^2.*sin(pi*X);
- Y2=sin(3*pi*X2).^2.*sin(pi*X2);
- net=newff([-1 1], [10 1], {'tansig' 'purelin'}, 'trainlm');
- net.trainParam.epochs=500;
- net.trainParam.show=50;
- net.trainParam.goal=0.0000001;
- net=init(net);
- net=train(net,X,Y);
- Z=sim(net, X2);
- plot(X2, Y2, 'r', X, Y, 'gO', X2, Z, 'b');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement