Prev: avoid for
Next: Problem with deployment
From: Tricia Rambharose on 16 Jul 2010 14:08 Hi George, I am using your PSO Research toolbox 2007 version. I may have found a bug in your PSO Research toolbox code. When I set OnOff_SuccessfulUnsuccessful = logical(0); in the Control_Panel I get an error from the Standard_Output function : "Undefined function or variable 'w'. If OnOff_SuccessfulUnsuccessful = logical(1) however the toolbox seems to work fine. Can you provide some insight into this? Thanks!
From: George Evers on 24 Jul 2010 23:51 Tricia, I've fixed the bug; thank you for reporting it. The problem occurred for input combination (OnOff_w_time_vary) &&(~OnOff_SuccessfulUnsuccessful), which I have not used in quite a while since I generally track the number of successful trials. Concerning our email collaboration on neural net training, I am about to email you the updated version of the toolbox, which I just submitted to The MathWorks (i.e. pending approval). At least one fix is relevant to your goals as I will clarify further in the email.
From: George Evers on 25 Jul 2010 23:49 Tricia, If you want to call the PSO Research Toolbox as a function by which to return values to the neural net toolbox, you could use a wrapper between the toolboxes. As in an earlier post, I'll use capitalization below for headings. WRAPPER CODE function [fg, g(1, :)] = ANNbox_calls_PSORT_wrapper(...) % This would wrap the PSO Research Toolbox for input/output. Control_Panel.m %This would execute the PSO Research Toolbox within the wrapper according to the settings specified in the control panel. % At this point, any data produced by the PSO Research Toolbox could be passed to the neural net toolbox, though you are probably only interested in the global best, g(1, :), and its function value, fg. ONE TRIAL If you decide to use a wrapper, be sure to set "num_trials" within the control panel to 1 since you presumably want to execute 1 PSO trial per call. Inadvertantly setting it to a larger value would produce valid data so that no error message would be generated, but excess computations would be performed. PASSING INFO INTO WRAPPER? If you will be passing information in through a wrapper, "clear all" atop Control_Panel.m would need to be removed to avoid clearing the input information; it would no longer serve a purpose anyway since the PSO Research Toolbox would have a local workspace within the wrapper. You might, however, be able to specify all settings within the control panel rather than passing anything in, which would render this modification unnecessary; in this case, the wrapper would exist only to pass data generated according to the settings in Control_Panel.m back to the neural net toolbox. HOW TO EVALUATE WEIGHTS? The PSO Research Toolbox iteratively passes the position matrix, x, into the objective/benchmark function and utilizes the returned vector of function values, f, to update the global best, g, and personal bests, p, before updating velocities, v, and positions. If calling the PSO Research Toolbox from the neural net toolbox through a wrapper, a neural net would be pre-defined, and the PSO Research Toolbox would need to iteratively pass the position/weight matrix into that network to evaluate the weights' effectiveness in order to optimize them. One way to do this would be to (i) declare the network and all pertinent information global before calling the PSO Research Toolbox, and (ii) declare the same variables global atop ObjFun_ANN.m/benchmark_ANN.m in order to grant the objective function access to them. There are other possible approaches that we might discuss before proceeding. Would 8-9 AM or 9:30PM onward work for a phone call? It would be good to see clearly where we're going before trying to get there. George
From: George Evers on 29 Jul 2010 02:03 Tricia, It was nice chatting with you this evening. The updated Particle Swarm Optimization Research Toolbox is available at www.mathworks.com/matlabcentral/fileexchange/28291-particle-swarm-optimization-research-toolbox. If the updates described at www.georgeevers.org/toolbox_updates.rtf seem relevant to your research, you might consider pasting your code into the updated version. I understand that you have added quite a bit of code, but you can paste in chunks; and it might be easier now than later. George
From: George Evers on 29 Jul 2010 02:43
Tricia, Sorry, reposting with clickable links: the updated Particle Swarm Optimization Research Toolbox is available at http://www.mathworks.com/matlabcentral/fileexchange/28291-particle-swarm-optimization-research-toolbox. If the updates described at http://www.georgeevers.org/toolbox_updates.rtf seem relevant to your research, you might consider pasting your code into the updated version. I understand that you have added quite a bit of code, but you can paste in chunks; and it might be easier now than later. George |