# RNNs and HTM

**URL:** <https://discourse.numenta.org/t/rnns-and-htm/3047>\
**Category:** Machine Learning\
**Tags:** community\
**Created:** [November 9, 2017, 1:07pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047 "2017-11-09T13:07:27Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![watchdog](https://avatars.discourse-cdn.com/v4/letter/w/e56c9b/32.png) [@watchdog](https://discourse.numenta.org/u/watchdog)\
**Post date:** [November 9, 2017, 1:07pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/1 "2017-11-09T13:07:28Z")

</div>

Hi, i was wondering if it is possible to test and compare results between RNNs and HTM system.  
I have never been envolved with RNNs and i am not sure if this is something that can be done.If anyone knows i would like to know

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [November 9, 2017, 5:33pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/2 "2017-11-09T17:33:52Z")

</div>

Well, we have the [Numenta Anomaly Benchmark](https://github.com/numenta/NAB), which compares NuPIC to LSTM.

---

<div class="post-metadata">

**Author:** ![subutai](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/subutai/32/106_2.png) [@subutai](https://discourse.numenta.org/u/subutai)\
**Post date:** [November 9, 2017, 11:07pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/3 "2017-11-09T23:07:12Z")

</div>

You can check this paper:

Cui, Y., Ahmad, S., and Hawkins, J. (2016). Continuous online sequence learning with an unsupervised neural network model. Neural Computation 28, 2474–2504. doi:10.1162/NECO\_a\_00893.

> **[Numenta.com • Continuous Online Sequence Learning with an Unsupervised Neural...](https://www.numenta.com/papers/continuous-online-sequence-learning-with-an-unsupervised-neural-network-model/)**
>
> Analysis of HTM sequence memory applied to various sequence learning and prediction problems. Written with a machine learning perspective, the paper contains some comparisons to statistical and Deep Learning techniques.

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [December 5, 2018, 8:05pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/4 "2018-12-05T20:05:38Z")

</div>

Hi @subutai

Thanks for the link.The paper looked very interesting and I wanted to replicate the results. However, when I looked at the corresponding [Github](https://github.com/numenta/htmresearch/tree/master/projects/sequence_prediction) repository and tried to get it working, I failed.

I tried both the installation procedures shown in the picture:

 ![Screenshot%20from%202018-12-05%2015-01-25](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/0/054095d7cec27409ea68d2a967f33b06c1cc4b2c.png)

When I tried by using `pip install nupic htmresearch` I got the errors shown in the next picture

 ![Screenshot%20from%202018-12-05%2014-59-34](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/f/fda61facbe87e4865851efc7ee193c1412097ba1.png)

And then I tried the ‘developer’ way, even it caused errors as shown in this picture:

 ![Screenshot%20from%202018-12-05%2015-04-06](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/b/b4c3ff0aca265087a4d4d9ce39d09aba04d2e1fc.png)

Am very interested in this and any help will be highly appreciated 🙂

-Deepak

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [December 5, 2018, 9:27pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/5 "2018-12-05T21:27:58Z")

</div>

Run:

```auto
pip install nupic --user

```

What happens?

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [December 5, 2018, 9:33pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/6 "2018-12-05T21:33:20Z")

</div>

I already had NUPIC but I tried running the command again as per your suggestion and surprisingly it gave error. Please look at the picture:

 ![Screenshot%20from%202018-12-05%2016-32-38](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/6/62c20d60d4b8f08c5c2e6aa5deadc3d8e221421e.png)

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [December 5, 2018, 10:08pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/7 "2018-12-05T22:08:56Z")

</div>

Looks like a problem with the `wacavtve` package. Are you in that local directory when you install?

---

<div class="post-metadata">

**Author:** ![Balladeer](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/balladeer/32/3094_2.png) [@Balladeer](https://discourse.numenta.org/u/Balladeer)\
**Post date:** [December 5, 2018, 10:11pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/8 "2018-12-05T22:11:12Z")

</div>

I’m pretty sure you are using Python 3 instead of Python 2. Python 2.6+ allowed both `Exception as e` and `Exception, e`, but Python 3 _requires_ the the form `Exception as e`

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [December 5, 2018, 10:24pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/9 "2018-12-05T22:24:15Z")

</div>

@rhyolight Nope, am in home directory when I executed that command.

@Balladeer I think you are correct. Now I tried running `pip2 install nupic --user` It actually worked, but downgraded two of my packages which are python-dateutil and numpy. Look at this:

 ![Screenshot%20from%202018-12-05%2017-20-05](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/4/4ab4dd9b9584b0aa2c6f55d4bbb3483ab212de0d.png)

And then I tried the same logic for htmresearch. I ran `pip2 install nupic htmresearch`  
Even that worked but gave similar error:

 ![Screenshot%20from%202018-12-05%2017-23-25](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/6/6b0be4d8b68a40f3064e657e1f0a6ca86d876b79.png)

Any suggestions on this? Do you think it’s not a problem?

---

<div class="post-metadata">

**Author:** ![subutai](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/subutai/32/106_2.png) [@subutai](https://discourse.numenta.org/u/subutai)\
**Post date:** [December 6, 2018, 6:24pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/10 "2018-12-06T18:24:56Z")

</div>

@Deepak_Vellampalli

Here’s another option. We try to put cleanly reproducible versions of our code in [https://github.com/numenta/htmpapers](https://github.com/numenta/htmpapers) but this particular paper is not there. It’s in the process of being cleaned up - the current version can be found on this branch: [https://github.com/lscheinkman/htmpapers/tree/RES-609/neural\_computation/continuous\_online\_sequence\_learning\_with\_an\_unsupervised\_neural\_network\_model](https://github.com/lscheinkman/htmpapers/tree/RES-609/neural_computation/continuous_online_sequence_learning_with_an_unsupervised_neural_network_model)

There’s more info on how to run each experiment here: [https://github.com/lscheinkman/htmpapers/blob/RES-609/neural\_computation/continuous\_online\_sequence\_learning\_with\_an\_unsupervised\_neural\_network\_model/DESCRIPTION.md](https://github.com/lscheinkman/htmpapers/blob/RES-609/neural_computation/continuous_online_sequence_learning_with_an_unsupervised_neural_network_model/DESCRIPTION.md)

It still requires htmresearch, but there is a Dockerfile in the above branch. If you’re familiar with Docker, it can help alleviate the library issues you are having by running everything in an isolated container.

Hopefully we’ll merge this branch into the main htmpapers repo soon.

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [December 6, 2018, 10:17pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/11 "2018-12-06T22:17:41Z")

</div>

@subutai

Thank you so much for your reply. As per my previous comment, I couldn’t get htmresearch installed as pip couldn’t downgrade my simplejson package. I tried different ways to solve that issue but finally ended up executing `sudo pip2 install nupic htmresearch --ignore-installed simplejson` and it worked. It passed the test case too but not sure if it will cause any problems further(hopefully NO).

However, if I face any problems I will go with your suggestion of dockerization as it will give me a clean setup.

And also thanks for pointing out the htmpapers repository and also the current version of the project. Will make use of them for my work. I think community will be happy to see the cleaned implementation of this paper soon as this can serve as a powerful tool to prove the concept of HTM and its advantages over classic sequence prediction techniques.

Have a great day!

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [December 18, 2018, 8:43pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/12 "2018-12-18T20:43:01Z")

</div>

@subutai

Hello,

I have been working on those lines as I mentioned in my previous comment. I could install htmresearch successfully by ignoring few packages but it eventually failed in getting certain things working and ended up getting some issues regarding installation. Hence, I immediately switched to dockerization approach and started using [https://github.com/lscheinkman/htmpapers/tree/RES-609/neural\_computation/continuous\_online\_sequence\_learning\_with\_an\_unsupervised\_neural\_network\_model](https://github.com/lscheinkman/htmpapers/tree/RES-609/neural_computation/continuous_online_sequence_learning_with_an_unsupervised_neural_network_model) as per your suggestion. After setting up, when I tried running continuous sequence experiment using `python run_tm_model.py -d nyc_taxi`, I got the following error:  
 ![Screenshot%20from%202018-12-18%2011-20-33](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/b/bdbc7cc57360b3da368a43b1b8152e8962e7c37e.png)

I realized it’s because of the missing folder named ‘prediction’ which is available on htmresearch repository at [https://github.com/numenta/htmresearch/tree/master/projects/sequence\_prediction/continuous\_sequence](https://github.com/numenta/htmresearch/tree/master/projects/sequence_prediction/continuous_sequence)  
Hence, I copied that particular directory into a docker container and ended up getting the following error:

 ![Screenshot%20from%202018-12-18%2015-38-56](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/0/00c35cb8fbf238fd3ea63cf91c4c5b5834e0d1ca.png)

I also got few other errors as well while reaching to this point. Does it mean the project is still unstable(at both the locations) and not ready to use?

Thanks,  
Deepak.

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [January 10, 2019, 3:20pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/13 "2019-01-10T15:20:36Z")

</div>

@rhyolight @subutai

Any update on the working condition of this project?

Thanks,  
Deepak.

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [January 10, 2019, 5:36pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/14 "2019-01-10T17:36:39Z")

</div>

Deepak, just to be clear, I’ll refer you to the [bit we wrote about this](https://github.com/numenta/htmresearch#what-you-should-understand-about-this-repository) repository a long time ago. I don’t want to bother the researchers to help the public run the code, but we still want the code out there. You can use it if you want, but don’t wait on us to improve the “working condition” of this project. This is experimental research code for the Numenta research team, so if it works for their needs we will not be changing anything.

I hope you understand.

---

<div class="post-metadata">

**Author:** ![lscheinkman](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/lscheinkman/32/1904_2.png) [@lscheinkman](https://discourse.numenta.org/u/lscheinkman)\
**Post date:** [January 10, 2019, 6:39pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/15 "2019-01-10T18:39:43Z")

</div>

Hi @Deepak_Vellampalli,  
I’ve fixed the missing directory issue and some OSX matplotlib warnings on this experiment. It should work now.  
Try getting the latest from [https://github.com/lscheinkman/htmpapers/tree/RES-609](https://github.com/lscheinkman/htmpapers/tree/RES-609/) and let me know if you are still seeing the problem.

Luiz

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [January 10, 2019, 7:13pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/16 "2019-01-10T19:13:33Z")

</div>

@rhyolight, I’m sorry for bothering you people on this again and again. As I tried the things that were suggested earlier by your researchers and they didn’t work, I replied to the same thread and expected a response. I neither meant to disturb your on-going research nor demanding your researchers to change the code for me or to help me in getting that code running. I think my intentions weren’t conveyed clearly!  
And also thanks for making it clear that I should not wait to see the change in working condition of the project, that was helpful.

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [January 10, 2019, 7:15pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/17 "2019-01-10T19:15:24Z")

</div>

@lscheinkman Thank you very much for fixing the issues. I will definitely try them and see!

---

<div class="post-metadata">

**Author:** ![subutai](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/subutai/32/106_2.png) [@subutai](https://discourse.numenta.org/u/subutai)\
**Post date:** [January 10, 2019, 8:14pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/18 "2019-01-10T20:14:57Z")

</div>

> [@Deepak\_Vellampalli](#):
>
> I’m sorry for bothering you people on this again and again.

No worries - sometimes we need a little nudge 😀

Also, thank you for finding and reporting the issues. It helps us make the results more easily reproducible.

---

<div class="post-metadata">

**Author:** ![Deepak\_Vellampalli](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Deepak\_Vellampalli](https://discourse.numenta.org/u/Deepak_Vellampalli)\
**Post date:** [January 10, 2019, 9:19pm UTC](https://discourse.numenta.org/t/rnns-and-htm/3047/19 "2019-01-10T21:19:43Z")

</div>

I’m very glad to hear that! Thanks for making me feel more comfortable! 😄
