bamler-lab / constriction

Entropy coders for research and production in Python and Rust.
https://bamler-lab.github.io/constriction/
Apache License 2.0
77 stars 5 forks source link

Ensure `optimize_leaky_categorical` converges #21

Closed robamler closed 1 year ago

robamler commented 1 year ago

This trivially ensures convergence by allowing each weight to either only ever grow or only ever shrink during the optimization. This change should be backward compatible since it only changes behavior in cases that previously couldn't have converged anyway.

Fixes #20.