Changeset 676 for branches


Ignore:
Timestamp:
06/04/13 11:04:45 (3 years ago)
Author:
mmckerns
Message:

fix: fixed typo in save state for nested optimizers;
updated UQ 'examples' optimizers to use dill and mystic.math functions

Location:
branches/UQ/math/examples
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/UQ/math/examples/MM_surrogate_diam.py

    r675 r676  
    6565  from mystic.strategy import Best1Exp 
    6666  from mystic.monitors import VerboseMonitor, Monitor 
    67   from mystic.tools import getch, random_seed 
     67  from mystic.tools import random_seed 
    6868 
    6969  random_seed(123) 
  • branches/UQ/math/examples/MPI2_helper.py

    r471 r676  
    1010 
    1111 
    12  
    13 def func_pickle(func, suffix='.pik'): 
     12def func_pickle(func, suffix='.pik', dir='.'): 
    1413    """ standard pickle.dump of function to a NamedTemporaryFile """ 
    15     import dill as pickle 
    16     import tempfile 
    17     file = tempfile.NamedTemporaryFile(suffix=suffix, dir='.') 
    18     pickle.dump(func, file) 
    19     file.flush() 
    20     return file 
    21  
    22  
    23 from numpy import asarray 
    24  
    25 def ndim_meshgrid(*arrs): 
    26     """n-dimensional analogue to numpy.meshgrid""" 
    27     arrs = tuple(reversed(arrs))  #edit 
    28     lens = map(len, arrs) 
    29     dim = len(arrs) 
    30  
    31     sz = 1 
    32     for s in lens: 
    33         sz*=s 
    34  
    35     ans = []     
    36     for i, arr in enumerate(arrs): 
    37         slc = [1]*dim 
    38         slc[i] = lens[i] 
    39         arr2 = asarray(arr).reshape(slc) 
    40         for j, sz in enumerate(lens): 
    41             if j!=i: 
    42                 arr2 = arr2.repeat(sz, axis=j)  
    43         ans.append(arr2) 
    44  
    45     return tuple(ans) 
    46  
    47  
    48 def gridpts(q): 
    49     """ 
    50 takes a list of lists of equal length q = [[1,2],[3,4]] 
    51 and produces a list of gridpoints g = [[1,3],[1,4],[2,3],[2,4]] 
    52     """ 
    53     q = list(reversed(q)) 
    54     w = ndim_meshgrid(*q) 
    55     for i in range(len(q)): 
    56         q[i] = list( w[i].reshape(w[i].size) ) 
    57     q = zip(*q) 
    58     return [list(i) for i in q] 
     14    from dill.temp import dump 
     15    return dump(func, suffix=suffix, dir=dir) 
    5916 
    6017 
     
    6623  from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    6724  from mystic.monitors import VerboseMonitor, Monitor 
    68   from mystic.tools import getch 
    6925 
    7026  maxiter = 1000 
  • branches/UQ/math/examples/MPI2_surrogate_diam_batchgrid.py

    r675 r676  
    7272 
    7373  # build a grid of starting points 
    74   from MPI2_helper import gridpts, local_optimize 
     74  from MPI2_helper import local_optimize 
     75  from mystic.math.grid import gridpts 
    7576  initial_values = gridpts(bins) 
    7677 
  • branches/UQ/math/examples/MPI_surrogate_diam.py

    r675 r676  
    6565  from mystic.strategy import Best1Exp 
    6666  from mystic.monitors import VerboseMonitor, Monitor 
    67   from mystic.tools import getch, random_seed 
     67  from mystic.tools import random_seed 
    6868 
    6969  random_seed(123) 
  • branches/UQ/math/examples/MPI_surrogate_diam_batchgrid.py

    r675 r676  
    11#!/usr/bin/env python 
    22 
    3 def func_pickle(func, suffix='.pik'): 
     3def func_pickle(func, suffix='.pik', dir='.'): 
    44    """ standard pickle.dump of function to a NamedTemporaryFile """ 
    5     import dill as pickle 
    6     import tempfile 
    7     file = tempfile.NamedTemporaryFile(suffix=suffix, dir='.') 
    8     pickle.dump(func, file) 
    9     file.flush() 
    10     return file 
    11  
    12  
    13 from numpy import asarray 
    14  
    15 def ndim_meshgrid(*arrs): 
    16     """n-dimensional analogue to numpy.meshgrid""" 
    17     arrs = tuple(reversed(arrs))  #edit 
    18     lens = map(len, arrs) 
    19     dim = len(arrs) 
    20  
    21     sz = 1 
    22     for s in lens: 
    23         sz*=s 
    24  
    25     ans = []     
    26     for i, arr in enumerate(arrs): 
    27         slc = [1]*dim 
    28         slc[i] = lens[i] 
    29         arr2 = asarray(arr).reshape(slc) 
    30         for j, sz in enumerate(lens): 
    31             if j!=i: 
    32                 arr2 = arr2.repeat(sz, axis=j)  
    33         ans.append(arr2) 
    34  
    35     return tuple(ans) 
    36  
    37  
    38 def gridpts(q): 
    39     """ 
    40 takes a list of lists of equal length q = [[1,2],[3,4]] 
    41 and produces a list of gridpoints g = [[1,3],[1,4],[2,3],[2,4]] 
    42     """ 
    43     q = list(reversed(q)) 
    44     w = ndim_meshgrid(*q) 
    45     for i in range(len(q)): 
    46         q[i] = list( w[i].reshape(w[i].size) ) 
    47     q = zip(*q) 
    48     return [list(i) for i in q] 
     5    from dill.temp import dump 
     6    return dump(func, suffix=suffix, dir=dir) 
     7 
     8from mystic.math.grid import gridpts 
    499 
    5010 
     
    11474  from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    11575  from mystic.monitors import VerboseMonitor, Monitor 
    116   from mystic.tools import getch 
    11776 
    11877  maxiter = 1000 
  • branches/UQ/math/examples/MPI_surrogate_diam_scatter.py

    r675 r676  
    11#!/usr/bin/env python 
    22 
    3 def func_pickle(func, suffix='.pik'): 
     3def func_pickle(func, suffix='.pik', dir='.'): 
    44    """ standard pickle.dump of function to a NamedTemporaryFile """ 
    5     import dill as pickle 
    6     import tempfile 
    7     file = tempfile.NamedTemporaryFile(suffix=suffix, dir='.') 
    8     pickle.dump(func, file) 
    9     file.flush() 
    10     return file 
    11  
    12  
    13 def random_samples(lb,ub,npts=10000): 
    14   "generate npts random samples between given lb & ub" 
    15   from numpy.random import random 
    16   dim = len(lb) 
    17   pts = random((dim,npts)) 
    18   for i in range(dim): 
    19     pts[i] = (pts[i] * abs(ub[i] - lb[i])) + lb[i] 
    20   return pts 
    21  
    22  
    23 def samplepts(lb,ub,npts): 
    24     """ 
    25 takes upper and lower bounds (e.g. ub = [2,4], lb = [0,3]) 
    26 produces a list of sample points s = [[1,3],[1,4],[2,3],[2,4]] 
    27     """ 
    28     q = random_samples(lb,ub,npts) 
    29     q = [list(i) for i in q] 
    30     q = zip(*q) 
    31     return [list(i) for i in q] 
     5    from dill.temp import dump 
     6    return dump(func, suffix=suffix, dir=dir) 
     7 
     8from mystic.math.grid import samplepts 
    329 
    3310 
     
    9774  from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    9875  from mystic.monitors import VerboseMonitor, Monitor 
    99   from mystic.tools import getch 
    10076 
    10177  maxiter = 1000 
  • branches/UQ/math/examples/MSUB_surrogate_diam_batchgrid.py

    r675 r676  
    11#!/usr/bin/env python 
    22 
    3 def func_pickle(func, suffix='.pik'): 
     3def func_pickle(func, suffix='.pik', dir='.'): 
    44    """ standard pickle.dump of function to a NamedTemporaryFile """ 
    5     import dill as pickle 
    6     import tempfile 
    7     file = tempfile.NamedTemporaryFile(suffix=suffix, dir='.') 
    8     pickle.dump(func, file) 
    9     file.flush() 
    10     return file 
    11  
    12  
    13 from numpy import asarray 
    14  
    15 def ndim_meshgrid(*arrs): 
    16     """n-dimensional analogue to numpy.meshgrid""" 
    17     arrs = tuple(reversed(arrs))  #edit 
    18     lens = map(len, arrs) 
    19     dim = len(arrs) 
    20  
    21     sz = 1 
    22     for s in lens: 
    23         sz*=s 
    24  
    25     ans = []     
    26     for i, arr in enumerate(arrs): 
    27         slc = [1]*dim 
    28         slc[i] = lens[i] 
    29         arr2 = asarray(arr).reshape(slc) 
    30         for j, sz in enumerate(lens): 
    31             if j!=i: 
    32                 arr2 = arr2.repeat(sz, axis=j)  
    33         ans.append(arr2) 
    34  
    35     return tuple(ans) 
    36  
    37  
    38 def gridpts(q): 
    39     """ 
    40 takes a list of lists of equal length q = [[1,2],[3,4]] 
    41 and produces a list of gridpoints g = [[1,3],[1,4],[2,3],[2,4]] 
    42     """ 
    43     q = list(reversed(q)) 
    44     w = ndim_meshgrid(*q) 
    45     for i in range(len(q)): 
    46         q[i] = list( w[i].reshape(w[i].size) ) 
    47     q = zip(*q) 
    48     return [list(i) for i in q] 
     5    from dill.temp import dump 
     6    return dump(func, suffix=suffix, dir=dir) 
     7 
     8from mystic.math.grid import gridpts 
    499 
    5010 
  • branches/UQ/math/examples/QSUB2_surrogate_diam_batchgrid.py

    r675 r676  
    7272 
    7373  # build a grid of starting points 
    74   from MPI2_helper import gridpts, local_optimize 
     74  from mystic.math.grid import gridpts 
     75  from MPI2_helper import local_optimize 
    7576  from MPI2_helper import nnodes, queue, timelimit 
    7677  initial_values = gridpts(bins) 
  • branches/UQ/math/examples/QSUB_surrogate_diam_batchgrid.py

    r675 r676  
    11#!/usr/bin/env python 
    22 
    3 def func_pickle(func, suffix='.pik'): 
     3def func_pickle(func, suffix='.pik', dir='.'): 
    44    """ standard pickle.dump of function to a NamedTemporaryFile """ 
    5     import dill as pickle 
    6     import tempfile 
    7     file = tempfile.NamedTemporaryFile(suffix=suffix, dir='.') 
    8     pickle.dump(func, file) 
    9     file.flush() 
    10     return file 
    11  
    12  
    13 from numpy import asarray 
    14  
    15 def ndim_meshgrid(*arrs): 
    16     """n-dimensional analogue to numpy.meshgrid""" 
    17     arrs = tuple(reversed(arrs))  #edit 
    18     lens = map(len, arrs) 
    19     dim = len(arrs) 
    20  
    21     sz = 1 
    22     for s in lens: 
    23         sz*=s 
    24  
    25     ans = []     
    26     for i, arr in enumerate(arrs): 
    27         slc = [1]*dim 
    28         slc[i] = lens[i] 
    29         arr2 = asarray(arr).reshape(slc) 
    30         for j, sz in enumerate(lens): 
    31             if j!=i: 
    32                 arr2 = arr2.repeat(sz, axis=j)  
    33         ans.append(arr2) 
    34  
    35     return tuple(ans) 
    36  
    37  
    38 def gridpts(q): 
    39     """ 
    40 takes a list of lists of equal length q = [[1,2],[3,4]] 
    41 and produces a list of gridpoints g = [[1,3],[1,4],[2,3],[2,4]] 
    42     """ 
    43     q = list(reversed(q)) 
    44     w = ndim_meshgrid(*q) 
    45     for i in range(len(q)): 
    46         q[i] = list( w[i].reshape(w[i].size) ) 
    47     q = zip(*q) 
    48     return [list(i) for i in q] 
     5    from dill.temp import dump 
     6    return dump(func, suffix=suffix, dir=dir) 
     7 
     8from mystic.math.grid import gridpts 
    499 
    5010 
     
    11878  from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    11979  from mystic.monitors import VerboseMonitor, Monitor 
    120   from mystic.tools import getch 
    12180 
    12281  maxiter = 1000 
  • branches/UQ/math/examples/TEST_surrogate_McD.py

    r471 r676  
    6666  from mystic.strategy import Best1Exp 
    6767  from mystic.monitors import VerboseMonitor, Monitor 
    68   from mystic.tools import getch, random_seed 
     68  from mystic.tools import random_seed 
    6969 
    7070  random_seed(123) 
     
    128128# probability mass, expectation, mean, diameter, McDiarmid 
    129129####################################################################### 
    130 def volume(lb,ub): 
    131   """volume for a uniform distribution in n-dimensions""" 
    132   vol = 1 
    133   for i in range(len(ub)): 
    134     vol *= abs(ub[i] - lb[i]) 
    135   return vol 
    136  
    137 def prob_mass(volume,norm): 
    138   """probability mass ...""" 
    139   return volume / norm  #XXX: norm != 0 
    140  
    141 from scipy.integrate import quad, dblquad, tplquad 
    142 def expectation_value(f,lb,ub):  #XXX: should be generalized to n-dimensions 
    143   """expectation value for an n-dimensional function; n in [1,2,3]""" 
    144   if len(lb) == 3: 
    145     def func(z,y,x): return f([x,y,z]) 
    146     def qf(x,y): return lb[2] 
    147     def rf(x,y): return ub[2] 
    148     def gf(x): return lb[1] 
    149     def hf(x): return ub[1] 
    150     expectation,confidence = tplquad(func,lb[0],ub[0],gf,hf,qf,rf) 
    151     return expectation 
    152   if len(lb) == 2: 
    153     def func(y,x): return f([x,y]) 
    154     def gf(x): return lb[1] 
    155     def hf(x): return ub[1] 
    156     expectation,confidence = dblquad(func,lb[0],ub[0],gf,hf) 
    157     return expectation  
    158   if len(lb) == 1: 
    159     expectation,confidence = quad(f,lb[0],ub[0]) 
    160     return expectation  
    161  #raise Exception, "Function must be either 1-D, 2-D, or 3-D" 
    162  #### FIXME: instead of exception above, use hack for > 3D 
    163   print "WARNING: Dimensions > 3-D are assumed as constant at lower bound" 
    164   def func(z,y,x): return f([x,y,z]+lb[3:]) 
    165   def qf(x,y): return lb[2] 
    166   def rf(x,y): return ub[2] 
    167   def gf(x): return lb[1] 
    168   def hf(x): return ub[1] 
    169   expectation,confidence = tplquad(func,lb[0],ub[0],gf,hf,qf,rf) 
    170   return expectation 
    171  #### END HACK 
    172  
    173 def mean(expectation,volume): 
    174   """mean ...""" 
    175   return expectation / volume  #XXX: volume != 0 
    176  
    177 def mcdiarmid_bound(mean,diameter): 
    178   """McDiarmid ...""" 
    179   from math import exp 
    180   if not diameter: return 1.0  #XXX: define e^(0/0) = 1 
    181   return exp(-2.0 * (max(0,mean))**2 / diameter**2) 
     130from mystic.math.stats import volume, prob_mass, mean, mcdiarmid_bound 
     131from mystic.math.integrate import integrate as expectation_value 
    182132 
    183133 
  • branches/UQ/math/examples/TEST_surrogate_cut.py

    r471 r676  
    77# (similar to concentration.in) 
    88####################################################################### 
    9 from TEST_surrogate_McD import volume, prob_mass 
    10 from TEST_surrogate_McD import expectation_value, mean, mcdiarmid_bound 
    119from TEST_surrogate_diam import *  # model, limit 
    12  
    13 def sample(f,lb,ub,npts=10000): 
    14   from numpy.random import random 
    15   pts = random((3,npts)) 
    16   for i in range(3): 
    17     pts[i] = (pts[i] * abs(ub[i] - lb[i])) + lb[i] 
    18  
    19   failure = 0; success = 0 
    20   for i in range(npts): 
    21     if f([pts[0][i],pts[1][i],pts[2][i]]): 
    22       success += 1 
    23     else: 
    24       failure += 1 
    25   return failure,success 
     10from mystic.math.stats import volume, prob_mass, mean, mcdiarmid_bound 
     11from mystic.math.integrate import integrate as expectation_value 
     12from mystic.math.samples import sample 
    2613 
    2714 
     
    3522  from mystic.strategy import Best1Exp 
    3623  from mystic.monitors import VerboseMonitor, Monitor 
    37   from mystic.tools import getch, random_seed 
     24  from mystic.tools import random_seed 
    3825 
    3926  random_seed(123) 
  • branches/UQ/math/examples/TEST_surrogate_diam.py

    r471 r676  
    6363  from mystic.strategy import Best1Exp 
    6464  from mystic.monitors import VerboseMonitor, Monitor 
    65   from mystic.tools import getch, random_seed 
     65  from mystic.tools import random_seed 
    6666 
    6767  random_seed(123) 
  • branches/UQ/math/examples/TEST_surrogate_diam_batchgrid.py

    r471 r676  
    11#!/usr/bin/env python 
    22 
    3 from numpy import asarray 
    4  
    5 def ndim_meshgrid(*arrs): 
    6     """n-dimensional analogue to numpy.meshgrid""" 
    7     arrs = tuple(reversed(arrs))  #edit 
    8     lens = map(len, arrs) 
    9     dim = len(arrs) 
    10  
    11     sz = 1 
    12     for s in lens: 
    13         sz*=s 
    14  
    15     ans = []     
    16     for i, arr in enumerate(arrs): 
    17         slc = [1]*dim 
    18         slc[i] = lens[i] 
    19         arr2 = asarray(arr).reshape(slc) 
    20         for j, sz in enumerate(lens): 
    21             if j!=i: 
    22                 arr2 = arr2.repeat(sz, axis=j)  
    23         ans.append(arr2) 
    24  
    25     return tuple(ans) 
    26  
    27  
    28 def gridpts(q): 
    29     """ 
    30 takes a list of lists of equal length q = [[1,2],[3,4]] 
    31 and produces a list of gridpoints g = [[1,3],[1,4],[2,3],[2,4]] 
    32     """ 
    33     q = list(reversed(q)) 
    34     w = ndim_meshgrid(*q) 
    35     for i in range(len(q)): 
    36         q[i] = list( w[i].reshape(w[i].size) ) 
    37     q = zip(*q) 
    38     return [list(i) for i in q] 
     3from mystic.math.grid import gridpts 
    394 
    405 
     
    9964  from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    10065  from mystic.monitors import VerboseMonitor, Monitor 
    101   from mystic.tools import getch 
    10266 
    10367 #stepmon = VerboseMonitor(100) 
  • branches/UQ/math/examples/TEST_surrogate_diam_scatter.py

    r471 r676  
    11#!/usr/bin/env python 
    22 
    3 def random_samples(lb,ub,npts=10000): 
    4   "generate npts random samples between given lb & ub" 
    5   from numpy.random import random 
    6   dim = len(lb) 
    7   pts = random((dim,npts)) 
    8   for i in range(dim): 
    9     pts[i] = (pts[i] * abs(ub[i] - lb[i])) + lb[i] 
    10   return pts 
    11  
    12  
    13 def samplepts(lb,ub,npts): 
    14     """ 
    15 takes upper and lower bounds (e.g. ub = [2,4], lb = [0,3]) 
    16 produces a list of sample points s = [[1,3],[1,4],[2,3],[2,4]] 
    17     """ 
    18     q = random_samples(lb,ub,npts) 
    19     q = [list(i) for i in q] 
    20     q = zip(*q) 
    21     return [list(i) for i in q] 
     3from mystic.math.grid import samplepts 
    224 
    235 
     
    8264  from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    8365  from mystic.monitors import VerboseMonitor, Monitor 
    84   from mystic.tools import getch 
    8566 
    8667 #stepmon = VerboseMonitor(100) 
  • branches/UQ/math/examples/TEST_surrogate_samples.py

    r471 r676  
    99# (similar to concentration.in) 
    1010####################################################################### 
    11 from TEST_surrogate_McD import volume, prob_mass 
    12 from TEST_surrogate_McD import expectation_value, mean, mcdiarmid_bound 
    1311from TEST_surrogate_diam import *  # model, limit 
    14  
    15 def random_samples(lb,ub,npts=10000): 
    16   "generate npts random samples between given lb & ub" 
    17   from numpy.random import random 
    18   dim = len(lb) 
    19   pts = random((dim,npts)) 
    20   for i in range(dim): 
    21     pts[i] = (pts[i] * abs(ub[i] - lb[i])) + lb[i] 
    22   return pts 
    23  
    24  
    25 def sampled_pof(f,pts): 
    26   "use sampling to calculate 'exact' PoF" 
    27   failure = 0 
    28   for i in range(len(pts[0])): 
    29     Fx = f([pts[0][i],pts[1][i],pts[2][i]]) 
    30     if not Fx: 
    31       failure += 1 
    32   pof = float(failure) / float(len(pts[0])) 
    33   return pof 
    34  
    35  
    36 def sampled_pts(pts,lb,ub): 
    37   from numpy import inf 
    38   def identity(x): 
    39     return x 
    40   f = wrap_bounds(identity,lb,ub) 
    41   npts = 0 
    42   for i in range(len(pts[0])): 
    43     Fx = f([pts[0][i],pts[1][i],pts[2][i]]) 
    44     if Fx != -inf: # outside of bounds evaluates to -inf 
    45       npts += 1 
    46   return npts 
    47  
    48  
    49 def sampled_prob(pts,lb,ub): 
    50   prob = float(sampled_pts(pts,lb,ub)) / float(len(pts[0])) 
    51   return prob 
    52  
     12from mystic.math.stats import volume, prob_mass, mean, mcdiarmid_bound 
     13from mystic.math.integrate import integrate as expectation_value 
     14from mystic.math.samples import random_samples, sampled_pts, sampled_prob 
     15from mystic.math.samples import alpha, _pof_given_samples as sampled_pof 
     16from mystic.tools import wrap_bounds 
    5317 
    5418def sampled_mean(pts,lb,ub): 
     
    6529  return ave 
    6630 
    67  
    68 def wrap_bounds(f,lb,ub): 
    69   from numpy import asarray, any, inf 
    70   lb = asarray(lb)  
    71   ub = asarray(ub)  
    72   def function_wrapper(x): #x bounded on [lb,ub) 
    73     if any((x < lb) | (x >= ub)): #if violates bounds, evaluate as -inf 
    74       return -inf 
    75     return f(x) 
    76   return function_wrapper 
    77  
    78  
    7931def minF(x): 
    8032  return scale * model(x) 
    8133 
    82  
    8334def maxF(x): 
    8435  return -scale * model(x) 
    85  
    86  
    87 from math import log 
    88 def alpha(n,diameter,epsilon=0.01): 
    89  #return diameter * n**(-0.5) * (-log(epsilon))**(0.5) 
    90   return diameter * (-log(epsilon) / (2.0 * n))**(0.5) 
    9136 
    9237 
     
    10045  from mystic.strategy import Best1Exp 
    10146  from mystic.monitors import VerboseMonitor, Monitor 
    102   from mystic.tools import getch, random_seed 
     47  from mystic.tools import random_seed 
    10348 
    10449  random_seed(123) 
  • branches/UQ/math/examples/TEST_surrogate_smartcut.py

    r471 r676  
    88# (similar to concentration.in) 
    99####################################################################### 
    10 from TEST_surrogate_McD import volume, prob_mass 
    11 from TEST_surrogate_McD import expectation_value, mean, mcdiarmid_bound 
    1210from TEST_surrogate_diam import *  # model, limit 
    13  
    14 def random_samples(lb,ub,npts): 
    15   "generate npts random samples between given lb & ub" 
    16   from numpy.random import random 
    17   dim = len(lb) 
    18   pts = random((dim,npts)) 
    19   for i in range(dim): 
    20     pts[i] = (pts[i] * abs(ub[i] - lb[i])) + lb[i] 
    21   return pts 
    22  
    23  
    24 def sampled_pof(f,lb,ub,npts=10000): 
    25   "use sampling to calculate 'exact' PoF" 
    26   pts = random_samples(lb,ub,npts) 
    27   failure = 0 
    28   for i in range(npts): 
    29     if not f([pts[0][i],pts[1][i],pts[2][i]]): 
    30       failure += 1 
    31   pof = float(failure) / float(npts) 
    32   return pof 
    33  
     11from mystic.math.stats import volume, prob_mass, mean, mcdiarmid_bound 
     12from mystic.math.integrate import integrate as expectation_value 
     13from mystic.math.samples import sampled_pof 
    3414 
    3515def minF(x): 
    3616  return scale * model(x) 
    37  
    3817 
    3918def maxF(x): 
     
    5029  from mystic.strategy import Best1Exp 
    5130  from mystic.monitors import VerboseMonitor, Monitor 
    52   from mystic.tools import getch, random_seed 
     31  from mystic.tools import random_seed 
    5332 
    5433  random_seed(123) 
Note: See TracChangeset for help on using the changeset viewer.