Previously there were nan_to_num()s sprinkled ad hoc to make training work even when the sum-product is infinite. Now semirings.py consistently follows the rule that inf * 0 = 0 (e.g., https://link-springer-com.proxy.library.nd.edu/chapter/10.1007/978-3-642-01492-5_1 page 7) to avoid NaNs, and there is just one use of nan_to_num() outside of semirings.py.
Previously there were nan_to_num()s sprinkled ad hoc to make training work even when the sum-product is infinite. Now semirings.py consistently follows the rule that inf * 0 = 0 (e.g., https://link-springer-com.proxy.library.nd.edu/chapter/10.1007/978-3-642-01492-5_1 page 7) to avoid NaNs, and there is just one use of nan_to_num() outside of semirings.py.