Oblynx / HierarchicalTemporalMemory.jl

A simple, high-level Julia implementation of Numenta HTM algorithms
https://oblynx.github.io/HierarchicalTemporalMemory.jl
MIT License
21 stars 3 forks source link

SP inhibition tiebreaker: account for rounding error #45

Closed Oblynx closed 3 years ago

Oblynx commented 3 years ago

27 assumed that 1 of the tied minicolumns should win and maximized that probability. Actually, < 1 should win on average: 1 - k() + s*area to be precise.

With this in mind redo the calculations and account for the rounding error.

Oblynx commented 3 years ago

Let r_err = 1 - k() + s*a (s: sparsity, a: area), then r_err < 1 wins per area is the probability to maximize. That means tuning t to make the mean of the probability distribution P(X=x) -> r_err.

Since for each tied minicolumn (how many?) whether it's selected is an independent experiment, it's a binomial distribution {n,p}. In general n!=a since most minicolumns are either far above or far below the tie and don't contend. t=1-p A very rough estimate of n could be k/2.

n*p = r_err => p= r_err/n => t= 1-r_err/n

Oblynx commented 3 years ago

Estimate the tied minicolumns: tieEst(o,Z)= count(o .== Z) * area()/prod(szₛₚ)