Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve annealer performance by about 4-fold.
...as measured on tuning readability: Got to 14.74 4x faster. Got to 11.97 in 7 vs. 27 minutes (3.8x faster). Got to 11.85 in 8 vs. 69 minutes (8.6x faster). We do this by adding caching of solution costs (hit rate ≈ 90% for the sort of single-coefficient-at-a-time nudging we've often used, 3% for the coeff-swapping approach of the bin-packing problem). We also make sure to report the best-encountered solution rather than merely the one that's current when time runs out. At the moment, the caching leaks memory since entries never expire, but the leakage is bounded by the max iterations of the annealer and is insignificant in practice. It is an open question why cache hit rate for readability is near zero: comparable single-coeff-nudgers yield a higher rate, and we wouldn't expect such a speedup for a low one. Stochasticity could be a factor. Also allow the annealer hyperparameters to be modified through constructor params. I haven't yet found any that are both faster and better, but various useful balances are achievable, like [10643.296506954695, 113.30886882813805, 0.023803813406736214, 4.231731642265747], which finds solutions about half as good but finds them 32x faster.
- Loading branch information