[Scipy-tickets] [SciPy] #875: A large number of parameters causes update_guess in class simple_sa to run for a very long time.
SciPy
scipy-tickets@scipy....
Thu Feb 26 15:25:03 CST 2009
#875: A large number of parameters causes update_guess in class simple_sa to run
for a very long time.
----------------------+-----------------------------------------------------
Reporter: jimshain | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 0.8.0
Component: Other | Version: none
Severity: normal | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Comment (by jimshain):
I should have added the following:
- The problem is in anneal.py starting at line 151.[[BR]]
- This is the section of code with the problem:[[BR]]
{{{
def update_guess(self, x0):
x0 = asarray(x0)
T = self.T
myFlag=True
while myFlag:
u = squeeze(random.uniform(0.0, 1.0, size=self.dims))
y = sign(u-0.5)*T*((1+1.0/T)**abs(2*u-1)-1.0)
xc = y*(self.upper - self.lower)
xt=x0+xc
indu=where(xt>self.upper) # find where it goes above the upper
bounds
indl=where(xt<self.lower) # below the lower bounds
if ((indu[0].size==0) & (indl[0].size==0)):
myFlag=False #if it goes out of the box, try a new
guess
# restart
xnew = xt
return xnew
}}}
--
Ticket URL: <http://scipy.org/scipy/scipy/ticket/875#comment:1>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list