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

Introduce Interfaces #58

Open
1 of 4 tasks
breznak opened this issue Aug 14, 2018 · 8 comments
Open
1 of 4 tasks

Introduce Interfaces #58

breznak opened this issue Aug 14, 2018 · 8 comments
Labels
code code enhancement, optimization, cleanup..programmer stuff community enhancement New feature or request
Milestone

Comments

@breznak
Copy link
Member

breznak commented Aug 14, 2018

so that code can be more cleanly used, code redux.
Interfaces enforce stable API, name form of *able.

  • Computable
    • feed forward compute input
    • void compute(T* input, T* output)
    • will be used for all classes: encoder, SP, TM*, Anomaly, ...
  • Serializable
    • can serialize to file
    • void save(..) throws;
    • static T load(..)
  • Printable
    • nice way to display the object in human readable form
    • std::string toString() const
    • override << ..?
  • Comparable
    • implements equals comparison
    • override ==
@breznak breznak added enhancement New feature or request community code code enhancement, optimization, cleanup..programmer stuff labels Aug 14, 2018
@breznak breznak added this to the interfaces milestone Aug 14, 2018
@dkeeney
Copy link

dkeeney commented Aug 14, 2018 via email

@breznak
Copy link
Member Author

breznak commented Aug 14, 2018

hmm..I'll study the docs for Network API, though this task was to introduce this (OOP) logic into the core algorithms (not Regions). Result would be cleaner, better maintainable code, which would be easier to use directly. Eg:

for( Serializable s : {myEnc, mySP, myTM}) 
  s.save(...);

I hope this change could be implemented without breaking the (higher-level) Region/Network API (?)

@dkeeney
Copy link

dkeeney commented Aug 14, 2018 via email

@breznak
Copy link
Member Author

breznak commented Aug 14, 2018

My feeling is that we do not want to break any python code and python code can address both the Network API and individual algorithms.

Good point, hadn't thought about that.
We could either provide interfaces in the python-wrapper code, or even at c++ level, where the "old API" method would call the "correct". This API can be marked for depracation later. (I start to like this approach, esp with an ifdef #OLD_API_vX.Y) This could allow c++ folks to loosen the depdendency on py (other) old compatibility, while still supporting it for respective (most) users. Loosening c++ and the bindings is one of the big goals now..

@dkeeney
Copy link

dkeeney commented Aug 14, 2018 via email

@breznak
Copy link
Member Author

breznak commented Sep 19, 2018

Serializable re-implemented as part of capnp removal in #62 !

@breznak
Copy link
Member Author

breznak commented Sep 19, 2018

currently it's in types/Serializable, should we introduce something like interfaces/ for better structure of the repo?

@dkeeney
Copy link

dkeeney commented Sep 19, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code code enhancement, optimization, cleanup..programmer stuff community enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants