Changeset 155
- Timestamp:
- 07/26/09 14:02:38 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alta/mystic-0.1a2/mystic/snobfit_solver.py
r151 r155 79 79 """Snobfit optimization. """ 80 80 81 def __init__(self, dim , NP):81 def __init__(self, dim): 82 82 """ 83 83 Takes two initial inputs: 84 84 dim -- dimensionality of the problem 85 NP -- size of the trial solution population. NP should be 86 len(x0) + numpy.maximum(dn, len(x0)/2) + 1 87 where len(x0) = dim, and dn is number of extra 88 data points (default dn= 5) 89 """ 90 91 AbstractSolver.__init__(self,dim, npop=NP) 85 """ 86 87 AbstractSolver.__init__(self,dim) 92 88 93 89 … … 163 159 numpy.random.seed( [seed] ) 164 160 161 # Adjust if dn was passed as a parameter to Solve() 162 adjusted_dn = numpy.maximum(dn, self.nDim/2) 163 self.nPop = self.nDim/2 + adjusted_dn + 1 164 165 165 # The number of safeguarded nearest neighbors 166 166 self.snn = self.nPop - 1 … … 171 171 # Other initializations 172 172 self.x = self._setInitRecommendedEvalPoints( x0 ) 173 #self.x = numpy.asfarray(self.population)174 173 (self.f, self.df) = self._setInitial_fdf(func) 175 174 self.nx = self.x.shape[0] … … 2466 2465 from mystic.termination import SnobfitTermination 2467 2466 2468 adjusted_dn = numpy.maximum(dn, len(x0)/2) 2469 solver = SnobfitSolver(len(x0), len(x0)+adjusted_dn+1) 2467 solver = SnobfitSolver(len(x0)) 2470 2468 solver.SetInitialPoints(x0) 2471 2469 solver.enable_signal_handler()
Note: See TracChangeset
for help on using the changeset viewer.