diprism / fggs

Factor Graph Grammars in Python
MIT License
13 stars 3 forks source link

Sum-product on log-weights #94

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

Currently we compute sum-products on weights, but it would be better in a lot of applications to use log-weights. We can use semiring-einsum (https://bdusell.github.io/semiring-einsum/) to do this.

davidweichiang commented 2 years ago

This is partially working in branch https://github.com/diprism/fgg-implementation/tree/semiring but only for the fixed-point method. Newton's method is stuck because we don't have a way to do torch.linalg.solve in the log semiring.