Sign in to follow this  

matlab\netlab code.(need help to find the problem)

Recommended Posts

kingrico    122
this is the matlab code i used the matlab\netlab using the MLP algorithm load('mail.dat') //(600*16) for i = 1: 16 // nomalization mini= min(mail(:,i)); maxi = max(mail(:,i)); mail(:,i)= (mail(:,i)-mini)/maxi; end no_data=size(mail) training = mail (1:1.5:no_data,:); // (400*16) validation = mail(1.5:6:no_data,:); // (100*16) testing= mail(6:6:no_data,:); // (100*16) for i = 1: (size(training,1)) ts = training (i,3); ts = reshape(ts,size(ts,1)*size(ts,2),1); tset(i,:) = ts'; target(i) = training(i,3); end target =target'; for i=1:(size(validation,1)) ts = validation(i,3); ts = reshape(ts,size(ts,1)*size(ts,2),1); vset(i,:) = ts'; vtarget(i) = validation(i,3); end vtarget = vtarget'; for i=1:(size(testing,1)) ts = testing(i,3); ts = reshape(ts,size(ts,1)*size(ts,2),1); testset(i,:) = ts'; testtarget(i) = testing(i,3); end testtarget = testtarget'; net = mlp(4,3,1,'linear') for i=1:20 [net,error] = mlptrain(net,tset,target,10); plot(i*100,error,'r+'); end ??? Error using ==> mlperr Dimension of inputs 1 does not match number of model inputs 4 Error in ==> neterr at 23 [s{1:nargout}] = feval(errstr, net, x, t); Error in ==> scg at 79 fold = feval(f, x, varargin{:}); % Initial function value. Error in ==> netopt at 36 [s{1:nargout}] = eval(optstring); Error in ==> mlptrain at 21 [net, options] = netopt(net, options, x, t, 'scg'); can any one tell me whats wrong with my code.i dont know what the problems are . thanks. [Edited by - kingrico on October 23, 2005 8:48:14 PM]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this