In [22]:
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 [23]:
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 [24]:
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 [25]:
display("n=200000, a=2000, s=20, theta=10", subsampledFpF.subs(theta, 10).subs(s, 20).subs(n, 200000).subs(a, 2000).evalf())


'n=200000, a=2000, s=20, theta=10'
$$1.64978550434429 \cdot 10^{-15}$$

In [26]:
display("n=200000, a=2000, s=40, theta=10", subsampledFpF.subs(theta, 15).subs(s, 120).subs(n, 200000).subs(a, 2000).evalf())


'n=200000, a=2000, s=40, theta=10'
$$1.68540822540857 \cdot 10^{-12}$$

In [ ]: