Can HTM perform XOR operations?

I probably should point out that a large HTM layer isn’t required for this particular problem (I was just demonstrating how it could be done in a typical setup). Even a tiny system like this could also learn the XOR operation:

image

In this case, each box represents an HTM neuron. Settings for the system are three input cells, four minicolumns, one cell per minicolumn, sparsity 25%, and activation threshold 1. The red lines indicate potential synapses used in SP, and the blue lines indicate the distal connections made when training the following two sequences in TM:

X -> T
Y -> T

After this, inputting just X will predict T, inputting just Y will predict T, and inputting both X and Y will not predict T.

Also, if you are particular about the original “T” cell being the one that goes into predictive state (versus its counterpart up in the TM layer), the system can be set up where the TM layer provides apical feedback to the input layer (this is how I decode predictions in htm.js without requiring a classifier)

Here is another visualization of how HTM applies to this problem. Here you can see how the receptive fields for some minicolumns can align better to just X or just Y, while others can align better to both X and Y.

image

3 Likes