In [2]:
from sympy import *
init_printing()
from IPython.display import display

%matplotlib inline

import matplotlib.pyplot as plt

Equation for Neuron Paper

  A dendritic segment can robustly classify a pattern by subsampling a small number of cells from a larger population.  Assuming a random distribution of patterns, the exact probability of a false match is given by the following equation:

In [3]:
oxp = Symbol("Omega_x'")
b = Symbol("b")
n = Symbol("n")
theta = Symbol("theta")
w = Symbol("w")
s = Symbol("s")
a = Symbol("a")

subsampledOmega = (binomial(s, b) * binomial(n - s, a - b)) / binomial(n, a)
subsampledFpF = Sum(subsampledOmega, (b, theta, s))
subsampledOmegaSlow = (binomial(s, b) * binomial(n - s, a - b)) 
subsampledFpFSlow = Sum(subsampledOmegaSlow, (b, theta, s))/ binomial(n, a)

display(subsampledFpF)
display(subsampledFpFSlow)


$$\sum_{b=\theta}^{s} \frac{{\binom{s}{b}}}{{\binom{n}{a}}} {\binom{n - s}{a - b}}$$
$$\frac{1}{{\binom{n}{a}}} \sum_{b=\theta}^{s} {\binom{s}{b}} {\binom{n - s}{a - b}}$$

where n refers to the size of the population of cells, a is the number of active cells at any instance in time, s is the number of actual synapses on a dendritic segment, and θ is the threshold for NMDA spikes. Following (Ahmad & Hawkins, 2015), the numerator counts the number of possible ways θ or more cells can match a fixed set of s synapses. The denominator counts the number of ways a cells out of n can be active.

Example usage


In [4]:
display("n=1024, a=8, s=4, omega=2", subsampledFpF.subs(s, 4).subs(n, 1024).subs(a, 8).subs(theta, 2).evalf())


'n=1024, a=8, s=4, omega=2'
$$0.000318241665415146$$

In [5]:
display("n=100000, a=2000, s=10, theta=10", subsampledFpFSlow.subs(theta, 10).subs(s, 10).subs(n, 100000).subs(a, 2000).evalf())


'n=100000, a=2000, s=10, theta=10'
$$1.00163216178113 \cdot 10^{-17}$$

In [7]:
display("n=2048, a=400, s=40, theta=20", subsampledFpF.subs(theta, 20).subs(s, 40).subs(n, 2048).subs(a, 400).evalf())


'n=2048, a=400, s=40, theta=20'
$$1.19954818128435 \cdot 10^{-5}$$

Table 1B


In [17]:
T1B = subsampledFpFSlow.subs(n, 100000).subs(a, 2000).subs(theta,s).evalf()
print "n=100000, a=2000, theta=s"
display("s=6",T1B.subs(s,6).evalf())
display("s=8",T1B.subs(s,8).evalf())
display("s=10",T1B.subs(s,10).evalf())


n=200000, a=2000, theta=s
's=6'
$$6.35308872941916 \cdot 10^{-11}$$
's=8'
$$2.52507239284961 \cdot 10^{-14}$$
's=10'
$$1.00163216178113 \cdot 10^{-17}$$

Table 1C


In [31]:
T1C = subsampledFpFSlow.subs(n, 100000).subs(a, 2000).subs(s,2*theta).evalf()
print "n=100000, a=2000, s=2*theta"
display("theta=6",T1C.subs(theta,6).evalf())
display("theta=8",T1C.subs(theta,8).evalf())
display("theta=10",T1C.subs(theta,10).evalf())
display("theta=12",T1C.subs(theta,12).evalf())


n=100000, a=2000, s=2*theta
'theta=6'
$$5.29386836275369 \cdot 10^{-8}$$
'theta=8'
$$2.81724528327272 \cdot 10^{-10}$$
'theta=10'
$$1.5419276725872 \cdot 10^{-12}$$
'theta=12'
$$8.58694100276592 \cdot 10^{-15}$$

Table 1D


In [29]:
m = Symbol("m")
T1D = subsampledFpF.subs(n, 100000).subs(a, 2000).subs(s,2*m*theta).evalf()
print "n=100000, a=2000, s=2*m*theta"
display("theta=10, m=2",T1D.subs(theta,10).subs(m,2).evalf())
display("theta=10, m=4",T1D.subs(theta,10).subs(m,4).evalf())
display("theta=10, m=6",T1D.subs(theta,10).subs(m,6).evalf())
display("theta=20, m=6",T1D.subs(theta,20).subs(m,6).evalf())


n=100000, a=2000, s=2*m*theta
'theta=10, m=2'
$$4.91541864813209 \cdot 10^{-9}$$
'theta=10, m=4'
$$4.62568448037595 \cdot 10^{-6}$$
'theta=10, m=6'
$$0.000158799793094937$$
'theta=20, m=6'
$$1.07990763941591 \cdot 10^{-7}$$

In [ ]: