[SciPy-User] Parameter for simulated annealing

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Jan 10 23:07:03 EST 2011


On Mon, Jan 10, 2011 at 9:39 PM, Charles R Harris
<charlesr.harris at gmail.com> wrote:
>
>
> On Mon, Jan 10, 2011 at 3:25 PM, scipy.optimize
> <scipy.optimize at googlemail.com> wrote:
>>
>> To whom it may concern,
>>
>> I am trying to find good settings for simulated annealing. But at the
>> moment I fail. The fmin-optimizer is working properly but he does not find
>> the global minimum. No big surprise.
>>
>> My problem:
>> I have 6 Variables. 4 of them should be between -0.05 and 0.05 and 2 of
>> them between -45 and 45. I normalize them so they are all around -0.1 to
>> 0.1.
>> The target function should be 1. I have implemented constraints by adding
>> a 10 to my target function if one of my variables are beyond their range.
>> But the simulated annealing does not respect the constraints. Most of my
>> iterations it tried to find a value out of my given range.
>>
>> What I have done:
>> I vary 2 parameter: dwell and T0
>> dwell from 50 to 1000
>> T0 from 0.2 to 1.2
>> And this with the 3 different models (anneal_boltzman, anneal_cauchy and
>> anneal_fast).
>>
>> When I have T0=0.2 and dwell=100 the computing range simulated annealing
>> is trying is about -0.08 to 0.08. This was my best result. When I raise T0
>> and dwell the range grow. But even after 600 iteration there is not a trend
>> to see.
>> I have computed nearly 20 variations of these parameter but I could not
>> find a big sensitivity.
>>
>> The variation was basically blind because I have no exactly idea what
>> these 2 parameter stands for. I have read the manuals up and down.
>>
>> Can anyone give me an approximate range in which I should search my
>> perfect parameter for dwell and T0? The best thing would be, when I can make
>> a rough estimate of my minimum with the simulated annealing and after this I
>> would run the fmin-optimizer. Because the biggest problem is that 1
>> computing (1 iteration) takes about 1h. So If I can separate the search I
>> can save much time. (I have a testmodus in which 1 Iteration takes about
>> 15min.)
>>
>> I hope someone can help me. Anyway, thanks for your help.

I think "upper" and "lower" are set too high for your problem, new
points are evaluated with a change for up to +/1 100 which is too
large of your parameters are in the range -0.1, 0.1

upper and lower are the only parameters I looked at, all the other
ones are more difficult to figure out.
I haven't seen any documentation, there is only the source. I never
tried to plot the distribution for new random draws, and I don't know
how concentrated they are.

One useful way of debugging is to save all parameter values that are
tried out from your objective function to a global variable or print
them out to see whether they are in a reasonable range for your
example.

If you expect your parameters to be in the range -0.1, 0.1 (if I
understand correctly), then I would try setting lower=-0.1 or -0.05
and upper the same but positive.

Just some thoughts when I was playing with it, I haven't seen any good
explanations on the mailing list (yet).

Josef


>>
>
> I also hope someone has a good answer because my experience is that
> simulated annealing is rather sensitive to the choice of parameters. When it
> works, it's great, but genetic algorithms tend to be more robust.
>
> Chuck
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>



More information about the SciPy-User mailing list