saul icon indicating copy to clipboard operation
saul copied to clipboard

Enable in-memory feature caching for properties

Open bhargav opened this issue 8 years ago • 3 comments

Work Items

  • [x] Implements feature caching for static features that do not change between runs.
  • [x] Update documentation
  • [x] Add unit tests
  • [x] ~Verify/Reason if we need a function to explicitly clear the cache?~

Idea: Cache static features that do not change across learning iterations. Improves training speed at the cost of using more memory for caching the features. Tested this on the Chunker app and there is a significant improvements to training time.

  • Can be extended further with other caching implementation like MapDB (which supports on-disk caching)

bhargav avatar Mar 04 '17 06:03 bhargav

One big concern I have is the confusion that it might create a little confusion with cache = true (vs isStatic ). Especially in the documentation here. We might consider changing the terminology and clarify the difference (+use cases).

danyaljj avatar Mar 05 '17 05:03 danyaljj

On the implementation, I'd suggestion different approach: we can reuse the existing caching. The only thing we have to do is to make sure we don't clean in between each training iterations. That is handled here by this function.. So the only change needed is, not calling the clear function for properties for which isStatic is specified.

danyaljj avatar Mar 05 '17 05:03 danyaljj

This is ready to be reviewed.

bhargav avatar Apr 09 '17 04:04 bhargav