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

Before Change


        p = (self.logits - shift).exp().clamp(min=finfo.tiny ** 0.5)
        d = 2 / p.sum(0)
        for _ in range(self.bp_iters):
            s = 1 / (p @ d)
            d = 2 / (s @ p)
        b = s[:, None] * d * p

        // Evaluate the Bethe free energy, adapting [4] Eqn 4 to one-two
        // matchings.

After Change


        shift = self.logits.max(1, True).values
        shift.data.clamp_(min=finfo.min, max=finfo.max)
        logits = self.logits - shift
        d = logits.logsumexp(0) - math.log(2)
        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):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: SPFlow/SPFlow
Commit Name: 6ce049fae6ac83de1c88f2237308f315c84eb7e0
Time: 2020-01-29
Author: molina@cs.tu-darmstadt.de
File Name: src/spn/experiments/layers/Vectorized.py
Class Name:
Method Name: sum_lambda


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


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