summaryrefslogtreecommitdiffstats
path: root/experiments/ml3.c
diff options
context:
space:
mode:
authorBen Green <ben@SEASITs-MacBook-Pro.local>2015-07-02 00:41:49 -0400
committerBen Green <ben@SEASITs-MacBook-Pro.local>2015-07-02 00:41:49 -0400
commit375f29ab4306821c888fd9ef0637f9ab2879e375 (patch)
tree30d1c40e429abda8c9cbae953b719543f9cd9cc8 /experiments/ml3.c
parent8e09ca6ca68c71bdab65525b529e2adfa281823c (diff)
downloadcriminal_cascades-375f29ab4306821c888fd9ef0637f9ab2879e375.tar.gz
in which the model works!!
Diffstat (limited to 'experiments/ml3.c')
-rw-r--r--experiments/ml3.c964
1 files changed, 467 insertions, 497 deletions
diff --git a/experiments/ml3.c b/experiments/ml3.c
index 59de174..7ad3edb 100644
--- a/experiments/ml3.c
+++ b/experiments/ml3.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 weight_success(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta,
+ * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta,
*/
typedef __pyx_t_5numpy_float_t __pyx_t_3ml3_DTYPE_t;
#if CYTHON_CCOMPLEX
@@ -1169,8 +1169,8 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, cha
/* Module declarations from 'libc.math' */
/* Module declarations from 'ml3' */
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int, int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int, int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_3ml3_DTYPE_t = { "DTYPE_t", NULL, sizeof(__pyx_t_3ml3_DTYPE_t), { 0 }, 0, 'R', 0, 0 };
#define __Pyx_MODULE_NAME "ml3"
int __pyx_module_is_main_ml3 = 0;
@@ -1217,7 +1217,7 @@ static char __pyx_k_sum[] = "sum";
static char __pyx_k_beta[] = "beta";
static char __pyx_k_dist[] = "dist";
static char __pyx_k_main[] = "__main__";
-static char __pyx_k_ones[] = "ones";
+static char __pyx_k_prnt[] = "prnt";
static char __pyx_k_prob[] = "prob";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_DTYPE[] = "DTYPE";
@@ -1233,7 +1233,6 @@ static char __pyx_k_seeds[] = "seeds";
static char __pyx_k_zeros[] = "zeros";
static char __pyx_k_arange[] = "arange";
static char __pyx_k_import[] = "__import__";
-static char __pyx_k_isSeed[] = "isSeed";
static char __pyx_k_thresh[] = "thresh";
static char __pyx_k_float64[] = "float64";
static char __pyx_k_n_roots[] = "n_roots";
@@ -1287,7 +1286,6 @@ static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_kp_s_inf;
-static PyObject *__pyx_n_s_isSeed;
static PyObject *__pyx_n_s_itervalues;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_ll;
@@ -1304,10 +1302,10 @@ static PyObject *__pyx_n_s_non_seeds;
static PyObject *__pyx_n_s_non_victims;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numpy;
-static PyObject *__pyx_n_s_ones;
static PyObject *__pyx_n_s_parent_dists;
static PyObject *__pyx_n_s_parent_dts;
static PyObject *__pyx_n_s_parents;
+static PyObject *__pyx_n_s_prnt;
static PyObject *__pyx_n_s_prob;
static PyObject *__pyx_n_s_probs;
static PyObject *__pyx_n_s_probs_fail;
@@ -1327,9 +1325,8 @@ static PyObject *__pyx_n_s_w1;
static PyObject *__pyx_n_s_w2;
static PyObject *__pyx_n_s_w3;
static PyObject *__pyx_n_s_zeros;
-static PyObject *__pyx_float_1_;
-static PyObject *__pyx_float_0_00001;
-static PyObject *__pyx_int_0;
+static PyObject *__pyx_float__01;
+static PyObject *__pyx_float_0_01;
static PyObject *__pyx_int_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
@@ -1344,12 +1341,12 @@ static PyObject *__pyx_codeobj__9;
/* "ml3.pyx":9
* ctypedef np.float_t DTYPE_t
*
- * cdef DTYPE_t weight_success(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for successful infection, exponential time model"""
*/
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, __pyx_t_3ml3_DTYPE_t __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, int __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
__pyx_t_3ml3_DTYPE_t __pyx_v_structural;
__pyx_t_3ml3_DTYPE_t __pyx_v_temporal;
__pyx_t_3ml3_DTYPE_t __pyx_v_result;
@@ -1389,7 +1386,7 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, __pyx_
* result = log(structural) + temporal
* return result # <<<<<<<<<<<<<<
*
- * cdef DTYPE_t weight_failure(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta,
+ * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, DTYPE_t delta,
*/
__pyx_r = __pyx_v_result;
goto __pyx_L0;
@@ -1397,7 +1394,7 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, __pyx_
/* "ml3.pyx":9
* ctypedef np.float_t DTYPE_t
*
- * cdef DTYPE_t weight_success(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for successful infection, exponential time model"""
*/
@@ -1411,12 +1408,12 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, __pyx_
/* "ml3.pyx":18
* return result
*
- * cdef DTYPE_t weight_failure(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for failed infection, exponential time model"""
*/
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int __pyx_v_dist, __pyx_t_3ml3_DTYPE_t __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int __pyx_v_dist, int __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
__pyx_t_3ml3_DTYPE_t __pyx_v_structural;
__pyx_t_3ml3_DTYPE_t __pyx_v_temporal;
__pyx_t_3ml3_DTYPE_t __pyx_v_result;
@@ -1464,7 +1461,7 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int __pyx_v_dist, __pyx_
/* "ml3.pyx":18
* return result
*
- * cdef DTYPE_t weight_failure(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for failed infection, exponential time model"""
*/
@@ -1608,20 +1605,18 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
PyArrayObject *__pyx_v_probs_fail = 0;
PyArrayObject *__pyx_v_parent_dists = 0;
PyArrayObject *__pyx_v_parent_dts = 0;
- PyArrayObject *__pyx_v_isSeed = 0;
PyObject *__pyx_v_dists = NULL;
PyObject *__pyx_v_dts = NULL;
PyObject *__pyx_v_s = NULL;
PyObject *__pyx_v_prob = NULL;
- CYTHON_UNUSED double __pyx_v_thresh;
+ double __pyx_v_thresh;
PyObject *__pyx_v_seeds = NULL;
PyObject *__pyx_v_non_seeds = NULL;
int __pyx_v_max_roots;
+ CYTHON_UNUSED PyObject *__pyx_v_prnt = NULL;
PyObject *__pyx_v_w1 = NULL;
PyObject *__pyx_v_w2 = NULL;
PyObject *__pyx_v_w3 = NULL;
- __Pyx_LocalBuf_ND __pyx_pybuffernd_isSeed;
- __Pyx_Buffer __pyx_pybuffer_isSeed;
__Pyx_LocalBuf_ND __pyx_pybuffernd_parent_dists;
__Pyx_Buffer __pyx_pybuffer_parent_dists;
__Pyx_LocalBuf_ND __pyx_pybuffernd_parent_dts;
@@ -1642,11 +1637,11 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
PyArrayObject *__pyx_t_8 = NULL;
PyArrayObject *__pyx_t_9 = NULL;
PyArrayObject *__pyx_t_10 = NULL;
- PyArrayObject *__pyx_t_11 = NULL;
+ int __pyx_t_11;
int __pyx_t_12;
int __pyx_t_13;
- int __pyx_t_14;
- Py_ssize_t __pyx_t_15;
+ Py_ssize_t __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
PyObject *__pyx_t_18 = NULL;
@@ -1686,10 +1681,6 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_pybuffer_parent_dts.refcount = 0;
__pyx_pybuffernd_parent_dts.data = NULL;
__pyx_pybuffernd_parent_dts.rcbuffer = &__pyx_pybuffer_parent_dts;
- __pyx_pybuffer_isSeed.pybuffer.buf = NULL;
- __pyx_pybuffer_isSeed.refcount = 0;
- __pyx_pybuffernd_isSeed.data = NULL;
- __pyx_pybuffernd_isSeed.rcbuffer = &__pyx_pybuffer_isSeed;
/* "ml3.pyx":33
* DTYPE_t beta, ll, beta_add, max_beta, max_beta_add
@@ -1804,7 +1795,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
* np.ndarray[DTYPE_t] probs_fail = np.zeros(n_victims, dtype=DTYPE)
* np.ndarray[DTYPE_t] parent_dists = np.zeros(n_victims, dtype=DTYPE) # <<<<<<<<<<<<<<
* np.ndarray[DTYPE_t] parent_dts = np.zeros(n_victims, dtype=DTYPE)
- * np.ndarray[DTYPE_t] isSeed = np.ones(n_victims, dtype=DTYPE)
+ *
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
@@ -1847,8 +1838,8 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
* np.ndarray[DTYPE_t] probs_fail = np.zeros(n_victims, dtype=DTYPE)
* np.ndarray[DTYPE_t] parent_dists = np.zeros(n_victims, dtype=DTYPE)
* np.ndarray[DTYPE_t] parent_dts = np.zeros(n_victims, dtype=DTYPE) # <<<<<<<<<<<<<<
- * np.ndarray[DTYPE_t] isSeed = np.ones(n_victims, dtype=DTYPE)
*
+ * # loop through victims
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
@@ -1887,134 +1878,93 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_v_parent_dts = ((PyArrayObject *)__pyx_t_6);
__pyx_t_6 = 0;
- /* "ml3.pyx":39
- * np.ndarray[DTYPE_t] parent_dists = np.zeros(n_victims, dtype=DTYPE)
- * np.ndarray[DTYPE_t] parent_dts = np.zeros(n_victims, dtype=DTYPE)
- * np.ndarray[DTYPE_t] isSeed = np.ones(n_victims, dtype=DTYPE) # <<<<<<<<<<<<<<
- *
- * # loop through victims
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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 = 39; __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 = 39; __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 = 39; __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 = 39; __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 = 39; __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 = 39; __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 = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
- {
- __Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_isSeed.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_3ml3_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
- __pyx_v_isSeed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_isSeed.rcbuffer->pybuffer.buf = NULL;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else {__pyx_pybuffernd_isSeed.diminfo[0].strides = __pyx_pybuffernd_isSeed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_isSeed.diminfo[0].shape = __pyx_pybuffernd_isSeed.rcbuffer->pybuffer.shape[0];
- }
- }
- __pyx_t_11 = 0;
- __pyx_v_isSeed = ((PyArrayObject *)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "ml3.pyx":42
+ /* "ml3.pyx":41
*
* # loop through victims
* for i, parents in enumerate(victims.itervalues()): # <<<<<<<<<<<<<<
* # for each victim node i, compute the probability that all its parents
* # fail to infect it, also computes the probability that its most
*/
- __pyx_t_12 = 0;
+ __pyx_t_11 = 0;
__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 = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_victims, 1, __pyx_n_s_itervalues, (&__pyx_t_1), (&__pyx_t_13)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_4);
- __pyx_t_4 = __pyx_t_6;
- __pyx_t_6 = 0;
+ __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_victims, 1, __pyx_n_s_itervalues, (&__pyx_t_1), (&__pyx_t_12)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_6);
+ __pyx_t_6 = __pyx_t_3;
+ __pyx_t_3 = 0;
while (1) {
- __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_1, &__pyx_t_2, NULL, &__pyx_t_6, NULL, __pyx_t_13);
- if (unlikely(__pyx_t_14 == 0)) break;
- if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_XDECREF_SET(__pyx_v_parents, ((PyObject*)__pyx_t_6));
- __pyx_t_6 = 0;
- __pyx_v_i = __pyx_t_12;
- __pyx_t_12 = (__pyx_t_12 + 1);
+ __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_1, &__pyx_t_2, NULL, &__pyx_t_3, NULL, __pyx_t_12);
+ if (unlikely(__pyx_t_13 == 0)) break;
+ if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_XDECREF_SET(__pyx_v_parents, ((PyObject*)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __pyx_v_i = __pyx_t_11;
+ __pyx_t_11 = (__pyx_t_11 + 1);
- /* "ml3.pyx":46
+ /* "ml3.pyx":45
* # fail to infect it, also computes the probability that its most
* # likely parent infects it
- * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
- * for (dist, dt, w1, w2, w3) in parents]
+ * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
*/
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
- /* "ml3.pyx":47
+ /* "ml3.pyx":46
* # likely parent infects it
- * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3)
- * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
+ * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3)
+ * for (prnt, dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
*/
if (unlikely(__pyx_v_parents == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_5 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
+ __pyx_t_5 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_5); __pyx_t_14 = 0;
for (;;) {
- if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
+ if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
+ if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+ PyObject* sequence = __pyx_t_4;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
- if (unlikely(size != 5)) {
- if (size > 5) __Pyx_RaiseTooManyValuesError(5);
+ if (unlikely(size != 6)) {
+ if (size > 6) __Pyx_RaiseTooManyValuesError(6);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_19 = PyTuple_GET_ITEM(sequence, 3);
- __pyx_t_20 = PyTuple_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_18 = PyTuple_GET_ITEM(sequence, 3);
+ __pyx_t_19 = PyTuple_GET_ITEM(sequence, 4);
+ __pyx_t_20 = PyTuple_GET_ITEM(sequence, 5);
} else {
- __pyx_t_16 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_18 = PyList_GET_ITEM(sequence, 2);
- __pyx_t_19 = PyList_GET_ITEM(sequence, 3);
- __pyx_t_20 = PyList_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_18 = PyList_GET_ITEM(sequence, 3);
+ __pyx_t_19 = PyList_GET_ITEM(sequence, 4);
+ __pyx_t_20 = PyList_GET_ITEM(sequence, 5);
}
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(__pyx_t_16);
__Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(__pyx_t_18);
@@ -2023,28 +1973,28 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
#else
{
Py_ssize_t i;
- PyObject** temps[5] = {&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
- for (i=0; i < 5; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
+ for (i=0; i < 6; i++) {
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
- PyObject** temps[5] = {&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
- __pyx_t_21 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
+ __pyx_t_21 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_22 = Py_TYPE(__pyx_t_21)->tp_iternext;
- for (index=0; index < 5; index++) {
+ for (index=0; index < 6; index++) {
PyObject* item = __pyx_t_22(__pyx_t_21); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_22 = NULL;
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
goto __pyx_L8_unpacking_done;
@@ -2052,14 +2002,16 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
__pyx_t_22 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L8_unpacking_done:;
}
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 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 = 47; __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 = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_v_dist = __pyx_t_14;
+ __Pyx_XDECREF_SET(__pyx_v_prnt, __pyx_t_15);
+ __pyx_t_15 = 0;
+ __pyx_v_dist = __pyx_t_13;
__pyx_v_dt = __pyx_t_23;
__Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_18);
__pyx_t_18 = 0;
@@ -2068,94 +2020,94 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_20);
__pyx_t_20 = 0;
- /* "ml3.pyx":46
+ /* "ml3.pyx":45
* # fail to infect it, also computes the probability that its most
* # likely parent infects it
- * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
- * for (dist, dt, w1, w2, w3) in parents]
+ * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_w1); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_w2); if (unlikely((__pyx_t_25 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_w3); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3ml3_weight_failure(__pyx_v_dist, (__pyx_v_dt / 100.), __pyx_v_alpha, __pyx_v_delta, __pyx_t_24, __pyx_t_25, __pyx_t_26)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_w1); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_w2); if (unlikely((__pyx_t_25 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_w3); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyFloat_FromDouble(__pyx_f_3ml3_weight_failure(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_t_24, __pyx_t_25, __pyx_t_26)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "ml3.pyx":47
+ /* "ml3.pyx":46
* # likely parent infects it
- * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3)
- * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
+ * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3)
+ * for (prnt, dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
*/
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF_SET(__pyx_v_failures, ((PyObject*)__pyx_t_6));
- __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_failures, ((PyObject*)__pyx_t_3));
+ __pyx_t_3 = 0;
- /* "ml3.pyx":48
- * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3)
- * for (dist, dt, w1, w2, w3) in parents]
+ /* "ml3.pyx":47
+ * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3)
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures) # <<<<<<<<<<<<<<
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
- * for (dist, dt, w1, w2, w3) in parents]
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
*/
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_failures);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_failures);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_failures);
__Pyx_GIVEREF(__pyx_v_failures);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __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_fail.diminfo[0].shape;
*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs_fail.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_probs_fail.diminfo[0].strides) = __pyx_t_26;
- /* "ml3.pyx":49
- * for (dist, dt, w1, w2, w3) in parents]
+ /* "ml3.pyx":48
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
- * for (dist, dt, w1, w2, w3) in parents]
- * dists = [dist for (dist, dt, w1, w2, w3) in parents]
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
+ * dists = [dist for (prnt, dist, dt, w1, w2, w3) in parents]
*/
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- /* "ml3.pyx":50
+ /* "ml3.pyx":49
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
- * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
- * dists = [dist for (dist, dt, w1, w2, w3) in parents]
- * dts = [dt for (dist, dt, w1, w2, w3) in parents]
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * for (prnt, dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
+ * dists = [dist for (prnt, dist, dt, w1, w2, w3) in parents]
+ * dts = [dt for (prnt, dist, dt, w1, w2, w3) in parents]
*/
if (unlikely(__pyx_v_parents == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_6 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0;
+ __pyx_t_3 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0;
for (;;) {
- if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_6)) break;
+ if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
+ if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+ PyObject* sequence = __pyx_t_4;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
- if (unlikely(size != 5)) {
- if (size > 5) __Pyx_RaiseTooManyValuesError(5);
+ if (unlikely(size != 6)) {
+ if (size > 6) __Pyx_RaiseTooManyValuesError(6);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -2164,43 +2116,46 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_17 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_16 = PyTuple_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyTuple_GET_ITEM(sequence, 5);
} else {
__pyx_t_20 = PyList_GET_ITEM(sequence, 0);
__pyx_t_19 = PyList_GET_ITEM(sequence, 1);
__pyx_t_18 = PyList_GET_ITEM(sequence, 2);
__pyx_t_17 = PyList_GET_ITEM(sequence, 3);
__pyx_t_16 = PyList_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyList_GET_ITEM(sequence, 5);
}
__Pyx_INCREF(__pyx_t_20);
__Pyx_INCREF(__pyx_t_19);
__Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
#else
{
Py_ssize_t i;
- PyObject** temps[5] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16};
- for (i=0; i < 5; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16,&__pyx_t_15};
+ for (i=0; i < 6; i++) {
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
- PyObject** temps[5] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16};
- __pyx_t_21 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16,&__pyx_t_15};
+ __pyx_t_21 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_22 = Py_TYPE(__pyx_t_21)->tp_iternext;
- for (index=0; index < 5; index++) {
+ for (index=0; index < 6; index++) {
PyObject* item = __pyx_t_22(__pyx_t_21); if (unlikely(!item)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_22 = NULL;
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
goto __pyx_L12_unpacking_done;
@@ -2208,96 +2163,101 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
__pyx_t_22 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L12_unpacking_done:;
}
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_20); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
- __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_19); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_19); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __pyx_v_dist = __pyx_t_14;
+ __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_18); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_prnt, __pyx_t_20);
+ __pyx_t_20 = 0;
+ __pyx_v_dist = __pyx_t_13;
__pyx_v_dt = __pyx_t_27;
- __Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_18);
- __pyx_t_18 = 0;
- __Pyx_XDECREF_SET(__pyx_v_w2, __pyx_t_17);
+ __Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_17);
__pyx_t_17 = 0;
- __Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_16);
+ __Pyx_XDECREF_SET(__pyx_v_w2, __pyx_t_16);
__pyx_t_16 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_15);
+ __pyx_t_15 = 0;
- /* "ml3.pyx":49
- * for (dist, dt, w1, w2, w3) in parents]
+ /* "ml3.pyx":48
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
- * for (dist, dt, w1, w2, w3) in parents]
- * dists = [dist for (dist, dt, w1, w2, w3) in parents]
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
+ * dists = [dist for (prnt, dist, dt, w1, w2, w3) in parents]
*/
- __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_w1); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_w2); if (unlikely((__pyx_t_25 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_w3); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3ml3_weight_success(__pyx_v_dist, (__pyx_v_dt / 100.), __pyx_v_alpha, __pyx_v_delta, __pyx_t_26, __pyx_t_25, __pyx_t_24)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_w1); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_w2); if (unlikely((__pyx_t_25 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_w3); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyFloat_FromDouble(__pyx_f_3ml3_weight_success(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_t_26, __pyx_t_25, __pyx_t_24)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "ml3.pyx":50
+ /* "ml3.pyx":49
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
- * for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
- * dists = [dist for (dist, dt, w1, w2, w3) in parents]
- * dts = [dt for (dist, dt, w1, w2, w3) in parents]
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * for (prnt, dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
+ * dists = [dist for (prnt, dist, dt, w1, w2, w3) in parents]
+ * dts = [dt for (prnt, dist, dt, w1, w2, w3) in parents]
*/
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_successes, ((PyObject*)__pyx_t_5));
__pyx_t_5 = 0;
- /* "ml3.pyx":51
- * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
- * for (dist, dt, w1, w2, w3) in parents]
- * dists = [dist for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
- * dts = [dt for (dist, dt, w1, w2, w3) in parents]
+ /* "ml3.pyx":50
+ * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
+ * dists = [dist for (prnt, dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
+ * dts = [dt for (prnt, dist, dt, w1, w2, w3) in parents]
* # find parent that maximizes log(p) - log(\tilde{p})
*/
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__pyx_v_parents == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_6 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0;
+ __pyx_t_3 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0;
for (;;) {
- if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_6)) break;
+ if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
+ if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+ PyObject* sequence = __pyx_t_4;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
- if (unlikely(size != 5)) {
- if (size > 5) __Pyx_RaiseTooManyValuesError(5);
+ if (unlikely(size != 6)) {
+ if (size > 6) __Pyx_RaiseTooManyValuesError(6);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_19 = PyTuple_GET_ITEM(sequence, 3);
- __pyx_t_20 = PyTuple_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_18 = PyTuple_GET_ITEM(sequence, 3);
+ __pyx_t_19 = PyTuple_GET_ITEM(sequence, 4);
+ __pyx_t_20 = PyTuple_GET_ITEM(sequence, 5);
} else {
- __pyx_t_16 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_18 = PyList_GET_ITEM(sequence, 2);
- __pyx_t_19 = PyList_GET_ITEM(sequence, 3);
- __pyx_t_20 = PyList_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_18 = PyList_GET_ITEM(sequence, 3);
+ __pyx_t_19 = PyList_GET_ITEM(sequence, 4);
+ __pyx_t_20 = PyList_GET_ITEM(sequence, 5);
}
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(__pyx_t_16);
__Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(__pyx_t_18);
@@ -2306,28 +2266,28 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
#else
{
Py_ssize_t i;
- PyObject** temps[5] = {&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
- for (i=0; i < 5; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
+ for (i=0; i < 6; i++) {
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
- PyObject** temps[5] = {&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
- __pyx_t_21 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_15,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18,&__pyx_t_19,&__pyx_t_20};
+ __pyx_t_21 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_22 = Py_TYPE(__pyx_t_21)->tp_iternext;
- for (index=0; index < 5; index++) {
+ for (index=0; index < 6; index++) {
PyObject* item = __pyx_t_22(__pyx_t_21); if (unlikely(!item)) goto __pyx_L15_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_22 = NULL;
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
goto __pyx_L16_unpacking_done;
@@ -2335,62 +2295,64 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
__pyx_t_22 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L16_unpacking_done:;
}
- __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_17); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_17); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_prnt, __pyx_t_15);
+ __pyx_t_15 = 0;
__pyx_v_dist = __pyx_t_27;
- __pyx_v_dt = __pyx_t_14;
+ __pyx_v_dt = __pyx_t_13;
__Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_18);
__pyx_t_18 = 0;
__Pyx_XDECREF_SET(__pyx_v_w2, __pyx_t_19);
__pyx_t_19 = 0;
__Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_20);
__pyx_t_20 = 0;
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dist); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_dist); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_dists, ((PyObject*)__pyx_t_5));
__pyx_t_5 = 0;
- /* "ml3.pyx":52
- * for (dist, dt, w1, w2, w3) in parents]
- * dists = [dist for (dist, dt, w1, w2, w3) in parents]
- * dts = [dt for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
+ /* "ml3.pyx":51
+ * for (prnt, dist, dt, w1, w2, w3) in parents]
+ * dists = [dist for (prnt, dist, dt, w1, w2, w3) in parents]
+ * dts = [dt for (prnt, dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* # find parent that maximizes log(p) - log(\tilde{p})
* # probs[i] = max(s - failures[l] for l, s in enumerate(successes))
*/
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__pyx_v_parents == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_6 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0;
+ __pyx_t_3 = __pyx_v_parents; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0;
for (;;) {
- if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_6)) break;
+ if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
+ if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+ PyObject* sequence = __pyx_t_4;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
- if (unlikely(size != 5)) {
- if (size > 5) __Pyx_RaiseTooManyValuesError(5);
+ if (unlikely(size != 6)) {
+ if (size > 6) __Pyx_RaiseTooManyValuesError(6);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -2399,43 +2361,46 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_17 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_16 = PyTuple_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyTuple_GET_ITEM(sequence, 5);
} else {
__pyx_t_20 = PyList_GET_ITEM(sequence, 0);
__pyx_t_19 = PyList_GET_ITEM(sequence, 1);
__pyx_t_18 = PyList_GET_ITEM(sequence, 2);
__pyx_t_17 = PyList_GET_ITEM(sequence, 3);
__pyx_t_16 = PyList_GET_ITEM(sequence, 4);
+ __pyx_t_15 = PyList_GET_ITEM(sequence, 5);
}
__Pyx_INCREF(__pyx_t_20);
__Pyx_INCREF(__pyx_t_19);
__Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
#else
{
Py_ssize_t i;
- PyObject** temps[5] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16};
- for (i=0; i < 5; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16,&__pyx_t_15};
+ for (i=0; i < 6; i++) {
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
- PyObject** temps[5] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16};
- __pyx_t_21 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[6] = {&__pyx_t_20,&__pyx_t_19,&__pyx_t_18,&__pyx_t_17,&__pyx_t_16,&__pyx_t_15};
+ __pyx_t_21 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_22 = Py_TYPE(__pyx_t_21)->tp_iternext;
- for (index=0; index < 5; index++) {
+ for (index=0; index < 6; index++) {
PyObject* item = __pyx_t_22(__pyx_t_21); if (unlikely(!item)) goto __pyx_L19_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_22 = NULL;
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
goto __pyx_L20_unpacking_done;
@@ -2443,79 +2408,81 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
__pyx_t_22 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L20_unpacking_done:;
}
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_20); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
- __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_19); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_19); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __pyx_v_dist = __pyx_t_14;
+ __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_18); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_prnt, __pyx_t_20);
+ __pyx_t_20 = 0;
+ __pyx_v_dist = __pyx_t_13;
__pyx_v_dt = __pyx_t_27;
- __Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_18);
- __pyx_t_18 = 0;
- __Pyx_XDECREF_SET(__pyx_v_w2, __pyx_t_17);
+ __Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_17);
__pyx_t_17 = 0;
- __Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_16);
+ __Pyx_XDECREF_SET(__pyx_v_w2, __pyx_t_16);
__pyx_t_16 = 0;
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_w3, __pyx_t_15);
+ __pyx_t_15 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_dt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_dts, ((PyObject*)__pyx_t_5));
__pyx_t_5 = 0;
- /* "ml3.pyx":55
+ /* "ml3.pyx":54
* # find parent that maximizes log(p) - log(\tilde{p})
* # probs[i] = max(s - failures[l] for l, s in enumerate(successes))
* probs[i] = float("-inf") # <<<<<<<<<<<<<<
* for l, s in enumerate(successes):
* prob = s - failures[l]
*/
- __pyx_t_28 = __Pyx_PyObject_AsDouble(__pyx_kp_s_inf); if (unlikely(__pyx_t_28 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyObject_AsDouble(__pyx_kp_s_inf); if (unlikely(__pyx_t_28 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_27 = __pyx_v_i;
if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_pybuffernd_probs.diminfo[0].shape;
*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_probs.diminfo[0].strides) = __pyx_t_28;
- /* "ml3.pyx":56
+ /* "ml3.pyx":55
* # probs[i] = max(s - failures[l] for l, s in enumerate(successes))
* probs[i] = float("-inf")
* for l, s in enumerate(successes): # <<<<<<<<<<<<<<
* prob = s - failures[l]
* if prob > probs[i]:
*/
- __pyx_t_14 = 0;
- __pyx_t_5 = __pyx_v_successes; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_5 = __pyx_v_successes; __Pyx_INCREF(__pyx_t_5); __pyx_t_14 = 0;
for (;;) {
- if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
+ if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_v_l = __pyx_t_14;
- __pyx_t_14 = (__pyx_t_14 + 1);
+ __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_v_l = __pyx_t_13;
+ __pyx_t_13 = (__pyx_t_13 + 1);
- /* "ml3.pyx":57
+ /* "ml3.pyx":56
* probs[i] = float("-inf")
* for l, s in enumerate(successes):
* prob = s - failures[l] # <<<<<<<<<<<<<<
* if prob > probs[i]:
* probs[i] = prob
*/
- __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_failures, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_s, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_failures, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_prob, __pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_prob, __pyx_t_4);
+ __pyx_t_4 = 0;
- /* "ml3.pyx":58
+ /* "ml3.pyx":57
* for l, s in enumerate(successes):
* prob = s - failures[l]
* if prob > probs[i]: # <<<<<<<<<<<<<<
@@ -2524,52 +2491,52 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_t_29 = __pyx_v_i;
if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_pybuffernd_probs.diminfo[0].shape;
- __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_probs.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_prob, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_probs.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_prob, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_30) {
- /* "ml3.pyx":59
+ /* "ml3.pyx":58
* prob = s - failures[l]
* if prob > probs[i]:
* probs[i] = prob # <<<<<<<<<<<<<<
* parent_dists[i] = dists[l]
* parent_dts[i] = dts[l]
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_prob); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_prob); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_31 = __pyx_v_i;
if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_probs.diminfo[0].shape;
*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_probs.diminfo[0].strides) = __pyx_t_24;
- /* "ml3.pyx":60
+ /* "ml3.pyx":59
* if prob > probs[i]:
* probs[i] = prob
* parent_dists[i] = dists[l] # <<<<<<<<<<<<<<
* parent_dts[i] = dts[l]
* # probs_fail[i] = failures[l]
*/
- __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dists, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_dists, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_32 = __pyx_v_i;
if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_pybuffernd_parent_dists.diminfo[0].shape;
*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_parent_dists.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_parent_dists.diminfo[0].strides) = __pyx_t_24;
- /* "ml3.pyx":61
+ /* "ml3.pyx":60
* probs[i] = prob
* parent_dists[i] = dists[l]
* parent_dts[i] = dts[l] # <<<<<<<<<<<<<<
* # probs_fail[i] = failures[l]
*
*/
- __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dts, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__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_3 = __Pyx_GetItemInt_List(__pyx_v_dts, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_33 = __pyx_v_i;
if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_pybuffernd_parent_dts.diminfo[0].shape;
*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_parent_dts.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_parent_dts.diminfo[0].strides) = __pyx_t_24;
@@ -2577,7 +2544,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
}
__pyx_L23:;
- /* "ml3.pyx":56
+ /* "ml3.pyx":55
* # probs[i] = max(s - failures[l] for l, s in enumerate(successes))
* probs[i] = float("-inf")
* for l, s in enumerate(successes): # <<<<<<<<<<<<<<
@@ -2587,163 +2554,169 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "ml3.pyx":65
+ /* "ml3.pyx":64
*
* # calculate log likelihood
- * ll = probs_fail.sum() # add probability that all edges to all victims fail # <<<<<<<<<<<<<<
+ * ll = probs_fail.sum() # add probability that all edges to all victims fail # <<<<<<<<<<<<<<
*
* # print 'probs', probs
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_fail), __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_fail), __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
+ __pyx_t_3 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_6)) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- 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 = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__pyx_t_3) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_ll = __pyx_t_24;
- /* "ml3.pyx":68
+ /* "ml3.pyx":67
*
* # print 'probs', probs
* max_beta_add = float('-inf') # <<<<<<<<<<<<<<
* # iterate over all victim nodes to find the optimal threshold
- * for beta in np.arange(0.00001, 1., 1.):
+ * for beta in np.arange(0.01, 1, .01):
*/
- __pyx_t_28 = __Pyx_PyObject_AsDouble(__pyx_kp_s_inf); if (unlikely(__pyx_t_28 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyObject_AsDouble(__pyx_kp_s_inf); if (unlikely(__pyx_t_28 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_max_beta_add = __pyx_t_28;
- /* "ml3.pyx":70
+ /* "ml3.pyx":69
* max_beta_add = float('-inf')
* # iterate over all victim nodes to find the optimal threshold
- * for beta in np.arange(0.00001, 1., 1.): # <<<<<<<<<<<<<<
+ * for beta in np.arange(0.01, 1, .01): # <<<<<<<<<<<<<<
* thresh = log(beta/(3012.*(1.-beta)))
- * seeds = isSeed==1
+ * seeds = probs<thresh
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); 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);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
- __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
+ if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
+ __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
__pyx_t_34 = NULL;
} else {
- __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_34 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_34 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
for (;;) {
if (likely(!__pyx_t_34)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
}
} else {
- __pyx_t_4 = __pyx_t_34(__pyx_t_5);
- if (unlikely(!__pyx_t_4)) {
+ __pyx_t_6 = __pyx_t_34(__pyx_t_5);
+ if (unlikely(!__pyx_t_6)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_6);
}
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_beta = __pyx_t_24;
- /* "ml3.pyx":71
+ /* "ml3.pyx":70
* # iterate over all victim nodes to find the optimal threshold
- * for beta in np.arange(0.00001, 1., 1.):
+ * for beta in np.arange(0.01, 1, .01):
* thresh = log(beta/(3012.*(1.-beta))) # <<<<<<<<<<<<<<
- * seeds = isSeed==1
- * non_seeds = isSeed==0
+ * seeds = probs<thresh
+ * non_seeds = probs>=thresh
*/
__pyx_v_thresh = log((__pyx_v_beta / (3012. * (1. - __pyx_v_beta))));
- /* "ml3.pyx":72
- * for beta in np.arange(0.00001, 1., 1.):
+ /* "ml3.pyx":71
+ * for beta in np.arange(0.01, 1, .01):
* thresh = log(beta/(3012.*(1.-beta)))
- * seeds = isSeed==1 # <<<<<<<<<<<<<<
- * non_seeds = isSeed==0
+ * seeds = probs<thresh # <<<<<<<<<<<<<<
+ * non_seeds = probs>=thresh
* roots = n_roots + sum(seeds)
*/
- __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_isSeed), __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_XDECREF_SET(__pyx_v_seeds, __pyx_t_4);
- __pyx_t_4 = 0;
+ __pyx_t_6 = PyFloat_FromDouble(__pyx_v_thresh); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_probs), __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_seeds, __pyx_t_3);
+ __pyx_t_3 = 0;
- /* "ml3.pyx":73
+ /* "ml3.pyx":72
* thresh = log(beta/(3012.*(1.-beta)))
- * seeds = isSeed==1
- * non_seeds = isSeed==0 # <<<<<<<<<<<<<<
+ * seeds = probs<thresh
+ * non_seeds = probs>=thresh # <<<<<<<<<<<<<<
* roots = n_roots + sum(seeds)
*
*/
- __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_isSeed), __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_XDECREF_SET(__pyx_v_non_seeds, __pyx_t_4);
- __pyx_t_4 = 0;
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_v_thresh); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_probs), __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_non_seeds, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "ml3.pyx":74
- * seeds = isSeed==1
- * non_seeds = isSeed==0
+ /* "ml3.pyx":73
+ * seeds = probs<thresh
+ * non_seeds = probs>=thresh
* roots = n_roots + sum(seeds) # <<<<<<<<<<<<<<
*
* beta_add = 0.
*/
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_roots); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n_roots); 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);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_seeds);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_seeds);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seeds);
__Pyx_GIVEREF(__pyx_v_seeds);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); 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_6); __pyx_t_6 = 0;
- __pyx_v_roots = __pyx_t_12;
+ __pyx_v_roots = __pyx_t_11;
- /* "ml3.pyx":76
+ /* "ml3.pyx":75
* roots = n_roots + sum(seeds)
*
* beta_add = 0. # <<<<<<<<<<<<<<
@@ -2752,84 +2725,84 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_beta_add = 0.;
- /* "ml3.pyx":78
+ /* "ml3.pyx":77
* beta_add = 0.
* # add probability for realized edges and subtract probability these edges fail
* beta_add += (probs[non_seeds]).sum() # <<<<<<<<<<<<<<
* # add probability for the seeds and non-seeds
* beta_add += roots * log(beta/3012.) + sum(non_seeds) * log(1. - beta)
*/
- __pyx_t_6 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_probs), __pyx_v_non_seeds); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_probs), __pyx_v_non_seeds); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_16))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
- __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_15))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_15);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_16, function);
+ __Pyx_DECREF_SET(__pyx_t_15, function);
}
}
- if (__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
- __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_15); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_16); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_15); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_v_beta_add = __pyx_t_24;
- /* "ml3.pyx":80
+ /* "ml3.pyx":79
* beta_add += (probs[non_seeds]).sum()
* # add probability for the seeds and non-seeds
* beta_add += roots * log(beta/3012.) + sum(non_seeds) * log(1. - beta) # <<<<<<<<<<<<<<
*
* if beta_add > max_beta_add:
*/
- __pyx_t_16 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyFloat_FromDouble((__pyx_v_roots * log((__pyx_v_beta / 3012.)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_4 = PyFloat_FromDouble((__pyx_v_roots * log((__pyx_v_beta / 3012.)))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_non_seeds);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_non_seeds);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_non_seeds);
__Pyx_GIVEREF(__pyx_v_non_seeds);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyFloat_FromDouble(log((1. - __pyx_v_beta))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_17 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_17);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyFloat_FromDouble(log((1. - __pyx_v_beta))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_16 = PyNumber_Multiply(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_16, __pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __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_16); __pyx_t_16 = 0;
+ __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_16); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_17); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__pyx_v_beta_add = __pyx_t_24;
- /* "ml3.pyx":82
+ /* "ml3.pyx":81
* beta_add += roots * log(beta/3012.) + sum(non_seeds) * log(1. - beta)
*
* if beta_add > max_beta_add: # <<<<<<<<<<<<<<
@@ -2839,7 +2812,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_t_30 = ((__pyx_v_beta_add > __pyx_v_max_beta_add) != 0);
if (__pyx_t_30) {
- /* "ml3.pyx":83
+ /* "ml3.pyx":82
*
* if beta_add > max_beta_add:
* max_beta = beta # <<<<<<<<<<<<<<
@@ -2848,7 +2821,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_max_beta = __pyx_v_beta;
- /* "ml3.pyx":84
+ /* "ml3.pyx":83
* if beta_add > max_beta_add:
* max_beta = beta
* max_roots = roots # <<<<<<<<<<<<<<
@@ -2857,7 +2830,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_max_roots = __pyx_v_roots;
- /* "ml3.pyx":85
+ /* "ml3.pyx":84
* max_beta = beta
* max_roots = roots
* max_beta_add = beta_add # <<<<<<<<<<<<<<
@@ -2869,17 +2842,17 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
}
__pyx_L26:;
- /* "ml3.pyx":70
+ /* "ml3.pyx":69
* max_beta_add = float('-inf')
* # iterate over all victim nodes to find the optimal threshold
- * for beta in np.arange(0.00001, 1., 1.): # <<<<<<<<<<<<<<
+ * for beta in np.arange(0.01, 1, .01): # <<<<<<<<<<<<<<
* thresh = log(beta/(3012.*(1.-beta)))
- * seeds = isSeed==1
+ * seeds = probs<thresh
*/
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "ml3.pyx":88
+ /* "ml3.pyx":87
* # print 'beta:', max_beta, 'add:', max_beta_add, 'roots:', max_roots
*
* ll += max_beta_add # <<<<<<<<<<<<<<
@@ -2888,7 +2861,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_ll = (__pyx_v_ll + __pyx_v_max_beta_add);
- /* "ml3.pyx":89
+ /* "ml3.pyx":88
*
* ll += max_beta_add
* roots = max_roots # <<<<<<<<<<<<<<
@@ -2897,7 +2870,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_roots = __pyx_v_max_roots;
- /* "ml3.pyx":90
+ /* "ml3.pyx":89
* ll += max_beta_add
* roots = max_roots
* beta = max_beta # <<<<<<<<<<<<<<
@@ -2906,31 +2879,31 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_beta = __pyx_v_max_beta;
- /* "ml3.pyx":92
+ /* "ml3.pyx":91
* beta = max_beta
* # print n_nodes, n_roots, n_victims, max_i, roots
* 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 = 92; __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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_roots); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_17);
- __pyx_t_6 = PyFloat_FromDouble(__pyx_v_ll); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_roots); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_5);
+ __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_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_17);
- __Pyx_GIVEREF(__pyx_t_17);
- PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
__pyx_t_5 = 0;
- __pyx_t_17 = 0;
- __pyx_t_6 = 0;
- __pyx_r = __pyx_t_16;
__pyx_t_16 = 0;
+ __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_15;
+ __pyx_t_15 = 0;
goto __pyx_L0;
/* "ml3.pyx":27
@@ -2947,6 +2920,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
__Pyx_XDECREF(__pyx_t_18);
@@ -2955,7 +2929,6 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_XDECREF(__pyx_t_21);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_isSeed.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_parent_dists.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_parent_dts.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probs.rcbuffer->pybuffer);
@@ -2965,7 +2938,6 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_isSeed.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_parent_dists.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_parent_dts.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probs.rcbuffer->pybuffer);
@@ -2978,13 +2950,13 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_XDECREF((PyObject *)__pyx_v_probs_fail);
__Pyx_XDECREF((PyObject *)__pyx_v_parent_dists);
__Pyx_XDECREF((PyObject *)__pyx_v_parent_dts);
- __Pyx_XDECREF((PyObject *)__pyx_v_isSeed);
__Pyx_XDECREF(__pyx_v_dists);
__Pyx_XDECREF(__pyx_v_dts);
__Pyx_XDECREF(__pyx_v_s);
__Pyx_XDECREF(__pyx_v_prob);
__Pyx_XDECREF(__pyx_v_seeds);
__Pyx_XDECREF(__pyx_v_non_seeds);
+ __Pyx_XDECREF(__pyx_v_prnt);
__Pyx_XDECREF(__pyx_v_w1);
__Pyx_XDECREF(__pyx_v_w2);
__Pyx_XDECREF(__pyx_v_w3);
@@ -5042,7 +5014,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
{&__pyx_kp_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 0},
- {&__pyx_n_s_isSeed, __pyx_k_isSeed, sizeof(__pyx_k_isSeed), 0, 0, 1, 1},
{&__pyx_n_s_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 0, 0, 1, 1},
{&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
{&__pyx_n_s_ll, __pyx_k_ll, sizeof(__pyx_k_ll), 0, 0, 1, 1},
@@ -5059,10 +5030,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_non_victims, __pyx_k_non_victims, sizeof(__pyx_k_non_victims), 0, 0, 1, 1},
{&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
{&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
- {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
{&__pyx_n_s_parent_dists, __pyx_k_parent_dists, sizeof(__pyx_k_parent_dists), 0, 0, 1, 1},
{&__pyx_n_s_parent_dts, __pyx_k_parent_dts, sizeof(__pyx_k_parent_dts), 0, 0, 1, 1},
{&__pyx_n_s_parents, __pyx_k_parents, sizeof(__pyx_k_parents), 0, 0, 1, 1},
+ {&__pyx_n_s_prnt, __pyx_k_prnt, sizeof(__pyx_k_prnt), 0, 0, 1, 1},
{&__pyx_n_s_prob, __pyx_k_prob, sizeof(__pyx_k_prob), 0, 0, 1, 1},
{&__pyx_n_s_probs, __pyx_k_probs, sizeof(__pyx_k_probs), 0, 0, 1, 1},
{&__pyx_n_s_probs_fail, __pyx_k_probs_fail, sizeof(__pyx_k_probs_fail), 0, 0, 1, 1},
@@ -5085,8 +5056,8 @@ 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 = 42; __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 = 48; __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 = 41; __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__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;}
__pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -5099,14 +5070,14 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "ml3.pyx":70
+ /* "ml3.pyx":69
* max_beta_add = float('-inf')
* # iterate over all victim nodes to find the optimal threshold
- * for beta in np.arange(0.00001, 1., 1.): # <<<<<<<<<<<<<<
+ * for beta in np.arange(0.01, 1, .01): # <<<<<<<<<<<<<<
* thresh = log(beta/(3012.*(1.-beta)))
- * seeds = isSeed==1
+ * seeds = probs<thresh
*/
- __pyx_tuple_ = PyTuple_Pack(3, __pyx_float_0_00001, __pyx_float_1_, __pyx_float_1_); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(3, __pyx_float_0_01, __pyx_int_1, __pyx_float__01); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
@@ -5183,7 +5154,7 @@ static int __Pyx_InitCachedConstants(void) {
* DTYPE_t alpha, DTYPE_t delta):
* cdef:
*/
- __pyx_tuple__8 = PyTuple_Pack(38, __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_n_roots, __pyx_n_s_n_victims, __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_beta_add, __pyx_n_s_max_beta, __pyx_n_s_max_beta_add, __pyx_n_s_parents, __pyx_n_s_failures, __pyx_n_s_successes, __pyx_n_s_probs, __pyx_n_s_probs_fail, __pyx_n_s_parent_dists, __pyx_n_s_parent_dts, __pyx_n_s_isSeed, __pyx_n_s_dists, __pyx_n_s_dts, __pyx_n_s_s, __pyx_n_s_prob, __pyx_n_s_thresh, __pyx_n_s_seeds, __pyx_n_s_non_seeds, __pyx_n_s_max_roots, __pyx_n_s_w1, __pyx_n_s_w2, __pyx_n_s_w3); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__8 = PyTuple_Pack(38, __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_n_roots, __pyx_n_s_n_victims, __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_beta_add, __pyx_n_s_max_beta, __pyx_n_s_max_beta_add, __pyx_n_s_parents, __pyx_n_s_failures, __pyx_n_s_successes, __pyx_n_s_probs, __pyx_n_s_probs_fail, __pyx_n_s_parent_dists, __pyx_n_s_parent_dts, __pyx_n_s_dists, __pyx_n_s_dts, __pyx_n_s_s, __pyx_n_s_prob, __pyx_n_s_thresh, __pyx_n_s_seeds, __pyx_n_s_non_seeds, __pyx_n_s_max_roots, __pyx_n_s_prnt, __pyx_n_s_w1, __pyx_n_s_w2, __pyx_n_s_w3); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
__pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(6, 0, 38, 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_ml3, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -5196,9 +5167,8 @@ static int __Pyx_InitCachedConstants(void) {
static int __Pyx_InitGlobals(void) {
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_float_0_00001 = PyFloat_FromDouble(0.00001); if (unlikely(!__pyx_float_0_00001)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_float__01 = PyFloat_FromDouble(.01); if (unlikely(!__pyx_float__01)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
__pyx_L1_error:;