# Triadic Memory — A Fundamental Algorithm for Cognitive Computing

**URL:** <https://discourse.numenta.org/t/triadic-memory-a-fundamental-algorithm-for-cognitive-computing/9763>\
**Category:** Related Papers\
**Tags:** sparse-distributed-m\
**Created:** [May 27, 2022, 9:35am UTC](https://discourse.numenta.org/t/triadic-memory-a-fundamental-algorithm-for-cognitive-computing/9763 "2022-05-27T09:35:23Z")\
**Posts on this page:** 3\
**Page:** 15

<div class="post-metadata">

**Author:** ![JarvisGoBrr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/jarvisgobrr/32/6147_2.png) [@JarvisGoBrr](https://discourse.numenta.org/u/JarvisGoBrr)\
**Post date:** [October 17, 2023, 4:31am UTC](https://discourse.numenta.org/t/triadic-memory-a-fundamental-algorithm-for-cognitive-computing/9763/282 "2023-10-17T04:31:37Z")

</div>

I wonder if we can get more savings by using some form of tree structure instead of linear arrays.

I’m thinking like 1D dynamic quad-trees encoding bit positions.  
if we go fancy with adressing we may be able to use 8bit indexes instead of 64bit pointers

---

<div class="post-metadata">

**Author:** ![cezar\_t](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/cezar_t/32/4451_2.png) [@cezar\_t](https://discourse.numenta.org/u/cezar_t)\
**Post date:** [October 18, 2023, 10:42am UTC](https://discourse.numenta.org/t/triadic-memory-a-fundamental-algorithm-for-cognitive-computing/9763/283 "2023-10-18T10:42:55Z")

</div>

If memory size is excessively big for your use case bitpair addresses can be projected into a matrix with fewer rows than N\*(N-1)/2 (I’m talking about diadic addressing here).

I’m curious what is your use case - N, P, number of vectors.

> [@clems4ever](#):
>
> Let me know what you think.

At least def xaddr() there can be numbified and that alone should improve performance visibly. Also using threee arrays (or “stores”) instead of ‘x’,‘y’,‘z’ indexing might allow numbification of the other functions.

And I agree numba is PITA for anything that doesn’t look like a numpy array.

---

<div class="post-metadata">

**Author:** ![cezar\_t](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/cezar_t/32/4451_2.png) [@cezar\_t](https://discourse.numenta.org/u/cezar_t)\
**Post date:** [October 18, 2023, 11:13am UTC](https://discourse.numenta.org/t/triadic-memory-a-fundamental-algorithm-for-cognitive-computing/9763/284 "2023-10-18T11:13:13Z")

</div>

> [@clems4ever](#):
>
> Also if SDR size is big, I would not assume I can reach 2/3 of load in the hash table, that’s the point

The sparsity (N/P) is what limits capacity, rather than sdr size (N) alone.

[Previous page](https://discourse.numenta.org/t/triadic-memory-a-fundamental-algorithm-for-cognitive-computing/9763.md?page=14)
