Skip Menu |

This queue is for tickets about the AI-PSO-OO CPAN distribution.

Report information
The Basics
Id: 70790
Status: resolved
Priority: 0/
Queue: AI-PSO-OO

People
Owner: grandpa [...] cpan.org
Requestors: KBALBI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Detection of 'best' Best-Fit before the optimisation completes
I needed the ability to detect if the 'optimum' had been reached before the number of iterations had completed. I have attached a version of the module in which I've implemented this option (disabled by default for backwards compatibility) which detects if the fitness value is unchanging of a specified number of iterations. Also I built in the ability to adjust the sensitivity, through number of decimal places (although arguably this should be implemented as significant figures) as well as allowing the opportunity to set a 'burn in' time before which the optimisation doesn't check for 'plateaus'.
Subject: ParticleSwarmOptimisation-1.004.pm

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #70790] Detection of 'best' Best-Fit before the optimisation completes
Date: Sat, 10 Sep 2011 20:21:35 +1200
To: <bug-AI-PSO-OO [...] rt.cpan.org>
From: "Peter Jaquiery" <grandpa [...] cpan.org>
Hi Kevin, I've just uploaded version 1.004 of AI::ParticleSwarmOptimization (note the name change) containing your plateau early exit code. Note that I've made the mean calculation faster and less memory hungry by using a circular queue. If you have the chance to check the changes and see that it works as you expected I'd appreciate it.I've attached the module in case you get a chance to look at it before the new version turns up on CPAN. If you are happy with the code let me know and I'll close the bug. Cheers, Peter Jaquiery Show quoted text
----- Original Message ----- From: "Kevin Balbi via RT" <bug-AI-PSO-OO@rt.cpan.org> To: <undisclosed-recipients:> Sent: Thursday, September 08, 2011 3:30 AM Subject: [rt.cpan.org #70790] Detection of 'best' Best-Fit before the optimisation completes
> Wed Sep 07 11:30:06 2011: Request 70790 was acted upon. > Transaction: Ticket created by KBALBI > Queue: AI-PSO-OO > Subject: Detection of 'best' Best-Fit before the optimisation > completes > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: KBALBI@cpan.org > Status: patched > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=70790 > > > > I needed the ability to detect if the 'optimum' had been reached before > the number of iterations > had completed. > > I have attached a version of the module in which I've implemented this > option (disabled by > default for backwards compatibility) which detects if the fitness value is > unchanging of a > specified number of iterations. Also I built in the ability to adjust the > sensitivity, through > number of decimal places (although arguably this should be implemented as > significant figures) > as well as allowing the opportunity to set a 'burn in' time before which > the optimisation doesn't > check for 'plateaus'. > > >

Message body is not shown because sender requested not to inline it.

Added plateau early exit code provided by Kevin Balbi. Note that the module has changed name to AI::ParticleSwarmOptimization.
Hi Peter, Sorry for not getting back to you sooner. I've just downloaded the new code and put it through some tests and it seems to be working fine. The only slight problem is that on line 116, or thereabouts, there is a print command which outputs the random number generated within 'init' regardless of the verbosity options. Cheers, Kevin On Sat Sep 10 04:21:49 2011, peter.jaquiery@ihug.co.nz wrote: Show quoted text
> Hi Kevin, > > I've just uploaded version 1.004 of AI::ParticleSwarmOptimization > (note the > name change) containing your plateau early exit code. Note that I've > made > the mean calculation faster and less memory hungry by using a circular > queue. > > If you have the chance to check the changes and see that it works as > you > expected I'd appreciate it.I've attached the module in case you get a > chance > to look at it before the new version turns up on CPAN. > > If you are happy with the code let me know and I'll close the bug. > > Cheers, > Peter Jaquiery > > ----- Original Message ----- > From: "Kevin Balbi via RT" <bug-AI-PSO-OO@rt.cpan.org> > To: <undisclosed-recipients:> > Sent: Thursday, September 08, 2011 3:30 AM > Subject: [rt.cpan.org #70790] Detection of 'best' Best-Fit before the > optimisation completes > >
> > Wed Sep 07 11:30:06 2011: Request 70790 was acted upon. > > Transaction: Ticket created by KBALBI > > Queue: AI-PSO-OO > > Subject: Detection of 'best' Best-Fit before the optimisation > > completes > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: KBALBI@cpan.org > > Status: patched > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=70790 > > > > > > > I needed the ability to detect if the 'optimum' had been reached
> before
> > the number of iterations > > had completed. > > > > I have attached a version of the module in which I've implemented
> this
> > option (disabled by > > default for backwards compatibility) which detects if the fitness
> value is
> > unchanging of a > > specified number of iterations. Also I built in the ability to
> adjust the
> > sensitivity, through > > number of decimal places (although arguably this should be
> implemented as
> > significant figures) > > as well as allowing the opportunity to set a 'burn in' time before
> which
> > the optimisation doesn't > > check for 'plateaus'. > > > > > >
Hi Peter, On further testing, I've noticed that there's another small problem, specifically with the rounding on line 247 - if $self->{bestBest} is undefined then sprintf gives an error. I've attached a workaround, just some reordering the commands which seems to have fixed things. Cheers, Kevin
Subject: updated _swarm.pm
Version 1.005 uploaded to CPAN to fix undef issue and remove bogus print left in after development testing.