8ea593ba135faf00d9ba39f393682172366eee9b,conceptnet5/vectors/retrofit.py,,retrofit,#Any#Any#Any#Any#Any#,53

Before Change



    // Subtract the mean so that vectors don"t just clump around common
    // hypernyms
    orig_vecs -= orig_vecs.mean(0)

    // Delete the frame we built, we won"t need its indices again until the end
    del retroframe

After Change


    // Subtract the mean so that vectors don"t just clump around common
    // hypernyms
    for row_group in row_groups:
        orig_vecs[row_group] -= orig_vecs[row_group].mean(0)

    // Delete the frame we built, we won"t need its indices again until the end
    del retroframe

    vecs = orig_vecs
    for iteration in range(iterations):
        if verbosity >= 1:
            print("Retrofitting: Iteration %s of %s" % (iteration+1, iterations))

        vecs = sparse_csr.dot(vecs)
        for row_group in row_groups:
            orig_vecs[row_group] -= orig_vecs[row_group].mean(0)

        // use sklearn"s normalize, because it normalizes in place and
        // leaves zero-rows at 0
        normalize(vecs, norm="l2", copy=False)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: commonsense/conceptnet5
Commit Name: 8ea593ba135faf00d9ba39f393682172366eee9b
Time: 2017-06-09
Author: rob@luminoso.com
File Name: conceptnet5/vectors/retrofit.py
Class Name:
Method Name: retrofit


Project Name: SheffieldML/GPy
Commit Name: fce4dd7fdea42d24abb14396d02bf1bf475e15d7
Time: 2013-04-01
Author: neil@stefano.(none)
File Name: GPy/util/mocap.py
Class Name:
Method Name: load_text_data


Project Name: commonsense/conceptnet5
Commit Name: 19a796cf092d0b0f88e2919cbee45bb5270835cf
Time: 2017-06-21
Author: rob@luminoso.com
File Name: conceptnet5/vectors/retrofit.py
Class Name:
Method Name: retrofit


Project Name: alexandrebarachant/muse-lsl
Commit Name: 858862178de7e298be10dda06b5bdc3f8bb5dc12
Time: 2017-06-27
Author: morrisondano@gmail.com
File Name: lsl-viewer.py
Class Name: LSLViewer
Method Name: update_plot


Project Name: commonsense/conceptnet5
Commit Name: 8ea593ba135faf00d9ba39f393682172366eee9b
Time: 2017-06-09
Author: rob@luminoso.com
File Name: conceptnet5/vectors/retrofit.py
Class Name:
Method Name: retrofit