megvii-research / hpman

A hyperparameter manager for deep learning experiments.
MIT License
95 stars 11 forks source link

Performance Matters #12

Open bigeagle opened 4 years ago

bigeagle commented 4 years ago

People often use hyerparams in data generator, augmenter, etc. These functions would be called millions of times.

I profiled my recent project and the result shows 50% of time was wasted on w = _("patch_size", 200).

I'd suggest caching __call__ return value.

zxytim commented 4 years ago

The efficiency issue could be addressed if https://github.com/megvii-research/hpman/pull/4 is merged. #4 refactors the internal storage of hpman to use a dict-based look up table. That should be much faster than current implementation.

Caching __call__ is way too radical. See https://github.com/megvii-research/hpman/issues/11#issuecomment-639982277 .