# Gradient Clusteron Visualization

**URL:** <https://discourse.numenta.org/t/gradient-clusteron-visualization/10125>\
**Category:** Implementations\
**Tags:** dendritic-learning\
**Created:** [September 25, 2022, 7:49pm UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125 "2022-09-25T19:49:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![CollinsEM](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/collinsem/32/160_2.png) [@CollinsEM](https://discourse.numenta.org/u/CollinsEM)\
**Post date:** [September 25, 2022, 7:49pm UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125/1 "2022-09-25T19:49:22Z")

</div>

I’ve implemented a visualization of the Gradient Clusteron algorithm described by Toviah Moldwin, et.al. in [this video](https://youtu.be/KLmk3xnojKU), and [this paper](https://doi.org/10.1371/journal.pcbi.1009015). Please let me know if you have questions, comments, or suggestions on how to improve the demo.

> **[Gradient-Clusteron Algorithm](https://collinsem.github.io/GradientClusteronDemo1D/)**
>
> 1D Pattern Matching Experiment

> In this example, we establish a 1D domain with four possible input  
> features at each location (e.g. one of four base pairs). The top line  
> is the input domain. On this line, you will see three sensor patches  
> moving randomly over the domain. Each sensor patch has five sensors  
> and each sensor has four detectors that distinguish whether a feature  
> is present or not under each sensor.
> 
> The three lines below show a target pattern and current input to each  
> of the three sensor patches. For each sensor patch, there are 20  
> pre-synaptic neurons (not shown), and of these, five will be active  
> during each cycle (corresponding to the currently active detector on  
> each sensor).
> 
> The graphs shown below are visualizations of dendrites for three  
> post-synaptic neurons. Each dendrite has 20 synapses attached to the  
> 20 pre-synaptic neurons corresponding to the detectors within each  
> sensor patch. Every synapse has an associated weight and location on  
> the dendrite. The synaptic weights are indicated by the vertical bars  
> along the dendrite, and location is represented by its position along  
> the x-axis.
> 
> Activated synapses will generate a localized effect along the dendrite  
> inversely proportional to the distance away from the synapse  
> location. This effect is indicated by the Gaussian bump centered on  
> each active synapse.
> 
> The dendrite activation is depicted by the thicker plot line, and the  
> total activation is integrated into the bar on the far right. The  
> white horizontal line on this bar is the post-synaptic neuron firing  
> threshold. These plots will take on different colors depending on the  
> current state. Green for successful detection of the target pattern  
> (true-positive), gray for successful non-detection of the pattern  
> (true-negative), red for detection of the pattern when not present  
> (false-positive), and cyan for failure to detect the target pattern  
> when present (false-negative).

---

<div class="post-metadata">

**Author:** ![jacobeverist](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/jacobeverist/32/6736_2.png) [@jacobeverist](https://discourse.numenta.org/u/jacobeverist)\
**Post date:** [September 26, 2022, 7:39pm UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125/2 "2022-09-26T19:39:13Z")

</div>

Can you summarize what a Gradient Clusteron is, what’s interesting about it and its significance?

---

<div class="post-metadata">

**Author:** ![Falco](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@Falco](https://discourse.numenta.org/u/Falco)\
**Post date:** [September 28, 2022, 12:06am UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125/3 "2022-09-28T00:06:45Z")

</div>

[Here](https://www.youtube.com/watch?v=ncRn0YPXKLM) is a shorter presentation by [Toviah Moldwin](https://www.researchgate.net/profile/Toviah-Moldwin), the author of the paper.

---

<div class="post-metadata">

**Author:** ![EEProf](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/eeprof/32/5653_2.png) [@EEProf](https://discourse.numenta.org/u/EEProf)\
**Post date:** [September 28, 2022, 1:49am UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125/4 "2022-09-28T01:49:38Z")

</div>

I become highly suspicious of peculiar terminology, e.g., “clusteron”, but that is just me.

Without looking at any of it, the first thing that came to mind was Edelman’s Brain-Based Design (BBD) and Neural Darwinism–things that really need attention.

---

<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:** [September 28, 2022, 3:12am UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125/5 "2022-09-28T03:12:33Z")

</div>

It seems to be a neuron model that does clustering on its synapses.  
but yea, I get turboencabulator vibes from most terms used in machine learning/computer science.

---

<div class="post-metadata">

**Author:** ![CollinsEM](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/collinsem/32/160_2.png) [@CollinsEM](https://discourse.numenta.org/u/CollinsEM)\
**Post date:** [September 28, 2022, 10:29am UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125/6 "2022-09-28T10:29:56Z")

</div>

From my perspective the gradient clusteron algorithm is an interesting variation on the classic Hebbian learning rule. Rather than simply having a single scalar weight value controlling the strength of a signal transmitted from a presynaptic neuron to a post-synaptic neuron, the clusteron also includes a distance-weighting term. Synapses that are closer together will produce a non-linear response in the dendrite: the response gets stronger as they get closer together, and potentially falling to zero if they get too far apart.

h(x) = sum(a[i], i=1…N) - b  
a[i] = w[i]\*x[i]\*sum(w[j]\*x[j]\*F[i,j], j=1…N)  
F[i,j](r[i], r[j]) = exp(-(r[i]-r[j])^2/sigma)

Here h(x) is the dendrite activation, a[i] are the non-linear contributions of each synapse to the dendrite activation, and F[i,j] are the distance weighting kernels.

In my initial reading of the paper, I thought that the distance weighting effect would allow for synapses to produce a stronger response than either one could generate on their own. It turns out that my initial intuition was both right and wrong. It turns out that the pairwise effect is actually less if the input activations to the synapses are restricted to -1 and 1 (or 0 and 1), and the weights are initialized from -1 to 1 (or 0 to 1). The combined effect of a pair of synapses will always be less than the individual synapses since their combined effect is a product of their weights, activations, and a distance kernel which is also bounded between 0 and 1. However, due to the sum in the a[i] term, multiple of these pairwise effects can combine to generate a combined activation contribution in excess of the individual weighted activation (w[i]\*x[i]).

Learning rules are provided for both the synaptic weights and positions.

I think it would be interesting to look more closely at how these types of networks compare to more traditional ANNs. In particular, I’d be interested in seeing if they are more stable/robust to noise, or if the rate of convergence of the weights and locations are more rapid than networks operating on weights alone.

All in all, I found this to be an interesting coding exercise. It allowed me to come up with a new cool way of visualizing dendritic activations (which might still be useful even without the distance/position effects). This project has also given me some ideas for other variations that I’d like to try out. I’ll post updates if anything interesting comes up.

---

<div class="post-metadata">

**Author:** ![jacobeverist](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/jacobeverist/32/6736_2.png) [@jacobeverist](https://discourse.numenta.org/u/jacobeverist)\
**Post date:** [September 28, 2022, 5:26pm UTC](https://discourse.numenta.org/t/gradient-clusteron-visualization/10125/7 "2022-09-28T17:26:20Z")

</div>

It looks like you considered synaptic distance to be their post-synaptic positions on the dendrite, and not their pre-synaptic positions in the input space. This was something I missed on my first glance at the paper.

Mechanically, this seems to be a way of magnifying the correlated response of a set of inputs in a nonlinear way without making large synaptic weights. This would enable one to catch the subtle and important co-firing of inputs for a particular pattern, and a sharp drop-off in synaptic response when the inputs for that pattern start to disappear. This gives a nonlinear drop-off in response instead of the linear drop-off which would be the case of traditional ANNs.

I was thinking of the clusteron in purely spatial clustering terms (like the visual field) and I couldn’t see the benefits. But if you want to isolate and select out particular firing correlations, then the clusteron can do it in a way I’m not sure can be done with other approaches.

It’s interesting that treating the dendrite as a first-class computational object leads to interesting algorithmic possibilities not available to traditional ANNs. In BrainBlocks, we treat a single dendrite as a _hypothesis_ with its synapses aligned to the expected pattern. A limited number of dendrites or _hypotheses_ can be created per neuron, each trained to a particular pattern. These dendrites are created as needed up to a limit.

Whereas, in the clusteron approach, a single dendrite can represent multiple _hypotheses_ by clustering synapses together for each particular expected pattern. The clusteron approach gives you that nonlinear response in the detected pattern, but I think in BrainBlocks, we would only get a linear response in partial patterns. This latter is usually not a problem because the neurons are fired in WTA manner so a 50% response for a pattern is usually discarded in favor of something with higher response.
