Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 4599 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!