cbe2758007e312c168aef30328693027b6a4b7e9,conceptnet5/vectors/debias.py,,de_bias_category,#Any#Any#Any#,502

Before Change


    // Make a modified version of the space that projects the bias vectors to 0.
    // Then weight each row of that space by "applicability", the probability
    // that each row should be de-biased.
    modified_component = reject_subspace(frame, components_to_reject).mul(applicability, axis=0)
    del components_to_reject

    // Make another component representing the vectors that should not be
    // de-biased: the original space times (1 - applicability).

After Change



    // Make another component representing the vectors that should not be
    // de-biased: the original space times (1 - applicability).
    np.multiply(1 - applicability.reshape((len(frame), 1)), frame.values,
                out=frame.values)

    // The sum of these two components is the de-biased space, where de-biasing
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: commonsense/conceptnet5
Commit Name: cbe2758007e312c168aef30328693027b6a4b7e9
Time: 2018-06-06
Author: rbeaudoin@luminoso.com
File Name: conceptnet5/vectors/debias.py
Class Name:
Method Name: de_bias_category


Project Name: pytorch/examples
Commit Name: 645c7c386e62d2fb1d50f4621c1a52645a13869f
Time: 2018-04-24
Author: soumith@gmail.com
File Name: word_language_model/generate.py
Class Name:
Method Name:


Project Name: commonsense/conceptnet5
Commit Name: cbe2758007e312c168aef30328693027b6a4b7e9
Time: 2018-06-06
Author: rbeaudoin@luminoso.com
File Name: conceptnet5/vectors/debias.py
Class Name:
Method Name: de_bias_binary