I think this block of code gets at what you’re looking for with inter-region links. There are several scripts in numenta/htmresearch/frameworks/layers which construct multi-region networks along these lines.
This is from: (https://github.com/numenta/htmresearch/blob/master/htmresearch/frameworks/layers/l2_l4_network_creation.py)
# Link L4 to L2
network.link(L4ColumnName, L2ColumnName, "UniformLink", "",
srcOutput="activeCells", destInput="feedforwardInput")
network.link(L4ColumnName, L2ColumnName, "UniformLink", "",
srcOutput="predictedActiveCells",
destInput="feedforwardGrowthCandidates")
# Link L2 feedback to L4
if networkConfig.get("enableFeedback", True):
network.link(L2ColumnName, L4ColumnName, "UniformLink", "",
srcOutput="feedForwardOutput", destInput="apicalInput",
propagationDelay=1)
In this case an L4 region (running basically the usual SP+TM process) activates an L2 region. The L2 region does Spatial Pooler activating and learning on the activeCells & predictedActiveCells from L4 respectively, the same way L4 does Spatial Pooling on an encoding vector from raw sensory data.
The L4 is also partially depolarized by the activeCells from L2. This means that bursting-column winner cells in L4 form Apical segments to cells in L2, as they form the usual Basal segments to previousWinnerCells from L4.
The Apical segments are different in that they cannot put their respective cells into the predictive state alone (without an active Basal segment). However if multiple cells in a column are predictive at once (have active Basal segments), any cells which also have active Apical segments will inhibit the Basal-only others.
So L2 cells are learning which cells from L4 to be activated by (like in SP), and L4 cells are learning which cells from L2 to be Apically depolarized by – as they are Basally depolarized by the previoiusWinnerCells. Here’s an attempt to capture this in a simple diagram: