Ignore:
Timestamp:
Jul 12, 2017 3:54:39 PM (4 years ago)
Author:
vondreele
Message:

tweaks of basinhopping
replace more TextCtrl? with ValidatedTxtCtrl? in phaseGUI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIImath.py

    r2927 r2930  
    45554555   
    45564556    def MCSAcallback(x, f, fmin,accept):
    4557         return not pgbar.Update(min(100.,fmin*1000),
    4558             newmsg='%s%8.4f%s'%('MC/SA Residual:',fmin*1000,'%'))[0]
    4559            
     4557        return not pgbar.Update(min(100.,fmin*100),
     4558            newmsg='%s%8.4f%s'%('MC/SA Residual:',fmin*100,'%'))[0]
    45604559
    45614560    sq8ln2 = np.sqrt(8*np.log(2))
     
    46914690    x0 = [parmDict[val] for val in varyList]
    46924691    ifInv = SGData['SGInv']
    4693     # consider replacing anneal with scipy.optimize.basinhopping
    46944692    if MCSA['Algorithm'] == 'Basin Hopping':
    46954693        import basinhopping as bs
    46964694        bounds = np.array(zip(lower,upper))
    46974695        take_step = RandomDisplacementBounds(np.array(lower), np.array(upper))
    4698         results = bs.basinhopping(mcsaCalc,x0,take_step=take_step,disp=True,T=MCSA['Annealing'][0],stepsize=0.1,
    4699                 interval=20,niter=MCSA['Annealing'][2],minimizer_kwargs={'method':'L-BFGS-B','bounds':bounds,
     4696        results = bs.basinhopping(mcsaCalc,x0,take_step=take_step,disp=True,T=MCSA['Annealing'][0],
     4697                interval=MCSA['Annealing'][2]/5,niter=MCSA['Annealing'][2],minimizer_kwargs={'method':'L-BFGS-B','bounds':bounds,
    47004698                'args':(refs,rcov,cosTable,ifInv,allFF,RBdata,varyList,parmDict)},callback=MCSAcallback)
    47014699        mcsaCalc(results['x'],refs,rcov,cosTable,ifInv,allFF,RBdata,varyList,parmDict)
Note: See TracChangeset for help on using the changeset viewer.