The code can be found here:
https://github.com/google-research/google-research/tree/master/entropy_semiring