vene / sparsemap

SparseMAP: differentiable sparse structure inference
MIT License
110 stars 9 forks source link

output is marginal probability #3

Open CHUNYUWANG opened 3 years ago

CHUNYUWANG commented 3 years ago

Thanks for releasing the code!

When I played with the code in the following file https://github.com/vene/sparsemap/blob/master/python/sparsemap/layers_pt/matching_layer.py

The output is a matrix. Does it represent the marginal probability for each matching?

How do you compute this marginal probability according to a sparse number of structures? Sum them?

vene commented 3 years ago

Yes, you can think of that output as "sparse marginals", they are denoted by u in the paper. Indeed it is an expectation over a sparse distribution over structures, so it is also sparse.

By the way, you might be interested in the updated project and newer paper that works in arbitrary factor graphs (generalizing this):

https://github.com/deep-spin/lp-sparsemap

Rongzihan commented 1 year ago

Thanks for the code release!

BTW, for the example given here https://github.com/vene/sparsemap/blob/master/python/sparsemap/layers_pt/matching_layer.py may I know how to do iterations to the output "matching" here? From my understanding, this example only do one time calculation, is this correct?

If I want to do many iterations to get the final u and the u in different steps, how to calculate it? Thnaks!