Question about Sparsity in Local Inhibition

I also have problem with the sparsity in Local Inhibition. Because I’ve read the code of nupic in github:

Inside this, the targetDensity is calculated based on the inhibition Radius. While, the Inhibition radius is base on the average span. For example, when I have 6464 columns -> the sparsity would be 82 (0.02 6464) columns activated. However, after calculating, the density for each Neighborhood is calculated 0.5 . That leads to the sparsity in whole region is nearly 0.564*64 columns activated. I have some confusion about this point that can we actually control the sparsity in the local Inhibition.

You can’t strictly control the global sparsity with nupic local inhibition implementation as you realized. You need an alternative approach such as this.