42dc18f2a13441eefdfceed905843a3d19b27072,pyro/distributions/one_two_matching.py,OneTwoMatching,log_partition_function,#OneTwoMatching#,101

Before Change



        // Evaluate the Bethe free energy, adapting [4] Eqn 4 to one-two
        // matchings.
        b = b.clamp(min=finfo.tiny ** 0.5)
        b_ = (1 - b).clamp(min=finfo.tiny ** 0.5)
        internal_energy = -(b * p.log()).sum()
        // Let h be the entropy of matching each destin to one source.
        z = b / 2

After Change


        for _ in range(self.bp_iters):
            s = (logits - d).logsumexp(-1, True)
            d = (logits - s).logsumexp(0) - math.log(2)
        b = (logits - (d + s)).exp()

        def log(x):
            return x.clamp(min=finfo.tiny).log()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: uber/pyro
Commit Name: 42dc18f2a13441eefdfceed905843a3d19b27072
Time: 2020-12-07
Author: fritz.obermeyer@gmail.com
File Name: pyro/distributions/one_two_matching.py
Class Name: OneTwoMatching
Method Name: log_partition_function


Project Name: kengz/SLM-Lab
Commit Name: 5ec2a0fff89393224eb0ebebd5257ef2d3d16c3f
Time: 2018-08-07
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/policy_util.py
Class Name:
Method Name: sample_action_pd


Project Name: uber/pyro
Commit Name: 42dc18f2a13441eefdfceed905843a3d19b27072
Time: 2020-12-07
Author: fritz.obermeyer@gmail.com
File Name: pyro/distributions/one_one_matching.py
Class Name: OneOneMatching
Method Name: log_partition_function