 Htm.core -- am I getting prediction density correctly?

Hi Guys!

My goal: to measure prediction density in TM within htm.core.
My question: am I doing it right? Here’s my current code:

I’m doing this in order to measure precision in TM.

I know I could technically achieve this by reporting either:

• number of predicted cells

• sparsity of predicted cells relative to the whole TM region

But I want to normalize it to a pred_count (how many predictions were made), so non-HTM people can intuitively understand it.

I though to achieved this with:
n_pred_cells / n_winner_cells

I assumed that n_winner_cell would be constant, but I found it sometimes varies: Does this look like a valid approach to you?

Thanks!

1 Like

When a minicolumn activates: the TM makes sure that at least one of the cells in the minicolumn is a winner cell. If there were no predictive cells it picks an arbitrary winner. If there are predictive cells, then all of the predicted cells in the mini-column are winners.

So if I understand correctly, you want to tell the user “how many things are predicted”.

• If this number is zero, then you’ve hit an anomaly.
• If this number is one, then TM is predicting exactly one thing will happen.
• If this number is two, then TM is predicting that one of two different things could happen.

The minimum number of cells that the TM will activate to represent a thing is the number of active minicolumns.

The equation to try is:
n_predicted_things = n_pred_cells / n_active_minicolumns

I hope this helps

3 Likes

Thanks @dmac!

Yes you make perfect sense.