How to Run HTM School Visualizations


Thank you for a prompt reply!
I was able to make it run by doing

ls -s $CELL_VIZ/bin/cell-viz-1.1.2.bundle.js $HTM_VIZ/htm-school-viz/static/js/third/cell-viz-1.1.2.bundle.js

I also had to “npm install” a bunch of modules: express-http-proxy, express, express-handlebars, serve-static, glob.

I wanted to run HTM School Visualizations to see cell activations for arbitrary sequences. I’m struggling to understand how HTM “merges” contexts. For example, if an input sequence is “A,B,C,D,C,B,A,B,C,D,C,B,A,B,…”, how does HTM figures out that the context of the first, third, and fifth ‘B’ is the same. I couldn’t find explanations about this in the HTM papers. I’ll make a separate post about this.

Unfortunately, it’s not possible to check visualizations for arbitrary sequences with this tool… It’s too bad, cause now I guess I need to dig into the TM code :frowning_face:



Join the club! :wink:



Yes digging into the TM is definitely how you’ll understand context in HTM, that’s the TM’s job. There’s good pseudocode here:



I do have newly created bin/cell-viz-1.1.2.bundle.js (which replaced the older version downloaded from the github through git clone command). What I don’t have is out/dyson.js file as stated in the tutorial above. Perhaps I am supposed to ignore commands related to out/dyson.js stated in the tutorial above and the github repositories???

Linking cell-viz-1.1.2.bundle.js helped (Thanks @oiegorov :slight_smile:), let’s me run visualisation 11.

For visualisation 10 though, I continue to get a page with only the text: “Ep10/Choose Gif” :frowning_face:



It should look like this:

what errors do you have in your console?



Episode 10 (Doesn’t work):
As I click “Episode 10: Topology Topology” the terminal output does not change at all.

Episode 11 (works fine, stating here for comparison. Only a few minor issues listed):

For your ready info, when I clicked “Episode 11: Temporal Memory Part 1 Sequencer”, I get following text, and visualisation works fine:

{u’boostStrength’: 1,
u’columnDimensions’: [1024],
u’dutyCyclePeriod’: 1000,
u’globalInhibition’: True,
u’inputDimensions’: [100],
u’localAreaDensity’: 0,
u’minPctOverlapDutyCycle’: 0.001,
u’numActiveColumnsPerInhArea’: 20,
u’potentialPct’: 0.85,
u’potentialRadius’: 100,
u’stimulusThreshold’: 1,
u’synPermActiveInc’: 0.05,
u’synPermConnected’: 0.1,
u’synPermInactiveDec’: 0.008,
u’wrapAround’: True}
_conjureActiveColumns: 6.79492950439e-05 seconds
_conjurePotentialPools: 0.0749340057373 seconds
_conjureConnectedSynapses: 0.00297904014587 seconds
_conjurePermanences: 0.00664615631104 seconds
Saving SP db350db1 to memory… - - [05/Feb/2018 23:16:35] “HTTP/1.1 POST /_sp/” - 200 OK
{u’activationThreshold’: 10,
u’cellsPerColumn’: 16,
u’columnDimensions’: [1024],
u’connectedPermanence’: 0.5,
u’initialPermanence’: 0.21,
u’maxNewSynapseCount’: 20,
u’maxSegmentsPerCell’: 255,
u’maxSynapsesPerSegment’: 255,
u’minThreshold’: 10,
u’permanenceDecrement’: 0.02,
u’permanenceIncrement’: 0.1,
u’predictedSegmentDecrement’: 0}
Created TM db350db1
_conjureActiveCells: 8.10623168945e-06 seconds - - [05/Feb/2018 23:16:35] “HTTP/1.1 POST /_tm/” - 200 OK

Visualisation is not as neat as your video though, also not the controls. Transparency level of the cell gets very high, as soon as I click the play button. Screenshot attached.

As for the 3d controls, do you use any keys other than WASDQE? How do you pitch and yaw?

PS: I am presenting HTM theory in the morning to my colleagues, I am preparing the notes and visualisations therefore. :slight_smile: Kindly help!



Not the terminal output, the browser console output.

Use the arrow keys, too. I use a combination of both (arrows for strafe).



The page is blank with only the text: Ep10/Choose Gif

Do I need to download these images from somewhere first?

Chrome screenshot below:



No, but I need to see what errors are occurring in your browser. Look up what browser you have and how to show the “web console” logs.



I use google chrome. I opened DevTools/console using ctrl+shift+J as per:
I see the following:

Tone.min.js:7 [Deprecation] GainNode.gain.value setter smoothing is deprecated and will be removed in M64, around January 2018. Please use setTargetAtTime() instead if smoothing is needed. See for more details.
(anonymous) @ Tone.min.js:7
s._initAudioContext @ Tone.min.js:7
(anonymous) @ Tone.min.js:7
t @ Tone.min.js:1
(anonymous) @ Tone.min.js:7
(anonymous) @ Tone.min.js:1
(anonymous) @ Tone.min.js:1
Tone.min.js:7 * Tone.js r9 *

Kindly let me know how do I generate the log by which you can best help me out. (My apologies, but I have never done java script/web debugging, so I am not sure how do I proceed next.)



That’s strange. I don’t see any errors. But I also don’t see anything loaded. What does this URL show you?




I get the following:

Tone.min.js:7 [Deprecation] GainNode.gain.value setter smoothing is deprecated and will be removed in M64, around January 2018. Please use setTargetAtTime() instead if smoothing is needed. See for more details.
(anonymous) @ Tone.min.js:7
Tone.min.js:7 * Tone.js r9 *
cell-viz-1.1.2.bundle.js:20388 THREE.WebGLRenderer 81



As I click somewhere, I additionally get:

clicked: 6, 6, 1 == column 78
topology.js:254 Uncaught TypeError: Cannot read property ‘78’ of undefined
at updateCellRepresentations (topology.js:254)
at spClicked (topology.js:407)
at cellClicked (topology.js:412)
at HTMLCanvasElement.onDocumentMouseDown (topology.js:433)
at HTMLCanvasElement.dispatch (jquery.min.js:5)
at HTMLCanvasElement.y.handle (jquery.min.js:5)



I can’t replicate this, so in order to help you out, you’re going to have to help me debug.

Go to http://localhost:8001/client/ep10/choose-gif.html and open up your web console again. Go to the “sources” tab and find the source file at client/ep10/choose-gif.js, then put a breakpoint here:

Then refresh the page and inspect the resp object. Does it contain stuff like this?



I do not see client/ep10/choose-gif.js.

localhost:8001 expansion looks like this:



That highlighted js folder contains it.



I don’t see it.
Entire structure for your ready info, perhaps you see some missing files that I need to generate or something?



Click on your “Elements” tab, does it not look like this? It should link /static/js/ep10/choose-gif.js:



Yes, I do have that line under ‘Elements’.

However, I do not see /static/js/lib/grid-cells/* ( = 3 js files) + dat.gui.min.js +

Screenshot below



You should not see those grid cell files. Keep looking for the choose-gif.js in your source tab. It has to be there, or else there will be an error somewhere.