a1890b56835ef626b1a32edcaf28c1e2b10baa48,dit/algorithms/maxentropyfw.py,,isolate_zeros,#,67

Before Change


                zero_elements += bvec

    A = []
    b = []
    zero = []
    for i, is_zero in enumerate(zero_elements):
        if is_zero:
            eq = np.zeros(n_elements, dtype=int)
            eq[i] = 1
            A.append(eq)
            b.append(0)
            zero.append(i)

    if A:
        A = np.asarray(A)
        b = np.asarray(b)
    else:
        A = None
        b = None

    zeroset = set(zero)
    nonzero = [i for i in range(n_elements) if i not in zeroset]
    variables = Bunch(nonzero=nonzero, zero=zero)

    return A, b, variables


def initial_point(dist, k, A=None, b=None, isolated=None, **kwargs):
    

After Change


    xopt[np.abs(xopt) < tol] = 0
    xopt /= xopt.sum()

    // Do not build the full vector since this is input to the reduced
    // optimization problem.
    //xx = np.zeros(len(dist.pmf))
    //xx[variables.nonzero] = xopt
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: dit/dit
Commit Name: a1890b56835ef626b1a32edcaf28c1e2b10baa48
Time: 2015-03-19
Author: chebee7i@gmail.com
File Name: dit/algorithms/maxentropyfw.py
Class Name:
Method Name: isolate_zeros


Project Name: librosa/librosa
Commit Name: 85e89ae2495998ae69ab34abf5400164f909a548
Time: 2013-12-21
Author: brm2132@columbia.edu
File Name: librosa/core.py
Class Name:
Method Name: cqt


Project Name: kundajelab/dragonn
Commit Name: 9c158b87f5fb2dca1ed95884e667ab2fc218e1b7
Time: 2017-05-01
Author: jisraeli@stanford.edu
File Name: dragonn/models.py
Class Name: SequenceDNN
Method Name: deeplift