summaryrefslogtreecommitdiffstats
path: root/experiments/ml.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'experiments/ml.pyx')
-rw-r--r--experiments/ml.pyx2
1 files changed, 2 insertions, 0 deletions
diff --git a/experiments/ml.pyx b/experiments/ml.pyx
index c1a5616..9c570e9 100644
--- a/experiments/ml.pyx
+++ b/experiments/ml.pyx
@@ -6,6 +6,8 @@ from libc.math cimport log, exp
DTYPE = np.float64
ctypedef np.float_t DTYPE_t
+cdef DTYPE_t plogis(DTYPE_t weight, DTYPE_t delta):
+ return 1/(1 + exp(-weight/delta))
cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha,
DTYPE_t delta, DTYPE_t gamma):