f529deccde4a185a6c0f98f0968154f922abb86e,Lib/sandbox/pyem/densities.py,,_diag_gauss_den,#Any#Any#Any#Any#,132

Before Change


    if not log:
        inva = 1/va[0, 0]
        fac = (2*N.pi) ** (-d/2.0) * N.sqrt(inva)
        y =  (x[:, 0] - mu[0, 0]) ** 2 * inva * -0.5
        for i in range(1, d):
            inva = 1/va[0, i]
            fac *= N.sqrt(inva)
            y += (x[:, i] - mu[0, i]) ** 2 * inva * -0.5
        y = fac * N.exp(y)
    else:
        y = _scalar_gauss_den(x[:, 0], mu[0, 0], va[0, 0], log)
        for i in range(1, d):

After Change


        inva *= -0.5
        x = x - mu
        x **= 2
        y = fac * N.exp(N.dot(x, inva))
    else:
        // XXX optimize log case as non log case above
        y = _scalar_gauss_den(x[:, 0], mu[0, 0], va[0, 0], log)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: scipy/scipy
Commit Name: f529deccde4a185a6c0f98f0968154f922abb86e
Time: 2007-07-12
Author: cournape@gmail.com
File Name: Lib/sandbox/pyem/densities.py
Class Name:
Method Name: _diag_gauss_den


Project Name: rtavenar/tslearn
Commit Name: 7ea8c3e6d162ef47fbcfcb6621ff7633d91ae61d
Time: 2020-04-16
Author: francois-33
File Name: tslearn/early_classification.py
Class Name: NonMyopicEarlyClassification
Method Name: _expected_cost


Project Name: data61/python-paillier
Commit Name: 103e31b4a2518797606d3b93440740df0532770d
Time: 2017-06-20
Author: giorgio.patrini@anu.edu.au
File Name: examples/federated_learning_with_encryption.py
Class Name: Client
Method Name: compute_gradient