diff options
| author | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-11 21:27:14 -0400 |
|---|---|---|
| committer | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-11 21:27:14 -0400 |
| commit | 1143cf60812c37957c81d39d6180921460e62901 (patch) | |
| tree | 5231b7fe4f3e27d00072d652297208660e47bb5a /experiments | |
| parent | 18aa2dd933f4c76ebd374b42fa10d0067870f135 (diff) | |
| download | criminal_cascades-1143cf60812c37957c81d39d6180921460e62901.tar.gz | |
started adding weights into edge probabilities
Diffstat (limited to 'experiments')
| -rw-r--r-- | experiments/build/temp.macosx-10.6-x86_64-2.7/ml.o | bin | 308728 -> 308424 bytes | |||
| -rw-r--r-- | experiments/build_network.py | 4 | ||||
| -rw-r--r-- | experiments/ml.c | 545 | ||||
| -rw-r--r-- | experiments/ml.pyx | 2 | ||||
| -rwxr-xr-x | experiments/ml.so | bin | 109612 -> 109500 bytes | |||
| -rw-r--r-- | experiments/out.log | 483 | ||||
| -rw-r--r-- | experiments/process.py | 12 |
7 files changed, 768 insertions, 278 deletions
diff --git a/experiments/build/temp.macosx-10.6-x86_64-2.7/ml.o b/experiments/build/temp.macosx-10.6-x86_64-2.7/ml.o Binary files differindex 5fbcfe9..51e37b0 100644 --- a/experiments/build/temp.macosx-10.6-x86_64-2.7/ml.o +++ b/experiments/build/temp.macosx-10.6-x86_64-2.7/ml.o diff --git a/experiments/build_network.py b/experiments/build_network.py index 17c8bb5..47f657b 100644 --- a/experiments/build_network.py +++ b/experiments/build_network.py @@ -13,9 +13,7 @@ def build_network(filename): for row in reader: from_, to = int(float(row["from"])), int(float(row["to"])) dist = int(row["dist"]) - w1 = int(row["w1"]) - w2 = int(row["w2"]) if dist>1 else float(row["w2"]) - w3 = int(row["w3"]) if dist>2 else float(row["w3"]) + w1, w2, w3 = float(row["w1"]), float(row["w2"]), float(row["w3"]) if int(float(row["dist"])) > 2: continue # 'to' is a victim diff --git a/experiments/ml.c b/experiments/ml.c index 1ae9098..d8318de 100644 --- a/experiments/ml.c +++ b/experiments/ml.c @@ -695,7 +695,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; * DTYPE = np.float64 * ctypedef np.float_t DTYPE_t # <<<<<<<<<<<<<< * - * + * cdef DTYPE_t plogis(DTYPE_t weight, DTYPE_t delta): */ typedef __pyx_t_5numpy_float_t __pyx_t_2ml_DTYPE_t; #if CYTHON_CCOMPLEX @@ -759,7 +759,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; */ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "ml.pyx":50 +/* "ml.pyx":52 * return result * * def ml(dict root_victims, dict victims, dict non_victims, DTYPE_t age, # <<<<<<<<<<<<<< @@ -773,7 +773,7 @@ struct __pyx_obj_2ml___pyx_scope_struct__ml { }; -/* "ml.pyx":74 +/* "ml.pyx":76 * for (dist, dt, w1, w2, w3) in parents] * # find parent that maximizes p/\tilde{p} * probs[i] = max(s - failures[l] for l, s in enumerate(successes)) # <<<<<<<<<<<<<< @@ -1422,8 +1422,45 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_codeobj__9; -/* "ml.pyx":10 +/* "ml.pyx":9 + * ctypedef np.float_t DTYPE_t * + * cdef DTYPE_t plogis(DTYPE_t weight, DTYPE_t delta): # <<<<<<<<<<<<<< + * return 1/(1 + exp(-weight/delta)) + * + */ + +static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_plogis(__pyx_t_2ml_DTYPE_t __pyx_v_weight, __pyx_t_2ml_DTYPE_t __pyx_v_delta) { + __pyx_t_2ml_DTYPE_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("plogis", 0); + + /* "ml.pyx":10 + * + * cdef DTYPE_t plogis(DTYPE_t weight, DTYPE_t delta): + * return 1/(1 + exp(-weight/delta)) # <<<<<<<<<<<<<< + * + * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, + */ + __pyx_r = (1.0 / (1.0 + exp(((-__pyx_v_weight) / __pyx_v_delta)))); + goto __pyx_L0; + + /* "ml.pyx":9 + * ctypedef np.float_t DTYPE_t + * + * cdef DTYPE_t plogis(DTYPE_t weight, DTYPE_t delta): # <<<<<<<<<<<<<< + * return 1/(1 + exp(-weight/delta)) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ml.pyx":12 + * return 1/(1 + exp(-weight/delta)) * * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< * DTYPE_t delta, DTYPE_t gamma): @@ -1438,7 +1475,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success(int __pyx_v_dist, int __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("weight_success", 0); - /* "ml.pyx":14 + /* "ml.pyx":16 * """weight for successful infection, exponential time model""" * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) # <<<<<<<<<<<<<< @@ -1447,7 +1484,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success(int __pyx_v_dist, int __py */ __pyx_v_structural = pow(__pyx_v_delta, ((__pyx_t_2ml_DTYPE_t)__pyx_v_dist)); - /* "ml.pyx":15 + /* "ml.pyx":17 * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) * temporal = exp(-alpha * dt) * (1 - exp(-alpha)) # <<<<<<<<<<<<<< @@ -1456,7 +1493,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success(int __pyx_v_dist, int __py */ __pyx_v_temporal = (exp(((-__pyx_v_alpha) * __pyx_v_dt)) * (1.0 - exp((-__pyx_v_alpha)))); - /* "ml.pyx":16 + /* "ml.pyx":18 * structural = delta ** (dist) * temporal = exp(-alpha * dt) * (1 - exp(-alpha)) * result = log(structural * temporal) # <<<<<<<<<<<<<< @@ -1465,7 +1502,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success(int __pyx_v_dist, int __py */ __pyx_v_result = log((__pyx_v_structural * __pyx_v_temporal)); - /* "ml.pyx":17 + /* "ml.pyx":19 * temporal = exp(-alpha * dt) * (1 - exp(-alpha)) * result = log(structural * temporal) * return result # <<<<<<<<<<<<<< @@ -1475,8 +1512,8 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success(int __pyx_v_dist, int __py __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "ml.pyx":10 - * + /* "ml.pyx":12 + * return 1/(1 + exp(-weight/delta)) * * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< * DTYPE_t delta, DTYPE_t gamma): @@ -1489,7 +1526,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success(int __pyx_v_dist, int __py return __pyx_r; } -/* "ml.pyx":20 +/* "ml.pyx":22 * * * cdef DTYPE_t weight_success_power(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< @@ -1505,7 +1542,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success_power(int __pyx_v_dist, in __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("weight_success_power", 0); - /* "ml.pyx":24 + /* "ml.pyx":26 * """weight for successful infection, power-law time model""" * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) # <<<<<<<<<<<<<< @@ -1514,7 +1551,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success_power(int __pyx_v_dist, in */ __pyx_v_structural = pow(__pyx_v_delta, ((__pyx_t_2ml_DTYPE_t)__pyx_v_dist)); - /* "ml.pyx":25 + /* "ml.pyx":27 * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) * temporal = 1. / (1. + (dt - 1.)/alpha)**0.01 - 1. / (1. + dt/alpha)**0.01 # <<<<<<<<<<<<<< @@ -1523,7 +1560,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success_power(int __pyx_v_dist, in */ __pyx_v_temporal = ((1. / pow(((double)(1. + ((__pyx_v_dt - 1.) / __pyx_v_alpha))), 0.01)) - (1. / pow(((double)(1. + (__pyx_v_dt / __pyx_v_alpha))), 0.01))); - /* "ml.pyx":26 + /* "ml.pyx":28 * structural = delta ** (dist) * temporal = 1. / (1. + (dt - 1.)/alpha)**0.01 - 1. / (1. + dt/alpha)**0.01 * result = log(structural * temporal) # <<<<<<<<<<<<<< @@ -1532,7 +1569,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success_power(int __pyx_v_dist, in */ __pyx_v_result = log((__pyx_v_structural * __pyx_v_temporal)); - /* "ml.pyx":27 + /* "ml.pyx":29 * temporal = 1. / (1. + (dt - 1.)/alpha)**0.01 - 1. / (1. + dt/alpha)**0.01 * result = log(structural * temporal) * return result # <<<<<<<<<<<<<< @@ -1542,7 +1579,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success_power(int __pyx_v_dist, in __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "ml.pyx":20 + /* "ml.pyx":22 * * * cdef DTYPE_t weight_success_power(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< @@ -1556,7 +1593,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_success_power(int __pyx_v_dist, in return __pyx_r; } -/* "ml.pyx":30 +/* "ml.pyx":32 * * * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< @@ -1572,7 +1609,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure(int __pyx_v_dist, int __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("weight_failure", 0); - /* "ml.pyx":34 + /* "ml.pyx":36 * """weight for failed infection, exponential time model""" * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) # <<<<<<<<<<<<<< @@ -1581,7 +1618,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure(int __pyx_v_dist, int __py */ __pyx_v_structural = pow(__pyx_v_delta, ((__pyx_t_2ml_DTYPE_t)__pyx_v_dist)); - /* "ml.pyx":35 + /* "ml.pyx":37 * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) * temporal = 1. - exp(-alpha * dt) # <<<<<<<<<<<<<< @@ -1590,7 +1627,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure(int __pyx_v_dist, int __py */ __pyx_v_temporal = (1. - exp(((-__pyx_v_alpha) * __pyx_v_dt))); - /* "ml.pyx":37 + /* "ml.pyx":39 * temporal = 1. - exp(-alpha * dt) * #result = log(1. - structural) * result = log(1. - structural * temporal) # <<<<<<<<<<<<<< @@ -1599,7 +1636,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure(int __pyx_v_dist, int __py */ __pyx_v_result = log((1. - (__pyx_v_structural * __pyx_v_temporal))); - /* "ml.pyx":38 + /* "ml.pyx":40 * #result = log(1. - structural) * result = log(1. - structural * temporal) * return result # <<<<<<<<<<<<<< @@ -1609,7 +1646,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure(int __pyx_v_dist, int __py __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "ml.pyx":30 + /* "ml.pyx":32 * * * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< @@ -1623,7 +1660,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure(int __pyx_v_dist, int __py return __pyx_r; } -/* "ml.pyx":41 +/* "ml.pyx":43 * * * cdef DTYPE_t weight_failure_power(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< @@ -1639,7 +1676,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure_power(int __pyx_v_dist, in __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("weight_failure_power", 0); - /* "ml.pyx":45 + /* "ml.pyx":47 * """weight for failed infection, power-law time model""" * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) # <<<<<<<<<<<<<< @@ -1648,7 +1685,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure_power(int __pyx_v_dist, in */ __pyx_v_structural = pow(__pyx_v_delta, ((__pyx_t_2ml_DTYPE_t)__pyx_v_dist)); - /* "ml.pyx":46 + /* "ml.pyx":48 * cdef DTYPE_t structural, temporal, result * structural = delta ** (dist) * temporal = 1. - 1. / (1. + dt/alpha)**0.01 # <<<<<<<<<<<<<< @@ -1657,7 +1694,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure_power(int __pyx_v_dist, in */ __pyx_v_temporal = (1. - (1. / pow(((double)(1. + (__pyx_v_dt / __pyx_v_alpha))), 0.01))); - /* "ml.pyx":47 + /* "ml.pyx":49 * structural = delta ** (dist) * temporal = 1. - 1. / (1. + dt/alpha)**0.01 * result = log(1. - structural * temporal) # <<<<<<<<<<<<<< @@ -1666,7 +1703,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure_power(int __pyx_v_dist, in */ __pyx_v_result = log((1. - (__pyx_v_structural * __pyx_v_temporal))); - /* "ml.pyx":48 + /* "ml.pyx":50 * temporal = 1. - 1. / (1. + dt/alpha)**0.01 * result = log(1. - structural * temporal) * return result # <<<<<<<<<<<<<< @@ -1676,7 +1713,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure_power(int __pyx_v_dist, in __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "ml.pyx":41 + /* "ml.pyx":43 * * * cdef DTYPE_t weight_failure_power(int dist, int dt, DTYPE_t alpha, # <<<<<<<<<<<<<< @@ -1690,7 +1727,7 @@ static __pyx_t_2ml_DTYPE_t __pyx_f_2ml_weight_failure_power(int __pyx_v_dist, in return __pyx_r; } -/* "ml.pyx":50 +/* "ml.pyx":52 * return result * * def ml(dict root_victims, dict victims, dict non_victims, DTYPE_t age, # <<<<<<<<<<<<<< @@ -1740,27 +1777,27 @@ static PyObject *__pyx_pw_2ml_1ml(PyObject *__pyx_self, PyObject *__pyx_args, Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_victims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_non_victims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_age)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (kw_args > 0) { @@ -1769,7 +1806,7 @@ static PyObject *__pyx_pw_2ml_1ml(PyObject *__pyx_self, PyObject *__pyx_args, Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ml") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ml") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1787,26 +1824,26 @@ static PyObject *__pyx_pw_2ml_1ml(PyObject *__pyx_self, PyObject *__pyx_args, Py __pyx_v_root_victims = ((PyObject*)values[0]); __pyx_v_victims = ((PyObject*)values[1]); __pyx_v_non_victims = ((PyObject*)values[2]); - __pyx_v_age = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_age == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_delta = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_delta == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_age = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_age == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_delta = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_delta == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} if (values[6]) { - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_gamma == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_gamma == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_gamma = ((__pyx_t_2ml_DTYPE_t)10.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("ml", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("ml.ml", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root_victims), (&PyDict_Type), 1, "root_victims", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_victims), (&PyDict_Type), 1, "victims", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_non_victims), (&PyDict_Type), 1, "non_victims", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root_victims), (&PyDict_Type), 1, "root_victims", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_victims), (&PyDict_Type), 1, "victims", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_non_victims), (&PyDict_Type), 1, "non_victims", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_2ml_ml(__pyx_self, __pyx_v_root_victims, __pyx_v_victims, __pyx_v_non_victims, __pyx_v_age, __pyx_v_alpha, __pyx_v_delta, __pyx_v_gamma); /* function exit code */ @@ -1819,7 +1856,7 @@ static PyObject *__pyx_pw_2ml_1ml(PyObject *__pyx_self, PyObject *__pyx_args, Py } static PyObject *__pyx_gb_2ml_2ml_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "ml.pyx":74 +/* "ml.pyx":76 * for (dist, dt, w1, w2, w3) in parents] * # find parent that maximizes p/\tilde{p} * probs[i] = max(s - failures[l] for l, s in enumerate(successes)) # <<<<<<<<<<<<<< @@ -1845,7 +1882,7 @@ static PyObject *__pyx_pf_2ml_2ml_genexpr(PyObject *__pyx_self) { __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_2ml_2ml_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ml_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_2ml_2ml_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ml_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -1883,16 +1920,16 @@ static PyObject *__pyx_gb_2ml_2ml_2generator(__pyx_GeneratorObject *__pyx_genera return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_successes)) { __Pyx_RaiseClosureNameError("successes"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_successes)) { __Pyx_RaiseClosureNameError("successes"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_successes; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); @@ -1900,14 +1937,14 @@ static PyObject *__pyx_gb_2ml_2ml_2generator(__pyx_GeneratorObject *__pyx_genera __pyx_t_4 = 0; __pyx_cur_scope->__pyx_v_l = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_failures)) { __Pyx_RaiseClosureNameError("failures"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_failures)) { __Pyx_RaiseClosureNameError("failures"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_failures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_failures, __pyx_cur_scope->__pyx_v_l, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_failures, __pyx_cur_scope->__pyx_v_l, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; @@ -1927,7 +1964,7 @@ static PyObject *__pyx_gb_2ml_2ml_2generator(__pyx_GeneratorObject *__pyx_genera __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -1947,7 +1984,7 @@ static PyObject *__pyx_gb_2ml_2ml_2generator(__pyx_GeneratorObject *__pyx_genera return NULL; } -/* "ml.pyx":50 +/* "ml.pyx":52 * return result * * def ml(dict root_victims, dict victims, dict non_victims, DTYPE_t age, # <<<<<<<<<<<<<< @@ -2040,7 +2077,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_pybuffernd_cums.data = NULL; __pyx_pybuffernd_cums.rcbuffer = &__pyx_pybuffer_cums; - /* "ml.pyx":56 + /* "ml.pyx":58 * DTYPE_t beta, ll, beta2 * list parents, failures, successes * n_roots, n_victims = len(root_victims), len(victims) # <<<<<<<<<<<<<< @@ -2049,18 +2086,18 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ if (unlikely(__pyx_v_root_victims == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyDict_Size(__pyx_v_root_victims); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_Size(__pyx_v_root_victims); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_v_victims == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyDict_Size(__pyx_v_victims); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_Size(__pyx_v_victims); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_n_roots = __pyx_t_1; __pyx_v_n_victims = __pyx_t_2; - /* "ml.pyx":57 + /* "ml.pyx":59 * list parents, failures, successes * n_roots, n_victims = len(root_victims), len(victims) * n_nodes = n_roots + n_victims + len(non_victims) # <<<<<<<<<<<<<< @@ -2069,48 +2106,48 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ if (unlikely(__pyx_v_non_victims == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyDict_Size(__pyx_v_non_victims); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_Size(__pyx_v_non_victims); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_n_nodes = ((__pyx_v_n_roots + __pyx_v_n_victims) + __pyx_t_2); - /* "ml.pyx":59 + /* "ml.pyx":61 * n_nodes = n_roots + n_victims + len(non_victims) * cdef: * np.ndarray[DTYPE_t] probs = np.zeros(n_victims, dtype=DTYPE) # <<<<<<<<<<<<<< * np.ndarray[DTYPE_t] probs_fail = np.zeros(n_victims, dtype=DTYPE) * np.ndarray[DTYPE_t] probs_nv = np.zeros(len(non_victims), dtype=DTYPE) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n_victims); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n_victims); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_2ml_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_probs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_probs.diminfo[0].strides = __pyx_pybuffernd_probs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probs.diminfo[0].shape = __pyx_pybuffernd_probs.rcbuffer->pybuffer.shape[0]; } } @@ -2118,43 +2155,43 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_v_probs = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "ml.pyx":60 + /* "ml.pyx":62 * cdef: * np.ndarray[DTYPE_t] probs = np.zeros(n_victims, dtype=DTYPE) * np.ndarray[DTYPE_t] probs_fail = np.zeros(n_victims, dtype=DTYPE) # <<<<<<<<<<<<<< * np.ndarray[DTYPE_t] probs_nv = np.zeros(len(non_victims), dtype=DTYPE) * */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n_victims); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n_victims); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probs_fail.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_2ml_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_probs_fail = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_probs_fail.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_probs_fail.diminfo[0].strides = __pyx_pybuffernd_probs_fail.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probs_fail.diminfo[0].shape = __pyx_pybuffernd_probs_fail.rcbuffer->pybuffer.shape[0]; } } @@ -2162,48 +2199,48 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_v_probs_fail = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "ml.pyx":61 + /* "ml.pyx":63 * np.ndarray[DTYPE_t] probs = np.zeros(n_victims, dtype=DTYPE) * np.ndarray[DTYPE_t] probs_fail = np.zeros(n_victims, dtype=DTYPE) * np.ndarray[DTYPE_t] probs_nv = np.zeros(len(non_victims), dtype=DTYPE) # <<<<<<<<<<<<<< * * # loop through victims */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_non_victims == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyDict_Size(__pyx_v_non_victims); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_Size(__pyx_v_non_victims); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probs_nv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_2ml_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_probs_nv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_probs_nv.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_probs_nv.diminfo[0].strides = __pyx_pybuffernd_probs_nv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probs_nv.diminfo[0].shape = __pyx_pybuffernd_probs_nv.rcbuffer->pybuffer.shape[0]; } } @@ -2211,7 +2248,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_v_probs_nv = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "ml.pyx":64 + /* "ml.pyx":66 * * # loop through victims * for i, parents in enumerate(victims.itervalues()): # <<<<<<<<<<<<<< @@ -2222,9 +2259,9 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_2 = 0; if (unlikely(__pyx_v_victims == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "itervalues"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_victims, 1, __pyx_n_s_itervalues, (&__pyx_t_1), (&__pyx_t_11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_victims, 1, __pyx_n_s_itervalues, (&__pyx_t_1), (&__pyx_t_11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_4; @@ -2232,25 +2269,25 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_1, &__pyx_t_2, NULL, &__pyx_t_4, NULL, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; - if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_parents, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; __pyx_v_i = __pyx_t_10; __pyx_t_10 = (__pyx_t_10 + 1); - /* "ml.pyx":68 + /* "ml.pyx":70 * # fail to infect it, also computes the probability that its most * # likely parent infects it * failures = [weight_failure(dist, dt, alpha, delta, gamma) # <<<<<<<<<<<<<< * for (dist, dt, w1, w2, w3) in parents] * probs_fail[i] = sum(failures) */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - /* "ml.pyx":69 + /* "ml.pyx":71 * # likely parent infects it * failures = [weight_failure(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<< @@ -2259,15 +2296,15 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ if (unlikely(__pyx_v_parents == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; @@ -2279,7 +2316,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -2305,7 +2342,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_14,&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18}; for (i=0; i < 5; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -2315,7 +2352,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_14,&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18}; - __pyx_t_19 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; @@ -2324,7 +2361,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L8_unpacking_done; @@ -2332,12 +2369,12 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_t_15); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_t_15); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_v_dist = __pyx_t_12; __pyx_v_dt = __pyx_t_21; @@ -2348,19 +2385,19 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_18); __pyx_t_18 = 0; - /* "ml.pyx":68 + /* "ml.pyx":70 * # fail to infect it, also computes the probability that its most * # likely parent infects it * failures = [weight_failure(dist, dt, alpha, delta, gamma) # <<<<<<<<<<<<<< * for (dist, dt, w1, w2, w3) in parents] * probs_fail[i] = sum(failures) */ - __pyx_t_6 = PyFloat_FromDouble(__pyx_f_2ml_weight_failure(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_v_gamma)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyFloat_FromDouble(__pyx_f_2ml_weight_failure(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_v_gamma)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "ml.pyx":69 + /* "ml.pyx":71 * # likely parent infects it * failures = [weight_failure(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<< @@ -2374,38 +2411,38 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "ml.pyx":70 + /* "ml.pyx":72 * failures = [weight_failure(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] * probs_fail[i] = sum(failures) # <<<<<<<<<<<<<< * successes = [weight_success(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_failures); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_failures); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_failures); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_21 = __pyx_v_i; if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_probs_fail.diminfo[0].shape; *__Pyx_BufPtrStrided1d(__pyx_t_2ml_DTYPE_t *, __pyx_pybuffernd_probs_fail.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_probs_fail.diminfo[0].strides) = __pyx_t_22; - /* "ml.pyx":71 + /* "ml.pyx":73 * for (dist, dt, w1, w2, w3) in parents] * probs_fail[i] = sum(failures) * successes = [weight_success(dist, dt, alpha, delta, gamma) # <<<<<<<<<<<<<< * for (dist, dt, w1, w2, w3) in parents] * # find parent that maximizes p/\tilde{p} */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - /* "ml.pyx":72 + /* "ml.pyx":74 * probs_fail[i] = sum(failures) * successes = [weight_success(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<< @@ -2414,15 +2451,15 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ if (unlikely(__pyx_v_parents == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; @@ -2434,7 +2471,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -2460,7 +2497,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_18,&__pyx_t_17,&__pyx_t_16,&__pyx_t_15,&__pyx_t_14}; for (i=0; i < 5; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -2470,7 +2507,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_18,&__pyx_t_17,&__pyx_t_16,&__pyx_t_15,&__pyx_t_14}; - __pyx_t_19 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; @@ -2479,7 +2516,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L12_unpacking_done; @@ -2487,12 +2524,12 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L12_unpacking_done:; } - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_18); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_18); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_17); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_17); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_v_dist = __pyx_t_12; __pyx_v_dt = __pyx_t_23; @@ -2503,19 +2540,19 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_14); __pyx_t_14 = 0; - /* "ml.pyx":71 + /* "ml.pyx":73 * for (dist, dt, w1, w2, w3) in parents] * probs_fail[i] = sum(failures) * successes = [weight_success(dist, dt, alpha, delta, gamma) # <<<<<<<<<<<<<< * for (dist, dt, w1, w2, w3) in parents] * # find parent that maximizes p/\tilde{p} */ - __pyx_t_6 = PyFloat_FromDouble(__pyx_f_2ml_weight_success(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_v_gamma)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyFloat_FromDouble(__pyx_f_2ml_weight_success(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_v_gamma)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "ml.pyx":72 + /* "ml.pyx":74 * probs_fail[i] = sum(failures) * successes = [weight_success(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<< @@ -2529,24 +2566,24 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - /* "ml.pyx":74 + /* "ml.pyx":76 * for (dist, dt, w1, w2, w3) in parents] * # find parent that maximizes p/\tilde{p} * probs[i] = max(s - failures[l] for l, s in enumerate(successes)) # <<<<<<<<<<<<<< * * # loop through non-victims */ - __pyx_t_5 = __pyx_pf_2ml_2ml_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_pf_2ml_2ml_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_23 = __pyx_v_i; if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_probs.diminfo[0].shape; @@ -2554,7 +2591,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ml.pyx":77 + /* "ml.pyx":79 * * # loop through non-victims * for i, parents in enumerate(non_victims.itervalues()): # <<<<<<<<<<<<<< @@ -2565,9 +2602,9 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_1 = 0; if (unlikely(__pyx_v_non_victims == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "itervalues"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_non_victims, 1, __pyx_n_s_itervalues, (&__pyx_t_2), (&__pyx_t_11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_non_victims, 1, __pyx_n_s_itervalues, (&__pyx_t_2), (&__pyx_t_11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_5; @@ -2575,25 +2612,25 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ while (1) { __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_2, &__pyx_t_1, NULL, &__pyx_t_5, NULL, __pyx_t_11); if (unlikely(__pyx_t_12 == 0)) break; - if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_parents, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; __pyx_v_i = __pyx_t_10; __pyx_t_10 = (__pyx_t_10 + 1); - /* "ml.pyx":80 + /* "ml.pyx":82 * # for each non victim node, compute the probability that all its * # parents fail to infect it * failures = [weight_failure(dist, dt, alpha, delta, gamma) # <<<<<<<<<<<<<< * for (dist, dt, w1, w2, w3) in parents] * probs_nv[i] = sum(failures) */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - /* "ml.pyx":81 + /* "ml.pyx":83 * # parents fail to infect it * failures = [weight_failure(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<< @@ -2602,15 +2639,15 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ if (unlikely(__pyx_v_parents == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; @@ -2622,7 +2659,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -2648,7 +2685,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_14,&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18}; for (i=0; i < 5; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -2658,7 +2695,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_14,&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18}; - __pyx_t_19 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; @@ -2667,7 +2704,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L18_unpacking_done; @@ -2675,12 +2712,12 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L18_unpacking_done:; } - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_t_15); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_t_15); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_v_dist = __pyx_t_12; __pyx_v_dt = __pyx_t_24; @@ -2691,19 +2728,19 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_18); __pyx_t_18 = 0; - /* "ml.pyx":80 + /* "ml.pyx":82 * # for each non victim node, compute the probability that all its * # parents fail to infect it * failures = [weight_failure(dist, dt, alpha, delta, gamma) # <<<<<<<<<<<<<< * for (dist, dt, w1, w2, w3) in parents] * probs_nv[i] = sum(failures) */ - __pyx_t_6 = PyFloat_FromDouble(__pyx_f_2ml_weight_failure(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_v_gamma)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyFloat_FromDouble(__pyx_f_2ml_weight_failure(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_v_gamma)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "ml.pyx":81 + /* "ml.pyx":83 * # parents fail to infect it * failures = [weight_failure(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<< @@ -2717,22 +2754,22 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - /* "ml.pyx":82 + /* "ml.pyx":84 * failures = [weight_failure(dist, dt, alpha, delta, gamma) * for (dist, dt, w1, w2, w3) in parents] * probs_nv[i] = sum(failures) # <<<<<<<<<<<<<< * * # calculate log likelihood */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_failures); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_failures); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_failures); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_24 = __pyx_v_i; if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_probs_nv.diminfo[0].shape; @@ -2740,14 +2777,14 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ml.pyx":85 + /* "ml.pyx":87 * * # calculate log likelihood * probs.sort(); probs = probs[::-1] # sort probs in descending order # <<<<<<<<<<<<<< * cdef: * np.ndarray[DTYPE_t] cums = probs.cumsum() */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs), __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs), __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { @@ -2760,17 +2797,17 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } } if (__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_probs), __pyx_slice_); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_probs), __pyx_slice_); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2786,20 +2823,20 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } } __pyx_pybuffernd_probs.diminfo[0].strides = __pyx_pybuffernd_probs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probs.diminfo[0].shape = __pyx_pybuffernd_probs.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_probs, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "ml.pyx":87 + /* "ml.pyx":89 * probs.sort(); probs = probs[::-1] # sort probs in descending order * cdef: * np.ndarray[DTYPE_t] cums = probs.cumsum() # <<<<<<<<<<<<<< * ll = probs_fail.sum() * ll += probs_nv.sum() */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs), __pyx_n_s_cumsum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs), __pyx_n_s_cumsum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { @@ -2812,20 +2849,20 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } } if (__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_28 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cums.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_2ml_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_cums = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cums.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_cums.diminfo[0].strides = __pyx_pybuffernd_cums.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cums.diminfo[0].shape = __pyx_pybuffernd_cums.rcbuffer->pybuffer.shape[0]; } } @@ -2833,14 +2870,14 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_v_cums = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "ml.pyx":88 + /* "ml.pyx":90 * cdef: * np.ndarray[DTYPE_t] cums = probs.cumsum() * ll = probs_fail.sum() # <<<<<<<<<<<<<< * ll += probs_nv.sum() * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_fail), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_fail), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { @@ -2853,27 +2890,27 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } } if (__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ll = __pyx_t_22; - /* "ml.pyx":89 + /* "ml.pyx":91 * np.ndarray[DTYPE_t] cums = probs.cumsum() * ll = probs_fail.sum() * ll += probs_nv.sum() # <<<<<<<<<<<<<< * * for i in xrange(n_victims - 1, 0, -1): */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ll); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ll); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_nv), __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_nv), __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { @@ -2886,22 +2923,22 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } } if (__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_ll = __pyx_t_22; - /* "ml.pyx":91 + /* "ml.pyx":93 * ll += probs_nv.sum() * * for i in xrange(n_victims - 1, 0, -1): # <<<<<<<<<<<<<< @@ -2911,41 +2948,29 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ for (__pyx_t_10 = (__pyx_v_n_victims - 1); __pyx_t_10 > 0; __pyx_t_10-=1) { __pyx_v_i = __pyx_t_10; - /* "ml.pyx":93 + /* "ml.pyx":95 * for i in xrange(n_victims - 1, 0, -1): * # iterate over all victim nodes to find the optimal threshold * roots = n_roots + n_victims - 1 - i # <<<<<<<<<<<<<< - * beta = exp(probs[i])#1. / (1. + exp(-probs[i])) - * print beta + * beta = 1. / (1. + exp(-probs[i]))#exp(probs[i])# + * if beta > float(roots) / age: */ __pyx_v_roots = (((__pyx_v_n_roots + __pyx_v_n_victims) - 1) - __pyx_v_i); - /* "ml.pyx":94 + /* "ml.pyx":96 * # iterate over all victim nodes to find the optimal threshold * roots = n_roots + n_victims - 1 - i - * beta = exp(probs[i])#1. / (1. + exp(-probs[i])) # <<<<<<<<<<<<<< - * print beta + * beta = 1. / (1. + exp(-probs[i]))#exp(probs[i])# # <<<<<<<<<<<<<< * if beta > float(roots) / age: + * break */ __pyx_t_11 = __pyx_v_i; if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_pybuffernd_probs.diminfo[0].shape; - __pyx_v_beta = exp((*__Pyx_BufPtrStrided1d(__pyx_t_2ml_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_probs.diminfo[0].strides))); + __pyx_v_beta = (1. / (1. + exp((-(*__Pyx_BufPtrStrided1d(__pyx_t_2ml_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_probs.diminfo[0].strides)))))); - /* "ml.pyx":95 + /* "ml.pyx":97 * roots = n_roots + n_victims - 1 - i - * beta = exp(probs[i])#1. / (1. + exp(-probs[i])) - * print beta # <<<<<<<<<<<<<< - * if beta > float(roots) / age: - * break - */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "ml.pyx":96 - * beta = exp(probs[i])#1. / (1. + exp(-probs[i])) - * print beta + * beta = 1. / (1. + exp(-probs[i]))#exp(probs[i])# * if beta > float(roots) / age: # <<<<<<<<<<<<<< * break * else: @@ -2953,8 +2978,8 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_29 = ((__pyx_v_beta > (((double)__pyx_v_roots) / __pyx_v_age)) != 0); if (__pyx_t_29) { - /* "ml.pyx":97 - * print beta + /* "ml.pyx":98 + * beta = 1. / (1. + exp(-probs[i]))#exp(probs[i])# * if beta > float(roots) / age: * break # <<<<<<<<<<<<<< * else: @@ -2965,18 +2990,18 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } /*else*/ { - /* "ml.pyx":99 + /* "ml.pyx":100 * break * else: * print "alpha: {0}, delta: {1}. Everyone is a root".format(alpha, delta) # <<<<<<<<<<<<<< * roots = n_victims + n_roots * i = -1 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_alpha_0_delta_1_Everyone_is_a_ro, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_alpha_0_delta_1_Everyone_is_a_ro, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_18 = NULL; __pyx_t_2 = 0; @@ -2990,7 +3015,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_2 = 1; } } - __pyx_t_17 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); if (__pyx_t_18) { PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = NULL; @@ -3001,14 +3026,14 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __Pyx_GIVEREF(__pyx_t_6); __pyx_t_3 = 0; __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "ml.pyx":100 + /* "ml.pyx":101 * else: * print "alpha: {0}, delta: {1}. Everyone is a root".format(alpha, delta) * roots = n_victims + n_roots # <<<<<<<<<<<<<< @@ -3017,7 +3042,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ __pyx_v_roots = (__pyx_v_n_victims + __pyx_v_n_roots); - /* "ml.pyx":101 + /* "ml.pyx":102 * print "alpha: {0}, delta: {1}. Everyone is a root".format(alpha, delta) * roots = n_victims + n_roots * i = -1 # <<<<<<<<<<<<<< @@ -3028,7 +3053,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } __pyx_L20_break:; - /* "ml.pyx":102 + /* "ml.pyx":103 * roots = n_victims + n_roots * i = -1 * beta = float(roots) / age # <<<<<<<<<<<<<< @@ -3037,7 +3062,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ __pyx_v_beta = (((double)__pyx_v_roots) / __pyx_v_age); - /* "ml.pyx":103 + /* "ml.pyx":104 * i = -1 * beta = float(roots) / age * for i in xrange(n_victims - 1, 0, -1): # <<<<<<<<<<<<<< @@ -3047,7 +3072,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ for (__pyx_t_10 = (__pyx_v_n_victims - 1); __pyx_t_10 > 0; __pyx_t_10-=1) { __pyx_v_i = __pyx_t_10; - /* "ml.pyx":104 + /* "ml.pyx":105 * beta = float(roots) / age * for i in xrange(n_victims - 1, 0, -1): * if probs[i] >= log(beta/(1.- beta)): # <<<<<<<<<<<<<< @@ -3059,7 +3084,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_29 = (((*__Pyx_BufPtrStrided1d(__pyx_t_2ml_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_probs.diminfo[0].strides)) >= log((__pyx_v_beta / (1. - __pyx_v_beta)))) != 0); if (__pyx_t_29) { - /* "ml.pyx":105 + /* "ml.pyx":106 * for i in xrange(n_victims - 1, 0, -1): * if probs[i] >= log(beta/(1.- beta)): * break # <<<<<<<<<<<<<< @@ -3071,7 +3096,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } __pyx_L23_break:; - /* "ml.pyx":106 + /* "ml.pyx":107 * if probs[i] >= log(beta/(1.- beta)): * break * ll += age * log(1 - beta) # <<<<<<<<<<<<<< @@ -3080,7 +3105,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ */ __pyx_v_ll = (__pyx_v_ll + (__pyx_v_age * log((1.0 - __pyx_v_beta)))); - /* "ml.pyx":107 + /* "ml.pyx":108 * break * ll += age * log(1 - beta) * if i >= 0: # <<<<<<<<<<<<<< @@ -3090,7 +3115,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_29 = ((__pyx_v_i >= 0) != 0); if (__pyx_t_29) { - /* "ml.pyx":108 + /* "ml.pyx":109 * ll += age * log(1 - beta) * if i >= 0: * ll += cums[i] # <<<<<<<<<<<<<< @@ -3104,7 +3129,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } __pyx_L25:; - /* "ml.pyx":109 + /* "ml.pyx":110 * if i >= 0: * ll += cums[i] * if roots > 0: # <<<<<<<<<<<<<< @@ -3114,7 +3139,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_29 = ((__pyx_v_roots > 0) != 0); if (__pyx_t_29) { - /* "ml.pyx":110 + /* "ml.pyx":111 * ll += cums[i] * if roots > 0: * ll += roots * log(beta) - roots * log(1 - beta) # <<<<<<<<<<<<<< @@ -3125,19 +3150,19 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ } __pyx_L26:; - /* "ml.pyx":111 + /* "ml.pyx":112 * if roots > 0: * ll += roots * log(beta) - roots * log(1 - beta) * return (beta, roots, ll) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_roots); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_roots); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_17 = PyFloat_FromDouble(__pyx_v_ll); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyFloat_FromDouble(__pyx_v_ll); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -3152,7 +3177,7 @@ static PyObject *__pyx_pf_2ml_ml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *_ __pyx_t_6 = 0; goto __pyx_L0; - /* "ml.pyx":50 + /* "ml.pyx":52 * return result * * def ml(dict root_victims, dict victims, dict non_victims, DTYPE_t age, # <<<<<<<<<<<<<< @@ -5524,13 +5549,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5544,14 +5569,14 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ml.pyx":85 + /* "ml.pyx":87 * * # calculate log likelihood * probs.sort(); probs = probs[::-1] # sort probs in descending order # <<<<<<<<<<<<<< * cdef: * np.ndarray[DTYPE_t] cums = probs.cumsum() */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_slice_ = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); @@ -5621,17 +5646,17 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "ml.pyx":50 + /* "ml.pyx":52 * return result * * def ml(dict root_victims, dict victims, dict non_victims, DTYPE_t age, # <<<<<<<<<<<<<< * DTYPE_t alpha, DTYPE_t delta, DTYPE_t gamma=10): * cdef: */ - __pyx_tuple__8 = PyTuple_Pack(31, __pyx_n_s_root_victims, __pyx_n_s_victims, __pyx_n_s_non_victims, __pyx_n_s_age, __pyx_n_s_alpha, __pyx_n_s_delta, __pyx_n_s_gamma, __pyx_n_s_n_roots, __pyx_n_s_n_victims, __pyx_n_s_n_nodes, __pyx_n_s_roots, __pyx_n_s_i, __pyx_n_s_dist, __pyx_n_s_dt, __pyx_n_s_t, __pyx_n_s_l, __pyx_n_s_beta, __pyx_n_s_ll, __pyx_n_s_beta2, __pyx_n_s_parents, __pyx_n_s_failures, __pyx_n_s_successes, __pyx_n_s_probs, __pyx_n_s_probs_fail, __pyx_n_s_probs_nv, __pyx_n_s_cums, __pyx_n_s_w1, __pyx_n_s_w2, __pyx_n_s_w3, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__8 = PyTuple_Pack(31, __pyx_n_s_root_victims, __pyx_n_s_victims, __pyx_n_s_non_victims, __pyx_n_s_age, __pyx_n_s_alpha, __pyx_n_s_delta, __pyx_n_s_gamma, __pyx_n_s_n_roots, __pyx_n_s_n_victims, __pyx_n_s_n_nodes, __pyx_n_s_roots, __pyx_n_s_i, __pyx_n_s_dist, __pyx_n_s_dt, __pyx_n_s_t, __pyx_n_s_l, __pyx_n_s_beta, __pyx_n_s_ll, __pyx_n_s_beta2, __pyx_n_s_parents, __pyx_n_s_failures, __pyx_n_s_successes, __pyx_n_s_probs, __pyx_n_s_probs_fail, __pyx_n_s_probs_nv, __pyx_n_s_cums, __pyx_n_s_w1, __pyx_n_s_w2, __pyx_n_s_w3, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(7, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ben_Documents_Cascade_Pro, __pyx_n_s_ml, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(7, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ben_Documents_Cascade_Pro, __pyx_n_s_ml, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5728,10 +5753,10 @@ PyMODINIT_FUNC PyInit_ml(void) /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_2ml___pyx_scope_struct__ml) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_2ml___pyx_scope_struct__ml) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_2ml___pyx_scope_struct__ml.tp_print = 0; __pyx_ptype_2ml___pyx_scope_struct__ml = &__pyx_type_2ml___pyx_scope_struct__ml; - if (PyType_Ready(&__pyx_type_2ml___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_2ml___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_2ml___pyx_scope_struct_1_genexpr.tp_print = 0; __pyx_ptype_2ml___pyx_scope_struct_1_genexpr = &__pyx_type_2ml___pyx_scope_struct_1_genexpr; /*--- Type import code ---*/ @@ -5777,16 +5802,16 @@ PyMODINIT_FUNC PyInit_ml(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ml.pyx":50 + /* "ml.pyx":52 * return result * * def ml(dict root_victims, dict victims, dict non_victims, DTYPE_t age, # <<<<<<<<<<<<<< * DTYPE_t alpha, DTYPE_t delta, DTYPE_t gamma=10): * cdef: */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2ml_1ml, NULL, __pyx_n_s_ml); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2ml_1ml, NULL, __pyx_n_s_ml); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ml, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ml, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "ml.pyx":1 diff --git a/experiments/ml.pyx b/experiments/ml.pyx index c1a5616..9c570e9 100644 --- a/experiments/ml.pyx +++ b/experiments/ml.pyx @@ -6,6 +6,8 @@ from libc.math cimport log, exp DTYPE = np.float64 ctypedef np.float_t DTYPE_t +cdef DTYPE_t plogis(DTYPE_t weight, DTYPE_t delta): + return 1/(1 + exp(-weight/delta)) cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, DTYPE_t gamma): diff --git a/experiments/ml.so b/experiments/ml.so Binary files differindex 6dcab82..c681095 100755 --- a/experiments/ml.so +++ b/experiments/ml.so diff --git a/experiments/out.log b/experiments/out.log index f6caa9b..3d1c011 100644 --- a/experiments/out.log +++ b/experiments/out.log @@ -1,15 +1,480 @@ 1.0 0.01 3.82496925296e-05 10927 -123894.745252 +1.0 0.06 3.72415556715e-05 10639 -132428.544958 1.0 0.11 3.69615176554e-05 10559 -146433.341002 +1.0 0.16 3.66569763128e-05 10472 -165973.170107 1.0 0.21 3.66569763128e-05 10472 -191235.823611 -1.0 0.31 3.64469478007e-05 10412 -260465.254415 -1.0 0.41 3.61669097846e-05 10332 -358572.455236 -1.0 0.51 3.61669097846e-05 10332 -493346.776777 -1.0 0.61 3.5879870818e-05 10250 -678702.795812 -1.0 0.71 3.5879870818e-05 10250 -941793.902677 -1.0 0.81 3.56243361283e-05 10177 -1345861.15169 +1.0 0.26 3.64469478007e-05 10412 -222581.705257 +0.0196078431373 0.01 3.51272686497e-05 10035 -123198.774923 +0.0196078431373 0.06 2.65441034549e-05 7583 -129019.702528 +0.0196078431373 0.11 2.16819433997e-05 6194 -139106.948457 +0.0196078431373 0.16 1.98161901172e-05 5661 -155427.756691 +0.0196078431373 0.21 1.87135404286e-05 5346 -177957.624589 +0.0196078431373 0.26 1.79994434875e-05 5142 -206846.070546 0.00990099009901 0.01 3.45181859646e-05 9861 -123434.443377 +0.00990099009901 0.06 2.68696476487e-05 7676 -129021.89714 0.00990099009901 0.11 1.80484501403e-05 5156 -138449.306153 +0.00990099009901 0.16 1.58256483872e-05 4521 -153858.548948 0.00990099009901 0.21 1.45689777897e-05 4162 -175475.261761 -0.00990099009901 0.31 1.32527991139e-05 3786 -237994.762027 -0.00990099009901 0.41 1.26192131023e-05 3605 -329318.903778 -0.00990099009901 0.51 1.21921551277e-05 3483 -456389.667272 +0.00990099009901 0.26 1.37778703941e-05 3936 -203416.932024 +0.00662251655629 0.01 3.47912230303e-05 9939 -123682.034612 +0.00662251655629 0.06 2.87704056833e-05 8219 -128741.775561 +0.00662251655629 0.11 1.64522334483e-05 4700 -138180.260362 +0.00662251655629 0.16 1.37148618405e-05 3918 -152961.53267 +0.00662251655629 0.21 1.27137259328e-05 3632 -173885.881213 +0.00662251655629 0.26 1.22061570285e-05 3487 -201080.594185 +0.00497512437811 0.01 3.58308641652e-05 10236 -123863.136764 +0.00497512437811 0.06 2.7828777854e-05 7950 -128531.696572 +0.00497512437811 0.11 1.52690728301e-05 4362 -137996.766479 +0.00497512437811 0.16 1.26612188048e-05 3617 -152248.589222 +0.00497512437811 0.21 1.18631104588e-05 3389 -172603.120207 +0.00497512437811 0.26 1.13240372777e-05 3235 -199111.846369 +0.00398406374502 0.01 3.79871568895e-05 10852 -123937.454068 +0.00398406374502 0.06 2.71251823384e-05 7749 -128407.227372 +0.00398406374502 0.11 1.46214849178e-05 4177 -137848.244641 +0.00398406374502 0.16 1.20766394461e-05 3450 -151639.425443 +0.00398406374502 0.21 1.12400258729e-05 3211 -171437.579358 +0.00398406374502 0.26 1.06974522166e-05 3056 -197253.479103 +0.00332225913621 0.01 3.8515728645e-05 11003 -123935.244337 +0.00332225913621 0.06 2.65756077318e-05 7592 -128325.444138 +0.00332225913621 0.11 1.42889397736e-05 4082 -137714.672012 +0.00332225913621 0.16 1.16775852731e-05 3336 -151072.829511 +0.00332225913621 0.21 1.07534598198e-05 3072 -170313.621764 +0.00332225913621 0.26 1.03194008948e-05 2948 -195444.780298 +0.002849002849 0.01 3.8515728645e-05 11003 -123910.465539 +0.002849002849 0.06 2.61415488067e-05 7468 -128266.584054 +0.002849002849 0.11 1.41209169639e-05 4034 -137579.176196 +0.002849002849 0.16 1.13415396537e-05 3240 -150522.748593 +0.002849002849 0.21 1.04244151508e-05 2978 -169215.406369 +0.002849002849 0.26 1.00498643043e-05 2871 -193669.578193 +0.00249376558603 0.01 3.8515728645e-05 11003 -123885.930304 +0.00249376558603 0.06 2.57739989106e-05 7363 -128221.663762 +0.00249376558603 0.11 1.41349188647e-05 4038 -137439.201288 +0.00249376558603 0.16 1.10124949847e-05 3146 -149978.939417 +0.00249376558603 0.21 1.02248880643e-05 2921 -168133.438076 +0.00249376558603 0.26 9.79082913932e-06 2797 -191924.361358 +0.00221729490022 0.01 3.8515728645e-05 11003 -123861.764325 +0.00221729490022 0.06 2.55254651712e-05 7292 -128186.229347 +0.00221729490022 0.11 1.44324592569e-05 4123 -137292.867464 +0.00221729490022 0.16 1.08409716999e-05 3097 -149442.553602 +0.00221729490022 0.21 1.00218605026e-05 2863 -167070.363723 +0.00221729490022 0.26 9.64380918085e-06 2755 -190206.15306 +0.00199600798403 0.01 3.8515728645e-05 11003 -123838.06327 +0.00199600798403 0.06 2.53329390351e-05 7237 -128156.941942 +0.00199600798403 0.11 1.52165657021e-05 4347 -137133.100005 +0.00199600798403 0.16 1.05959384357e-05 3027 -148914.539921 +0.00199600798403 0.21 9.87484054417e-06 2821 -166028.040966 +0.00199600798403 0.26 9.50729064798e-06 2716 -188520.758698 +0.00181488203267 0.01 3.8515728645e-05 11003 -123814.899995 +0.00181488203267 0.06 2.51579152751e-05 7187 -128132.194898 +0.00181488203267 0.11 1.69983075797e-05 4856 -136954.029919 +0.00181488203267 0.16 1.04664208533e-05 2990 -148393.788936 +0.00181488203267 0.21 9.75582438731e-06 2787 -165007.737904 +0.00181488203267 0.26 9.43728114395e-06 2696 -186874.591314 +0.00166389351082 0.01 3.8515728645e-05 11003 -123792.328716 +0.00166389351082 0.06 2.5052901019e-05 7157 -128110.74337 +0.00166389351082 0.11 2.33831743478e-05 6680 -136603.150444 +0.00166389351082 0.16 1.0392910874e-05 2969 -147883.943605 +0.00166389351082 0.21 9.64730965605e-06 2756 -164011.769478 +0.00166389351082 0.26 9.36027068951e-06 2674 -185269.891448 +0.00153609831029 0.01 3.8515728645e-05 11003 -123770.387931 +0.00153609831029 0.06 2.49688896142e-05 7133 -128091.830366 +0.00153609831029 0.11 2.32851610421e-05 6652 -136294.98644 +0.00153609831029 0.16 1.02983980436e-05 2942 -147386.510811 +0.00153609831029 0.21 9.5457958752e-06 2727 -163041.008511 +0.00153609831029 0.26 9.29376166067e-06 2655 -183709.061021 +0.00142653352354 0.01 3.8515728645e-05 11003 -123749.102871 +0.00142653352354 0.06 2.49058810605e-05 7115 -128075.01244 +0.00142653352354 0.11 2.31416415588e-05 6611 -136001.131042 +0.00142653352354 0.16 1.02353894899e-05 2924 -146903.81051 +0.00142653352354 0.21 9.47928684637e-06 2708 -162098.394101 +0.00142653352354 0.26 9.25175595825e-06 2643 -182193.860222 +0.00133155792277 0.01 3.8515728645e-05 11003 -123728.487688 +0.00133155792277 0.06 2.48603748829e-05 7102 -128059.993762 +0.00133155792277 0.11 2.3005123026e-05 6572 -135719.486568 +0.00133155792277 0.16 1.02003847379e-05 2914 -146436.359234 +0.00133155792277 0.21 9.45478351995e-06 2701 -161185.806103 +0.00133155792277 0.26 9.20274930543e-06 2629 -180726.466436 +0.00124843945069 0.01 3.8515728645e-05 11003 -123708.547453 +0.00124843945069 0.06 2.48008668045e-05 7085 -128046.541504 +0.00124843945069 0.11 2.28756054435e-05 6535 -135450.081087 +0.00124843945069 0.16 1.01548785603e-05 2901 -145985.230141 +0.00124843945069 0.21 9.42327924314e-06 2692 -160305.087766 +0.00124843945069 0.26 9.16074360301e-06 2617 -179308.351525 +0.00117508813161 0.01 3.8515728645e-05 11003 -123689.279935 +0.00117508813161 0.06 2.47868649037e-05 7081 -128034.561912 +0.00117508813161 0.11 2.28160973651e-05 6518 -135192.964325 +0.00117508813161 0.16 1.01268747587e-05 2893 -145551.545254 +0.00117508813161 0.21 9.39527544152e-06 2684 -159455.291746 +0.00117508813161 0.26 9.143241227e-06 2612 -177939.864686 +0.00110987791343 0.01 3.8515728645e-05 11003 -123670.677164 +0.00110987791343 0.06 2.47798639533e-05 7079 -128023.999863 +0.00110987791343 0.11 2.27565892866e-05 6501 -134947.82767 +0.00110987791343 0.16 1.01233742835e-05 2892 -145134.5904 +0.00110987791343 0.21 9.36727163991e-06 2676 -158637.136007 +0.00110987791343 0.26 9.11173695018e-06 2603 -176621.039252 +0.00105152471083 0.01 3.8515728645e-05 11003 -123652.726752 +0.00105152471083 0.06 2.47833644285e-05 7080 -128014.765967 +0.00105152471083 0.11 2.27180840594e-05 6490 -134714.216344 +0.00105152471083 0.16 1.01198738083e-05 2891 -144734.666853 +0.00105152471083 0.21 9.31826498709e-06 2662 -157850.354392 +0.00105152471083 0.26 9.09773504938e-06 2599 -175350.75358 +0.000999000999001 0.01 3.8515728645e-05 11003 -123635.413008 +0.000999000999001 0.06 2.47903653789e-05 7082 -128006.791321 +0.000999000999001 0.11 2.2676078357e-05 6478 -134491.529528 +0.000999000999001 0.16 1.01233742835e-05 2892 -144351.334533 +0.000999000999001 0.21 9.30776356148e-06 2659 -157094.280552 +0.000999000999001 0.26 9.08373314857e-06 2595 -174128.660041 +0.000951474785918 0.01 3.8515728645e-05 11003 -123618.717857 +0.000951474785918 0.06 2.48428725069e-05 7097 -127999.981476 +0.000951474785918 0.11 2.26515750306e-05 6471 -134279.290806 +0.000951474785918 0.16 1.01233742835e-05 2892 -143984.865476 +0.000951474785918 0.21 9.29026118547e-06 2654 -156368.171358 +0.000951474785918 0.26 9.07323172296e-06 2592 -172953.757184 +0.000908265213442 0.01 3.8515728645e-05 11003 -123602.621581 +0.000908265213442 0.06 2.48953796349e-05 7112 -127994.231404 +0.000908265213442 0.11 2.25920669522e-05 6454 -134076.949739 +0.000908265213442 0.16 1.01443771347e-05 2898 -143634.545541 +0.000908265213442 0.21 9.26575785906e-06 2647 -155671.043274 +0.000908265213442 0.26 9.06623077256e-06 2590 -171824.644585 +0.000868809730669 0.01 3.8515728645e-05 11003 -123587.103413 +0.000868809730669 0.06 2.49443862877e-05 7126 -127989.461569 +0.000868809730669 0.11 2.25570622001e-05 6444 -133883.962178 +0.000868809730669 0.16 1.01758814115e-05 2907 -143299.665917 +0.000868809730669 0.21 9.25525643345e-06 2644 -155002.200578 +0.000868809730669 0.26 9.04872839655e-06 2585 -170739.524766 +0.000832639467111 0.01 3.8515728645e-05 11003 -123572.142012 +0.000832639467111 0.06 2.50073948414e-05 7144 -127985.596586 +0.000832639467111 0.11 2.25220574481e-05 6434 -133699.968853 +0.000832639467111 0.16 1.02038852131e-05 2915 -142979.790752 +0.000832639467111 0.21 9.24125453265e-06 2640 -154360.980091 +0.000832639467111 0.26 9.03822697095e-06 2582 -169696.958922 +0.000799360511591 0.01 3.8515728645e-05 11003 -123557.715827 +0.000799360511591 0.06 2.51159095726e-05 7175 -127982.458687 +0.000799360511591 0.11 2.24835522209e-05 6423 -133524.505228 +0.000799360511591 0.16 1.02563923412e-05 2930 -142674.075617 +0.000799360511591 0.21 9.20975025583e-06 2631 -153745.957633 +0.000799360511591 0.26 9.03122602054e-06 2580 -168695.245238 +0.000768639508071 0.01 3.8515728645e-05 11003 -123543.803383 +0.000768639508071 0.06 2.52314252543e-05 7208 -127979.952917 +0.000768639508071 0.11 2.24660498449e-05 6418 -133357.245685 +0.000768639508071 0.16 1.03264018452e-05 2950 -142381.972499 +0.000768639508071 0.21 9.20975025583e-06 2631 -153156.162422 +0.000768639508071 0.26 9.02422507014e-06 2578 -167733.098492 +0.000740192450037 0.01 3.8515728645e-05 11003 -123530.383494 +0.000740192450037 0.06 2.53679437872e-05 7247 -127977.816252 +0.000740192450037 0.11 2.24345455681e-05 6409 -133197.755027 +0.000740192450037 0.16 1.03824094484e-05 2966 -142102.721258 +0.000740192450037 0.21 9.20274930543e-06 2629 -152590.672649 +0.000740192450037 0.26 9.02072459494e-06 2577 -166808.866572 +0.000713775874375 0.01 3.8515728645e-05 11003 -123517.435427 +0.000713775874375 0.06 2.56094765761e-05 7316 -127975.826604 +0.000713775874375 0.11 2.24170431921e-05 6404 -133045.684928 +0.000713775874375 0.16 1.04839232293e-05 2995 -141835.601579 +0.000713775874375 0.21 9.19574835502e-06 2627 -152048.271335 +0.000713775874375 0.26 9.02072459494e-06 2577 -165920.771959 +0.000689179875948 0.01 3.8515728645e-05 11003 -123504.939011 +0.000689179875948 0.06 2.58650112658e-05 7389 -127973.609355 +0.000689179875948 0.11 2.23995408161e-05 6399 -132900.661674 +0.000689179875948 0.16 1.0721955543e-05 3063 -141579.675834 +0.000689179875948 0.21 9.18874740462e-06 2625 -151528.012156 +0.000689179875948 0.26 9.01722411973e-06 2576 -165067.303276 +0.000666222518321 0.01 3.8515728645e-05 11003 -123492.874726 +0.000666222518321 0.06 2.6215058786e-05 7489 -127970.651261 +0.000666222518321 0.11 2.23750374897e-05 6392 -132762.365466 +0.000666222518321 0.16 1.08934788279e-05 3112 -141334.372583 +0.000666222518321 0.21 9.18524692942e-06 2624 -151028.867776 +0.000666222518321 0.26 9.01372364453e-06 2575 -164246.939075 +0.000644745325596 0.01 3.8515728645e-05 11003 -123481.223752 +0.000644745325596 0.06 2.67786352935e-05 7650 -127966.105927 +0.000644745325596 0.11 2.23575351136e-05 6387 -132630.436034 +0.000644745325596 0.16 1.12890325257e-05 3225 -141098.532437 +0.000644745325596 0.21 9.18174645422e-06 2623 -150549.84494 +0.000644745325596 0.26 9.01022316933e-06 2574 -163458.100266 +0.000624609618988 0.01 3.8515728645e-05 11003 -123469.968004 +0.000624609618988 0.06 2.74892317594e-05 7853 -127958.890425 +0.000624609618988 0.11 2.23540346384e-05 6386 -132504.588063 +0.000624609618988 0.16 1.16810857483e-05 3337 -140870.949007 +0.000624609618988 0.21 9.18174645422e-06 2623 -150090.010494 +0.000624609618988 0.26 9.01022316933e-06 2574 -162699.412987 +0.000605693519079 0.01 3.8515728645e-05 11003 -123459.090145 +0.000605693519079 0.06 2.86023828736e-05 8171 -127947.357796 +0.000605693519079 0.11 2.23505341632e-05 6385 -132384.523076 +0.000605693519079 0.16 2.20599947215e-05 6302 -140172.148483 +0.000605693519079 0.21 9.17824597902e-06 2622 -149648.541114 +0.000605693519079 0.26 9.01022316933e-06 2574 -161969.508897 +0.000587889476778 0.01 3.8515728645e-05 11003 -123448.573592 +0.000587889476778 0.06 3.8515728645e-05 11003 -127839.267974 +0.000587889476778 0.11 2.23435332128e-05 6383 -132269.951696 +0.000587889476778 0.16 2.20564942463e-05 6301 -139882.725006 +0.000587889476778 0.21 9.17124502861e-06 2620 -149224.571924 +0.000587889476778 0.26 9.01022316933e-06 2574 -161267.008798 +0.000571102227299 0.01 3.8515728645e-05 11003 -123438.40251 +0.000571102227299 0.06 3.8515728645e-05 11003 -127751.26231 +0.000571102227299 0.11 2.23330317872e-05 6380 -132160.594735 +0.000571102227299 0.16 2.20494932959e-05 6299 -139604.441279 +0.000571102227299 0.21 9.17124502861e-06 2620 -148817.278052 +0.000571102227299 0.26 9.01022316933e-06 2574 -160590.653801 +0.000555247084953 0.01 3.8515728645e-05 11003 -123428.561796 +0.000555247084953 0.06 3.8515728645e-05 11003 -127666.129138 +0.000555247084953 0.11 2.23330317872e-05 6380 -132056.200673 +0.000555247084953 0.16 2.20459928207e-05 6298 -139336.756971 +0.000555247084953 0.21 9.17124502861e-06 2620 -148425.880209 +0.000555247084953 0.26 9.01022316933e-06 2574 -159939.288342 +0.000540248514317 0.01 3.8515728645e-05 11003 -123419.037061 +0.000540248514317 0.06 3.8515728645e-05 11003 -127583.742794 +0.000540248514317 0.11 2.23330317872e-05 6380 -131956.525736 +0.000540248514317 0.16 2.20459928207e-05 6298 -139079.200799 +0.000540248514317 0.21 9.17124502861e-06 2620 -148049.635599 +0.000540248514317 0.26 9.01022316933e-06 2574 -159311.772584 +0.000526038926881 0.01 3.8515728645e-05 11003 -123409.814609 +0.000526038926881 0.06 3.8515728645e-05 11003 -127503.983671 +0.000526038926881 0.11 2.23330317872e-05 6380 -131861.337656 +0.000526038926881 0.16 2.20459928207e-05 6298 -138831.298421 +0.000526038926881 0.21 9.17474550381e-06 2621 -147687.838972 +0.000526038926881 0.26 9.01022316933e-06 2574 -158707.010743 +0.000512557662737 0.01 3.8515728645e-05 11003 -123400.881408 +0.000512557662737 0.06 3.8515728645e-05 11003 -127426.738005 +0.000512557662737 0.11 2.23330317872e-05 6380 -131770.417295 +0.000512557662737 0.16 2.20459928207e-05 6298 -138592.600667 +0.000512557662737 0.21 9.17824597902e-06 2622 -147339.819976 +0.000512557662737 0.26 9.01022316933e-06 2574 -158123.963368 +0.000499750124938 0.01 3.8515728645e-05 11003 -123392.225068 +0.000499750124938 0.06 3.8515728645e-05 11003 -127351.897633 +0.000499750124938 0.11 2.23330317872e-05 6380 -131683.557847 +0.000499750124938 0.16 2.20459928207e-05 6298 -138362.682539 +0.000499750124938 0.21 9.18174645422e-06 2623 -147004.946181 +0.000499750124938 0.26 9.01022316933e-06 2574 -157561.644748 +0.000487567040468 0.01 3.8515728645e-05 11003 -123383.833813 +0.000487567040468 0.06 3.8515728645e-05 11003 -127279.359761 +0.000487567040468 0.11 2.2347033688e-05 6384 -131600.559807 +0.000487567040468 0.16 2.20459928207e-05 6298 -138141.141883 +0.000487567040468 0.21 9.18174645422e-06 2623 -146682.617371 +0.000487567040468 0.26 9.01022316933e-06 2574 -157019.120333 +0.000475963826749 0.01 3.8515728645e-05 11003 -123375.696447 +0.000475963826749 0.06 3.8515728645e-05 11003 -127209.026713 +0.000475963826749 0.11 2.23505341632e-05 6385 -131521.235501 +0.000475963826749 0.16 2.20459928207e-05 6298 -137927.598114 +0.000475963826749 0.21 9.18524692942e-06 2624 -146372.263394 +0.000475963826749 0.26 9.01022316933e-06 2574 -156495.504177 +0.00046490004649 0.01 3.8515728645e-05 11003 -123367.802335 +0.00046490004649 0.06 3.8515728645e-05 11003 -127140.805691 +0.00046490004649 0.11 2.23540346384e-05 6386 -131445.413268 +0.00046490004649 0.16 2.20459928207e-05 6298 -137721.691004 +0.00046490004649 0.21 9.19224787982e-06 2626 -146073.344106 +0.00046490004649 0.26 9.01022316933e-06 2574 -155989.956444 +0.000454338936847 0.01 3.8515728645e-05 11003 -123360.14137 +0.000454338936847 0.06 3.8515728645e-05 11003 -127074.608531 +0.000454338936847 0.11 2.23575351136e-05 6387 -131372.926863 +0.000454338936847 0.16 2.20459928207e-05 6298 -137523.079525 +0.000454338936847 0.21 9.19574835502e-06 2627 -145785.343138 +0.000454338936847 0.26 9.01022316933e-06 2574 -155501.68098 +0.000444247001333 0.01 3.8515728645e-05 11003 -123352.703946 +0.000444247001333 0.06 3.8515728645e-05 11003 -127010.351474 +0.000444247001333 0.11 2.23750374897e-05 6392 -131303.614261 +0.000444247001333 0.16 2.20459928207e-05 6298 -137331.440744 +0.000444247001333 0.21 9.20274930543e-06 2629 -145507.777544 +0.000444247001333 0.26 9.01022316933e-06 2574 -155029.922974 +0.000434593654933 0.01 3.8515728645e-05 11003 -123345.480937 +0.000434593654933 0.06 3.8515728645e-05 11003 -126947.954935 +0.000434593654933 0.11 2.23995408161e-05 6399 -131237.307733 +0.000434593654933 0.16 2.20459928207e-05 6298 -137146.468788 +0.000434593654933 0.21 9.20624978063e-06 2630 -145240.189011 +0.000434593654933 0.26 9.01022316933e-06 2574 -154573.966711 +0.000425350914504 0.01 3.8515728645e-05 11003 -123338.463666 +0.000425350914504 0.06 3.8515728645e-05 11003 -126887.343287 +0.000425350914504 0.11 2.24100422417e-05 6402 -131173.882544 +0.000425350914504 0.16 2.20459928207e-05 6298 -136967.873854 +0.000425350914504 0.21 9.20975025583e-06 2631 -144982.141452 +0.000425350914504 0.26 9.01022316933e-06 2574 -154133.133418 +0.000416493127863 0.01 3.8515728645e-05 11003 -123331.643887 +0.000416493127863 0.06 3.8515728645e-05 11003 -126828.444645 +0.000416493127863 0.11 2.24310450929e-05 6408 -131113.187985 +0.000416493127863 0.16 2.20459928207e-05 6298 -136795.381276 +0.000416493127863 0.21 9.22725263184e-06 2636 -144733.219475 +0.000416493127863 0.26 9.01022316933e-06 2574 -153706.779219 +0.000407996736026 0.01 3.8515728645e-05 11003 -123325.013756 +0.000407996736026 0.06 3.8515728645e-05 11003 -126771.190675 +0.000407996736026 0.11 2.24520479441e-05 6414 -131055.104332 +0.000407996736026 0.16 2.20459928207e-05 6298 -136628.730649 +0.000407996736026 0.21 9.25175595825e-06 2643 -144492.991238 +0.000407996736026 0.26 9.01022316933e-06 2574 -153294.293183 +0.000399840063974 0.01 3.8515728645e-05 11003 -123318.565815 +0.000399840063974 0.06 3.8515728645e-05 11003 -126715.516392 +0.000399840063974 0.11 2.24800517457e-05 6422 -130999.4905 +0.000399840063974 0.16 2.20459928207e-05 6298 -136467.675003 +0.000399840063974 0.21 9.25525643345e-06 2644 -144261.11202 +0.000399840063974 0.26 9.01022316933e-06 2574 -152895.095477 +0.000392003136025 0.01 3.8515728645e-05 11003 -123312.292967 +0.000392003136025 0.06 3.8515728645e-05 11003 -126661.359985 +0.000392003136025 0.11 2.24975541217e-05 6427 -130946.256478 +0.000392003136025 0.16 2.20459928207e-05 6298 -136311.980018 +0.000392003136025 0.21 9.27275880946e-06 2649 -144037.238634 +0.000392003136025 0.26 9.01022316933e-06 2574 -152508.635614 +0.000384467512495 0.01 3.8515728645e-05 11003 -123306.188458 +0.000384467512495 0.06 3.8515728645e-05 11003 -126608.662642 +0.000384467512495 0.11 2.25395598241e-05 6439 -130895.25983 +0.000384467512495 0.16 2.20459928207e-05 6298 -136161.423299 +0.000384467512495 0.21 9.29376166067e-06 2655 -143821.009234 +0.000384467512495 0.26 9.01022316933e-06 2574 -152134.3908 +0.000377216144851 0.01 3.8515728645e-05 11003 -123300.24586 +0.000377216144851 0.06 3.8515728645e-05 11003 -126557.368387 +0.000377216144851 0.11 2.25640631505e-05 6446 -130846.402384 +0.000377216144851 0.16 2.20459928207e-05 6298 -136015.793682 +0.000377216144851 0.21 9.30776356148e-06 2659 -143612.108344 +0.000377216144851 0.26 9.01022316933e-06 2574 -151771.864372 +0.000370233246946 0.01 3.8515728645e-05 11003 -123294.459048 +0.000370233246946 0.06 3.8515728645e-05 11003 -126507.423923 +0.000370233246946 0.11 2.26025683778e-05 6457 -130799.589015 +0.000370233246946 0.16 2.20459928207e-05 6298 -135874.890588 +0.000370233246946 0.21 9.31826498709e-06 2662 -143410.238041 +0.000370233246946 0.26 9.01022316933e-06 2574 -151420.584324 +0.000363504180298 0.01 3.8515728645e-05 11003 -123288.822191 +0.000363504180298 0.06 3.8515728645e-05 11003 -126458.778489 +0.000363504180298 0.11 2.26515750306e-05 6471 -130754.698153 +0.000363504180298 0.16 2.20459928207e-05 6298 -135738.523416 +0.000363504180298 0.21 9.3497692639e-06 2671 -143215.100937 +0.000363504180298 0.26 9.01022316933e-06 2574 -151080.10192 +0.00035701535166 0.01 3.8515728645e-05 11003 -123283.32973 +0.00035701535166 0.06 3.8515728645e-05 11003 -126411.383721 +0.00035701535166 0.11 2.26655769314e-05 6475 -130711.662918 +0.00035701535166 0.16 2.20459928207e-05 6298 -135606.510976 +0.00035701535166 0.21 9.38827449112e-06 2682 -143026.381007 +0.00035701535166 0.26 9.01022316933e-06 2574 -150749.990387 +0.000350754121361 0.01 3.8515728645e-05 11003 -123277.976366 +0.000350754121361 0.06 3.8515728645e-05 11003 -126365.193519 +0.000350754121361 0.11 2.27075826338e-05 6487 -130670.424176 +0.000350754121361 0.16 2.20459928207e-05 6298 -135478.680949 +0.000350754121361 0.21 9.39527544152e-06 2684 -142843.849985 +0.000350754121361 0.26 9.01022316933e-06 2574 -150429.843684 +0.000344708721131 0.01 3.8515728645e-05 11003 -123272.757045 +0.000344708721131 0.06 3.8515728645e-05 11003 -126320.163929 +0.000344708721131 0.11 2.2728585485e-05 6493 -130630.878711 +0.000344708721131 0.16 2.20459928207e-05 6298 -135354.869386 +0.000344708721131 0.21 9.43028019354e-06 2694 -142667.271736 +0.000344708721131 0.26 9.01022316933e-06 2574 -150119.275349 +0.000338868180278 0.01 3.8515728645e-05 11003 -123267.666946 +0.000338868180278 0.06 3.8515728645e-05 11003 -126276.253024 +0.000338868180278 0.11 2.27600897618e-05 6502 -130592.950678 +0.000338868180278 0.16 2.20459928207e-05 6298 -135234.920239 +0.000338868180278 0.21 9.45478351995e-06 2701 -142496.384338 +0.000338868180278 0.26 9.01022316933e-06 2574 -149817.917405 +0.000333222259247 0.01 3.8515728645e-05 11003 -123262.701467 +0.000333222259247 0.06 3.8515728645e-05 11003 -126233.420794 +0.000333222259247 0.11 2.28090964147e-05 6516 -130556.567033 +0.000333222259247 0.16 2.20459928207e-05 6298 -135118.684917 +0.000333222259247 0.21 9.45478351995e-06 2701 -142331.005235 +0.000333222259247 0.26 9.01022316933e-06 2574 -149525.419341 +0.000327761389708 0.01 3.8515728645e-05 11003 -123257.856213 +0.000327761389708 0.06 3.8515728645e-05 11003 -126191.629048 +0.000327761389708 0.11 2.28546025923e-05 6529 -130521.621248 +0.000327761389708 0.16 2.20459928207e-05 6298 -135006.02187 +0.000327761389708 0.21 9.48978827197e-06 2711 -142170.889413 +0.000327761389708 0.26 9.01022316933e-06 2574 -149241.447151 +0.000322476620445 0.01 3.8515728645e-05 11003 -123253.126989 +0.000322476620445 0.06 3.8515728645e-05 11003 -126150.841312 +0.000322476620445 0.11 2.29281125715e-05 6550 -130488.028127 +0.000322476620445 0.16 2.20459928207e-05 6298 -134896.796203 +0.000322476620445 0.21 9.58080062722e-06 2737 -142015.745308 +0.000322476620445 0.26 9.01022316933e-06 2574 -148965.682428 +0.000317359568391 0.01 3.8515728645e-05 11003 -123248.509784 +0.000317359568391 0.06 3.8515728645e-05 11003 -126111.022741 +0.000317359568391 0.11 2.307513253e-05 6592 -130455.58444 +0.000317359568391 0.16 2.20459928207e-05 6298 -134790.879304 +0.000317359568391 0.21 9.68231440807e-06 2766 -141865.285555 +0.000317359568391 0.26 9.01022316933e-06 2574 -148697.821515 +0.000312402374258 0.01 3.8515728645e-05 11003 -123244.000766 +0.000312402374258 0.06 3.8515728645e-05 11003 -126072.140034 +0.000312402374258 0.11 2.32466558149e-05 6641 -130424.142528 +0.000312402374258 0.16 2.20459928207e-05 6298 -134688.148508 +0.000312402374258 0.21 9.72081963529e-06 2777 -141719.346067 +0.000312402374258 0.26 9.01022316933e-06 2574 -148437.574705 +0.000307597662258 0.01 3.8515728645e-05 11003 -123239.596267 +0.000307597662258 0.06 3.8515728645e-05 11003 -126034.16135 +0.000307597662258 0.11 2.33166653189e-05 6661 -130393.680332 +0.000307597662258 0.16 2.20459928207e-05 6298 -134588.486769 +0.000307597662258 0.21 9.90984529618e-06 2831 -141577.652099 +0.000307597662258 0.26 9.01022316933e-06 2574 -148184.665493 +0.000302938503484 0.01 3.8515728645e-05 11003 -123235.292781 +0.000302938503484 0.06 3.8515728645e-05 11003 -125997.056234 +0.000302938503484 0.11 2.3421679575e-05 6691 -130364.271651 +0.000302938503484 0.16 2.20459928207e-05 6298 -134491.782362 +0.000302938503484 0.21 1.01128728579e-05 2889 -141439.804483 +0.000302938503484 0.26 9.01022316933e-06 2574 -147938.82987 +0.000298418382572 0.01 3.8515728645e-05 11003 -123231.086953 +0.000298418382572 0.06 3.8515728645e-05 11003 -125960.795546 +0.000298418382572 0.11 2.36107052359e-05 6745 -130335.709073 +0.000298418382572 0.16 2.20459928207e-05 6298 -134397.928592 +0.000298418382572 0.21 1.04734218037e-05 2992 -141305.543426 +0.000298418382572 0.26 9.01022316933e-06 2574 -147699.815654 +0.000294031167304 0.01 3.8515728645e-05 11003 -123226.975569 +0.000294031167304 0.06 3.8515728645e-05 11003 -125925.351392 +0.000294031167304 0.11 2.37962304216e-05 6798 -130307.885758 +0.000294031167304 0.16 2.20459928207e-05 6298 -134306.823534 +0.000294031167304 0.21 2.20459928207e-05 6298 -140302.623287 +0.000294031167304 0.26 9.01022316933e-06 2574 -147467.381871 +0.000289771080846 0.01 3.8515728645e-05 11003 -123222.955551 +0.000289771080846 0.06 3.8515728645e-05 11003 -125890.697061 +0.000289771080846 0.11 2.42932979002e-05 6940 -130280.12242 +0.000289771080846 0.16 2.20459928207e-05 6298 -134218.369775 +0.000289771080846 0.21 2.20459928207e-05 6298 -140130.234721 +0.000289771080846 0.26 9.01022316933e-06 2574 -147241.298166 +0.000285632676378 0.01 3.8515728645e-05 11003 -123219.023952 +0.000285632676378 0.06 3.8515728645e-05 11003 -125856.806966 +0.000285632676378 0.11 2.48218696557e-05 7091 -130252.156363 +0.000285632676378 0.16 2.20459928207e-05 6298 -134132.474182 +0.000285632676378 0.21 2.20459928207e-05 6298 -139962.286336 +0.000285632676378 0.26 9.01022316933e-06 2574 -147021.344249 +0.000281610813855 0.01 3.8515728645e-05 11003 -123215.177945 +0.000281610813855 0.06 3.8515728645e-05 11003 -125823.656586 +0.000281610813855 0.11 2.57739989106e-05 7363 -130223.240547 +0.000281610813855 0.16 2.20459928207e-05 6298 -134049.047679 +0.000281610813855 0.21 2.20459928207e-05 6298 -139798.627718 +0.000281610813855 0.26 9.01022316933e-06 2574 -146807.309373 +0.000277700638711 0.01 3.8515728645e-05 11003 -123211.414821 +0.000277700638711 0.06 3.8515728645e-05 11003 -125791.222413 +0.000277700638711 0.11 3.8515728645e-05 11003 -129821.260853 +0.000277700638711 0.16 2.20459928207e-05 6298 -133968.005035 +0.000277700638711 0.21 2.20459928207e-05 6298 -139639.114871 +0.000277700638711 0.26 9.01022316933e-06 2574 -146598.991849 +0.000273897562312 0.01 3.8515728645e-05 11003 -123207.73198 +0.000273897562312 0.06 3.8515728645e-05 11003 -125759.481903 +0.000273897562312 0.11 3.8515728645e-05 11003 -129745.485331 +0.000273897562312 0.16 2.20459928207e-05 6298 -133889.264669 +0.000273897562312 0.21 2.20459928207e-05 6298 -139483.609895 +0.000273897562312 0.26 9.01022316933e-06 2574 -146396.19858 +0.000270197243988 0.01 3.8515728645e-05 11003 -123204.126929 +0.000270197243988 0.06 3.8515728645e-05 11003 -125728.413428 +0.000270197243988 0.11 3.8515728645e-05 11003 -129671.319484 +0.000270197243988 0.16 2.20459928207e-05 6298 -133812.748467 +0.000270197243988 0.21 2.20459928207e-05 6298 -139331.98067 +0.000270197243988 0.26 9.01022316933e-06 2574 -146198.744629 +0.000266595574513 0.01 3.8515728645e-05 11003 -123200.597274 +0.000266595574513 0.06 3.8515728645e-05 11003 -125697.996228 +0.000266595574513 0.11 3.8515728645e-05 11003 -129598.713435 +0.000266595574513 0.16 2.20459928207e-05 6298 -133738.381601 +0.000266595574513 0.21 2.20459928207e-05 6298 -139184.100577 +0.000266595574513 0.26 9.01022316933e-06 2574 -146006.452804 +0.000263088660879 0.01 3.8515728645e-05 11003 -123197.140715 +0.000263088660879 0.06 3.8515728645e-05 11003 -125668.210377 +0.000263088660879 0.11 3.8515728645e-05 11003 -129527.619302 +0.000263088660879 0.16 2.20459928207e-05 6298 -133666.092371 +0.000263088660879 0.21 2.20459928207e-05 6298 -139039.848215 +0.000263088660879 0.26 9.01022316933e-06 2574 -145819.153281 +0.000259672812257 0.01 3.8515728645e-05 11003 -123193.755046 +0.000259672812257 0.06 3.8515728645e-05 11003 -125639.036732 +0.000259672812257 0.11 3.8515728645e-05 11003 -129457.991107 +0.000259672812257 0.16 2.20459928207e-05 6298 -133595.812045 +0.000259672812257 0.21 2.20459928207e-05 6298 -138899.10715 +0.000259672812257 0.26 9.01022316933e-06 2574 -145636.683228 +0.000256344527044 0.01 3.8515728645e-05 11003 -123190.438144 +0.000256344527044 0.06 3.8515728645e-05 11003 -125610.456906 +0.000256344527044 0.11 3.8515728645e-05 11003 -129389.78468 +0.000256344527044 0.16 2.20459928207e-05 6298 -133527.474714 +0.000256344527044 0.21 2.20459928207e-05 6298 -138761.765671 +0.000256344527044 0.26 9.01022316933e-06 2574 -145458.886472 +0.000253100480891 0.01 3.8515728645e-05 11003 -123187.18797 +0.000253100480891 0.06 3.8515728645e-05 11003 -125582.453225 +0.000253100480891 0.11 3.8515728645e-05 11003 -129322.957573 +0.000253100480891 0.16 2.20459928207e-05 6298 -133461.017155 +0.000253100480891 0.21 2.20459928207e-05 6298 -138627.716556 +0.000253100480891 0.26 9.01022316933e-06 2574 -145285.613165 diff --git a/experiments/process.py b/experiments/process.py index 5c4c215..98406d6 100644 --- a/experiments/process.py +++ b/experiments/process.py @@ -11,11 +11,11 @@ if __name__ == "__main__": sys.exit("usage: {0} <file>".format(sys.argv[0])) root_victims, victims, non_victims, age = load(open(sys.argv[1])) - alpha = 1. / np.arange(1., 1000., 100.) # parameter of the time component - delta = np.arange(0.01, 0.9, 0.1) # parameter of the structural component + alphas = 1. / np.arange(1., 4000., 50.) # parameter of the time component + deltas = np.arange(0.01, 0.3, 0.05) # parameter of the structural component with open("out.log", "w") as fh: - for a, d in product(alpha, delta): - beta, roots, ll = ml(root_victims, victims, non_victims, age, a, d) - print "\t".join(map(str, [a, d, beta, roots, ll, exp(ll)])) - fh.write("\t".join(map(str, [a, d, beta, roots, ll])) + "\n") + for alpha, delta in product(alphas, deltas): + beta, roots, ll = ml(root_victims, victims, non_victims, age, alpha, delta) + print "\t".join(map(str, [1/alpha, delta, beta, roots, ll, exp(ll)])) + fh.write("\t".join(map(str, [alpha, delta, beta, roots, ll])) + "\n") fh.flush() |
