19a796cf092d0b0f88e2919cbee45bb5270835cf,conceptnet5/vectors/retrofit.py,,retrofit,#Any#Any#Any#Any#Any#,54

Before Change


    for i, label in enumerate(row_labels):
        lang = get_language(label)
        rows_by_language[lang].append(i)
    all_languages = sorted(rows_by_language)
    row_groups = [rows_by_language[lang] for lang in all_languages]

    // Subtract the mean so that vectors don"t just clump around common
    // hypernyms
    for row_group in row_groups:

After 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

    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)
        vecs -= vecs.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: 3

Non-data size: 6

Instances


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: scikit-learn-contrib/DESlib
Commit Name: f0c15f219b0761b14329ddd416cda82fa4bae841
Time: 2018-03-28
Author: rafaelmenelau@gmail.com
File Name: deslib/dcs/mcb.py
Class Name: MCB
Method Name: estimate_competence


Project Name: IndicoDataSolutions/finetune
Commit Name: 2ad9e8af614767e645c4358ae1e2444f02d4573b
Time: 2018-08-22
Author: madison@indico.io
File Name: finetune/sequence_labeling.py
Class Name: SequenceLabeler
Method Name: predict