How can I implement the datetime encoder in the C# using HTM?


What is HTM? Kindly describe it in very simple words and also, help me to implement the code and how tto connect HTM to C#? I have to declare some library to link HTM to my Datetime code? Or I have to install something for it, to get linked with C#? Kindly help me out with this. Thank you for your valuable time.


I don’t know of any recent C# code implementations of HTM. There is of course a C++ version you should know about if you’ve read

If you want to write HTM code in C# I think you’ll have to either:

  1. create a language binding for C# from nupic.core using swig or another developer tool
  2. write an HTM in C#

Sorry there is not another answer, but no one has written an HTM in C# yet. The ones I found are really old.


Have you considered simply translating the java, c++ or python implementations? There’s plenty of unit tests provided so it should be easy to translate them too and double check your own implementation.

The python is here (you’ll need a reasonable understanding of how the numpy library does vector operations, if not consider looking into the java implementation):

You will also have to translate the ScalarEncoder and Encoder base class:


See also:


As I am trying to install nupic.core NuGet package, which has been developed by Numenta, but I am getting this error while installing it " Error NU1202 Package nupic.core 1.0.103 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package nupic.core 1.0.103 does not support any target frameworks", so how can I install this package for my project? I guess nupic.core package will help me out in further steps during code implementations.


That Nuget package just has the Nupic core C++ sources in it, it’s not a .NET library.


Ah okay. So, if I want to implement “package org.numenta.nupic.encoders” so how can I implement this package into C#? I guess I need to download some kind of package for further implementation.


Basically I want to translate this java code into c# for datetime encoder. As I have issues with the package and the implementation itself.

Here is the link:


@rhyolight’s answer above still applies, sorry. There simply hasn’t been enough demand in the community to keep a C# implementation maintained.


There are green fields abound in this space. Room for pioneers, hackers, and entrepreneurs. This is the very beginning of the next wave of AI, the one that will bring along with it truly intelligent machines. If you want to play a small part of this story, write that damn C# DateEncoder. :wink: