-
Notifications
You must be signed in to change notification settings - Fork 75
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
Implement Computable interface for SP, TM, TP, CP #295
Comments
Basically you are gravitating toward a plugin interface which we already have with NetworkAPI. Imho concentrate on the algorithm performance and don't worry about compatible interfaces. |
I don't see the use-case for this... |
won't be 100% compatible, but these share enought in common to be useful (transform sdr -> sdr + some learning). I have motivation in the mnist, hotgym examples (basically any code that wants to compare multiple versions of these algos).
Another good example is in Hotgym. basically, these algorithms (SP, TM, TP, BackTP, CP) have quite a lot in common (in contrary to Classifier, Encoders). It'll iron out the little differences (mostly syntactic sugar), and simplify the interoperability. This should not be a big PR. |
Like I said...for cases where a common interface is useful, use NetworkAPI. That is what it is for. Of course I need to finish a few more Region interfaces before this is ready, but I am getting there. |
it's a different scope, I don't use NetworkAPI in those examples. Ok, both of you are not impressed, so I'll put it bluntly, will you not be agains such PR if I make it (because I want to)?
|
If you think you can make it work without breaking lots of stuff then go for it, I will approve. Also include method The temporal memory compute argument |
I think what is more important than a C++ class hierarchy are: good conventions & naming schemes and for them to be used consistently throughout the API. And whatever scheme we settle on should be clearly documented. For example: all classes which accept more than a few arguments should instead use a parameters structure. For a class named
The parameter structure should not contain stateful data, meaning that instead of an SDR use the dimensions of the SDR. |
Passing "by structure" I assume applies to just the constructor? I don't think there is any speed advantage by doing this. So this is just to make it easier to code? Have you considered some sort of std::map rather than a structure to pass parameters? More like Python. |
Yes
Yes
I do not think this would work since the data type is different for each parameter. And if you did make it work then the compiler would be unable to check that the parameters are the correct type, and then the algorithm would have to check every parameter's type at run time. |
You are right, a map would be messy...even though there are ways to use different data types in a map without loosing its type. Not not worth it in this case. |
BTW: |
part of #58 Interfaces.
Allows to interchange all computable instances.
void compute(const SDR input, SDR output, bool learn);
The text was updated successfully, but these errors were encountered: