From: Tricia Rambharose on
Hi George,

Just a few questions. I experimented with 'fg' and 'g' to pass to the NN as we discussed. I see that 'fg' is a single value, the function value at the global best. 'g' seems to be a matrix however. Is 'g' supposed to be the single position vector of where 'fg' occurs? Thanks.


"George Evers" <george(a)georgeevers.org> wrote in message <i2r7ub$dnu$1(a)fred.mathworks.com>...
> 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
From: George Evers on
Tricia, you are correct that the global best is a single position vector; however, that row vector is replicated across each row of "g" to accommodate matrix subtraction in the velocity update equation (i.e. to have the same dimensionality as the matrix of positions, "x," and the matrix of personal bests, "p"). Please access the global best as a vector using "g(1, :)," which will always work regardless of the swarm size.

Also, the link above is non-working due to the period interpreted as part of the link. The correct location of the updated Particle Swarm Optimization Research Toolbox is [*].

[*] http://www.mathworks.com/matlabcentral/fileexchange/28291-particle-swarm-optimization-research-toolbox

"Tricia Rambharose" <rtrambharose(a)gmail.com> wrote in message <i2sbus$jbk$1(a)fred.mathworks.com>...
> Hi George,
>
> Just a few questions. I experimented with 'fg' and 'g' to pass to the NN as we discussed. I see that 'fg' is a single value, the function value at the global best. 'g' seems to be a matrix however. Is 'g' supposed to be the single position vector of where 'fg' occurs? Thanks.
From: Tricia Rambharose on
Hi George,

I replace the following lines of code in RegPSO_main.m

if OnOff_v_reset || OnOff_position_clamping
xmax_matrix = center_ss0 + range_ss0./2; %Calculate once and for all
xmin_matrix = center_ss0 - range_ss0./2; %rather than iteratively.
end

With the code you sent to me via email.

When I run PSO using gbest I get an error saying:

"Undefined function or variable 'xmax_matrix
Error in ==> gbest_core_loop at 82"

It seems that since I removed the above lines of code, this xmax_matrix which is referenced in gbest_core_loop, no longer exists.

How do you suggest to fix this? Thanks again!


"George Evers" <george(a)georgeevers.org> wrote in message <i2snes$u7$1(a)fred.mathworks.com>...
> Tricia, you are correct that the global best is a single position vector; however, that row vector is replicated across each row of "g" to accommodate matrix subtraction in the velocity update equation (i.e. to have the same dimensionality as the matrix of positions, "x," and the matrix of personal bests, "p"). Please access the global best as a vector using "g(1, :)," which will always work regardless of the swarm size.
>
> Also, the link above is non-working due to the period interpreted as part of the link. The correct location of the updated Particle Swarm Optimization Research Toolbox is [*].
>
> [*] http://www.mathworks.com/matlabcentral/fileexchange/28291-particle-swarm-optimization-research-toolbox
>
> "Tricia Rambharose" <rtrambharose(a)gmail.com> wrote in message <i2sbus$jbk$1(a)fred.mathworks.com>...
> > Hi George,
> >
> > Just a few questions. I experimented with 'fg' and 'g' to pass to the NN as we discussed. I see that 'fg' is a single value, the function value at the global best. 'g' seems to be a matrix however. Is 'g' supposed to be the single position vector of where 'fg' occurs? Thanks.
From: George Evers on
Tricia, in newer versions of the toolbox, "xmin_matrix" and "xmax_matrix" have been renamed "xmin" and "xmax" for simplicity. You could either: (a) paste your code into the most recent version of the toolbox using current variable names to avoid all such errors in the future, or (b) simply rename "xmin" and "xmax" as "xmin_matrix" and "xmax_matrix" in the fix.

George

"Tricia Rambharose" <rtrambharose(a)gmail.com> wrote in message <i375ns$mq9$1(a)fred.mathworks.com>...
> Hi George,
>
> I replace the following lines of code in RegPSO_main.m
>
> if OnOff_v_reset || OnOff_position_clamping
> xmax_matrix = center_ss0 + range_ss0./2; %Calculate once and for all
> xmin_matrix = center_ss0 - range_ss0./2; %rather than iteratively.
> end
>
> With the code you sent to me via email.
>
> When I run PSO using gbest I get an error saying:
>
> "Undefined function or variable 'xmax_matrix
> Error in ==> gbest_core_loop at 82"
>
> It seems that since I removed the above lines of code, this xmax_matrix which is referenced in gbest_core_loop, no longer exists.
>
> How do you suggest to fix this? Thanks again!
>
>
> "George Evers" <george(a)georgeevers.org> wrote in message <i2snes$u7$1(a)fred.mathworks.com>...
> > Tricia, you are correct that the global best is a single position vector; however, that row vector is replicated across each row of "g" to accommodate matrix subtraction in the velocity update equation (i.e. to have the same dimensionality as the matrix of positions, "x," and the matrix of personal bests, "p"). Please access the global best as a vector using "g(1, :)," which will always work regardless of the swarm size.
> >
> > Also, the link above is non-working due to the period interpreted as part of the link. The correct location of the updated Particle Swarm Optimization Research Toolbox is [*].
> >
> > [*] http://www.mathworks.com/matlabcentral/fileexchange/28291-particle-swarm-optimization-research-toolbox
From: Tricia Rambharose on
Hi George,

Thanks again! For now I made the change in the fix. I want to switch over to the latest version of your PSO Research toolbox, but there's a bug in the interfacing code I developed that I need to fix first.

What I need to know now is what is the stopping condition(s) for PSO in your toolbox and where is it found? I ask because I want PSO to stop when a certain fitness value is found. After some tests I realised that the PSO continues long after this specified stopping fitness value. Also from my tests, at the minima point the PSO continues for a lot of iterations even though all particles continuously give the same fitness value. This is a waste of time since no change is observed in particles positions for quite a while before it stops.

In ANN the user can specify a training goal. If applying PSO to ANN training I think it would make sense to stop the PSO algorithm when this ANN goal is met. I see in the Control_Panel.m there is a variable 'true_global_minimum'. I set this to be the ANN goal but PSO still does not stop when this is reached. I also experimented with setting the 'thresh_for_succ' in Benchmarks.m to the ANN goal but with no better results.

Can you differentiate true_global_minimum and thresh_for_succ and also provide any explanation for this stagnation on PSO? Thanks!
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: avoid for
Next: Problem with deployment