Using GA and NN to find a cat face inside an image, problem in custom population and fitness function
Show older comments
Hello, I am currently working on a project to identify a cat face inside an image using GA, I had a trained neural network that can classify whether the input image is cat or not. My problem is in developing the GA to find the best window that can correspond to the cat face, I have developed a custom popoulation func & custom fitness func but I had this error Error in Genetic_Algorithm_NN>PopFunction (line 32) I = imread('C:\Users\Mohamed\Desktop\Neural Networks\Assignment 3\100cats\00000016_018.jpg');
Error using feval
Output argument "pop" (and maybe others) not assigned during call to
"C:\Users\Mohamed\Desktop\Neural Networks\Assignment
3\Genetic_Algorithm_NN.m>PopFunction".
Error in makeState (line 30)
state.Population =
feval(options.CreationFcn,GenomeLength,FitnessFcn,options,options.CreationFcnArgs{:});
Error in gaunc (line 41)
state =
makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error in ga (line 348)
[x,fval,exitFlag,output,population,scores] =
gaunc(FitnessFcn,nvars, ...
Error in Genetic_Algorithm_NN (line 24)
[chromosome,~,~,~,~,~] = ga(@FitFunc,nvars,options);
I am really stuck and I don't know what should be fixed, you kindly help is highly appreciated I will post the code in the next comment thanks
1 Comment
Mohamed
on 17 Dec 2014
Edited: Geoff Hayes
on 17 Dec 2014
Accepted Answer
More Answers (1)
Mohamed
on 17 Dec 2014
0 votes
2 Comments
ravi kumar
on 14 Mar 2017
what is the purpose of popfunction in this code
ravi kumar
on 15 Mar 2017
hello sir ,please tell me how to write a code on fitness function. My fitness funtion = Accuracy + (no of absent attributes* balancing factor ) i.e balancing factor =0.1 please help me ,iam basic learner in matlab .
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!