 # Difference between two boost factor updates

Hi thogether,

I’m relatively new to HTM and currently studying the SPs learning phase, especially the boost factor update.

I watched Matts excellent HTM School, so I think I have a solid knowledge of the process as a whole. (My condolences for this great loss. I’d like to have gotten to know him.)

I found this paper linked in a post describing the math behind the algorithms (Mnatzaganian2016) and this Numenta paper (Cui2017).

Mnatzaganian et al. are describing the boost update like this:

\overrightarrow{b} \equiv \beta \left ( \overrightarrow{\eta_i^{(a)}}, \overrightarrow{\eta_i^{(min)}} \right )~\forall i

using the boost function \beta

\beta \left ( \overrightarrow{\eta_i^{(a)}}, \overrightarrow{\eta_i^{(min)}} \right ) \equiv \left\{\begin{matrix} \beta_0 & \overrightarrow{\eta_i^{(min)}} = 0\\ 1 & \overrightarrow{\eta_i^{(a)}} > \overrightarrow{\eta_i^{(min)}}\\ \overrightarrow{\eta_i^{(a)}} \frac{1-\beta_0}{\overrightarrow{\eta_i^{(min)}}} + \beta_0& \textrm{otherwise} \end{matrix}\right.

With:
b_0 is the user-defined Maximum boost,
\overrightarrow{\eta_i^{(a)}} is the active duty cycle for the i^{th} SP column,
\overrightarrow{\eta_i^{(min)}} \equiv \kappa_a ~\textrm{max}\left ( H_i \odot \overrightarrow{\eta^{(a)}} \right ) is the minimum active duty cycle for the i^{th} SP column, which equals the maximum active duty cycle of the neighborhood scaled by the user-defined minimum activity level scaling factor \kappa_a.
They mention that the calculation is done using a moving average of the active duty cycles, but don’t really describe it.

Cui et al. use a different way to update the boost factors:

\overrightarrow{b} = e^{-\beta~\left (~\overline{a}_i(t) ~-~ <\overline{a}_i(t)> ~\right )}, ~ \forall i

With:
\overline{a}_i(t) = \frac{(T-1) \cdot \overline{a}_i(t-1)+a_i(t)}{T} is the average activity of the i^{th} column at time t,

<\overline{a}_i(t)> = \frac{1}{\left | N_i \right |} \sum_{j\in N_i}{\overline{a}_j(t)} is the average of the average activity in the i^{th} column’s neighborhood N_i at time t

Note: a_i(t) is the active state of i^{th} column at time t and T the user-defined duty cycle period.

I have two questions:

1. When i understand it right, \overrightarrow{\eta_i^{(a)}} in Mnatzaganian et al. must be the moving average of the active duty cycle of the i^{th} column so that \overrightarrow{\eta_i^{(a)}} \in \mathbb{R} ∣ 0 < \overrightarrow{\eta_i^{(a)}} < 1. Or am I getting this wrong?
(As they don’t have a time component it might was hard to express this as a equation.)

2. Cui et al. state “The exact formula is not critical”. This sounds to me, like their nice e-function does not represent the real update? So to really define the boost factor update, it is better to use the equations of Mnatzaganian et al.

Qubitza

1 Like

Hello again,

I just looked into the code and found out, that all three implementations (NuPIC, htm.core and Etaler) use the exponential function to update the boost factors:

nupic > spatial_pooler.py:L1491

htm.core > SpatialPooler.cpp:L766

Etaler > Boost.hpp:L10

I just wonder why Cui et al. wrote:

\overrightarrow{b}=e^{-\beta~\left (~\overline{a}_i(t)~-~<\overline{a}_i(t)> \right )}

instead of (which is the same and all implementations are coded like this):

\overrightarrow{b}=e^{~\beta~\left (~<\overline{a}_i(t)>~-~\overline{a}_i(t)~\right )}

The moving average of the active duty cycles can also be found in code:

nupic > spatial_pooler.py:L1438

htm.core > SpatialPooler.cpp:L741-L747

Etaler > SpatialPooler.cpp:L49

Note: @marty1885 seems to have hard coded the duty cycle period T to 10 in Etaler.

As conclusion, the formulas of Cui et al. represent the real (in code) boost update including the moving average.

So I don’t understand why Mnatzaganian et al. split the boost update into this heavy boost function and only mentioned the moving average in their text.

Have a nice day,
Qubitza

2 Likes

Ohh… I forgot I did that in a hurry. Properly should fix it later

1 Like

Short update for those who are interested:

Mnatzaganian et al. were writing about their own implementation.

It is base on Numentas 2011 released HTM Whitepaper which was describing the HTM CLA. On page 38 of this document, the boostFunction is somehow described as Mnatzaganian et al. implemented it.

Since their paper is from 2016 they might have missed the new BAMI release suggesting a exponential boost update function. I just wonder why Cui et al. wrote:

\overrightarrow{b}=e^{-\beta~\left (~\overline{a}_i(t)~-~<\overline{a}_i(t)> \right )}

instead of (which is the same and all implementations are coded like this):

\overrightarrow{b}=e^{~\beta~\left (~<\overline{a}_i(t)>~-~\overline{a}_i(t)~\right )}

These two equations looks same to me

Sorry i miss the statement that you are saying that they are the same… i guess it’s nothing against nothing

No Problem. Maybe they just wanted to highlight that the exponential function is inverted or confuse the reader.