htm.core icon indicating copy to clipboard operation
htm.core copied to clipboard

Review and refactor DateTime encoder

Open breznak opened this issue 6 years ago • 4 comments

Follow up to #462 ,

Date time encoder is only available in python:

  • [ ] make a c++ version + bindings?

Python datetime:

  • [ ] consider removing "weekend" field, replaced by cusomDays
    • same with holidays?
  • [ ] make more general purpose!
    • current DateTime is an old encoder, heavily specified for "hotgym" dataset, that has weekly period, and is tied to human behavior (such as weekend, ...)
    • [ ] specify encoding width for minutes, seconds, years? (currently seasons, days only)
  • [ ] extend "date string" format of inputs, such as for customDays ("Mon", "Tuesday") to use full datetime's format
    • so we can specify "Mon, 13:05" etc
  • [ ] test quality of encoding using RDSE as the internal encoder, instead of ScalarEncoder
  • [ ] allow "smoothing of upcoming events"
    • currently, say Wed is a special day, output looks like (day:special): Mon:0, Tue:0, Wed:1,Thr:0, ..
    • change to smoothing: Mon:0, Tue:0.5, Wed:1.0, Thr:0, ...

breznak avatar May 13 '19 17:05 breznak

I dont think that there is very much demand for this encoder in C++

I dont want to remove fields from the encoder. I think that the weekend field is a great idea. The purpose of this encoder is to demonstrate the capabilities of the TM. It is not supposed to be biological, its for fun examples.

Minutes seconds years? I thought that it already did some of this but if not then sure it could be added, +1

Date strings sounds good too, although i hope there is a library which already does this.

ctrl-z-9000-times avatar May 13 '19 19:05 ctrl-z-9000-times

I dont think that there is very much demand for this encoder in C++

Probably not but if such a thing existed it would make it easier to make this encoder as a built-in region for NetworkAPI. Also, C++ only folks would be able to use it.

dkeeney avatar May 13 '19 20:05 dkeeney

Now, how can we fold this into the networkAPI? Is there going to be a C++ version of this?

I would also say c++ version would find it's use, as some form of date-time is used in almost every other example, see hotgym dataset that we want to replicate for c++ in #30

On the other hand, David is right the c++ impl would likely be more complicated, as python has the neat datetime library.

Also, I'd wait a bit as I'm unsatisfied with this as a "general purpos" time/date encoder (see the problem with years/months), so I'll seek forums for thoughts on more generic implementation of this. So for now I'd suggest c++ on hold.

breznak avatar May 13 '19 21:05 breznak

FYI this should make porting to c++ feasible: https://github.com/coin-au-carre/datetimepp
maybe there's a better c++ implementation of python's datetime .

breznak avatar Jul 23 '19 17:07 breznak