Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TM anomaly: new modes: likelihood,... #588

Merged
merged 4 commits into from
Aug 10, 2019
Merged

Conversation

breznak
Copy link
Member

@breznak breznak commented Jul 24, 2019

For #469 , and htm-community/NAB#5

  • implement other modes for TM.anomaly
    • ANMode {DISABLED, RAW, LIKELIHOOD, LOGLIKELIHOOD}
    • this is using the not 100% validated c++ Likelihood, but provides convenient API to use it within TM,
      and aims to replace code in NAB HTMcore detector
  • bidings
  • still some bug which segfaults

struct anomaly_tm needed be known before the
TM.anomaly& is used.
Surprisingly this compiled well, but resulted in segfault
@breznak
Copy link
Member Author

breznak commented Aug 10, 2019

Ping..

Copy link
Collaborator

@ctrl-z-9000-times ctrl-z-9000-times left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!
Hopefully this change will make it easier to use the TM.

/*
* anomaly score computed for the current inputs
* (auto-updates after each call to TM::compute())
*
* @return a float value from computeRawAnomalyScore()
* from Anomaly.hpp
*/
const Real &anomaly = anomaly_;
const Real &anomaly = tmAnomaly_.anomaly_; //this is position dependant, the struct anomaly_tm must be defined before this use,
// otherwise this surprisingly compiles, but a call to `tmAnomaly_.anomaly` segfaults!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, Interesting ...
This seems like a problem with the C++ language, or maybe the compiler? Thanks for making note of this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, strange thing, kept me busy for a while. The compiler might be, I've been using g++-9 recently due to the ParallelTS.

@breznak breznak merged commit dde3263 into master Aug 10, 2019
@breznak breznak deleted the tm_anomaly_likelihood branch August 10, 2019 16:19
@breznak
Copy link
Member Author

breznak commented Aug 10, 2019

Thank you for reviews, I'll now be able to use this code in our NAB detector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants