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

Before Change



    // Make another component representing the vectors that should not be
    // de-biased: the original space times (1 - applicability).
    result = frame.mul(1 - applicability, axis=0)

    // The sum of these two components is the de-biased space, where de-biasing
    // applies to each row proportional to its applicability.
    np.add(result.values, modified_component.values, out=result.values)
    del modified_component

    // L_2-normalize the resulting rows in-place.
    normalize(result.values, norm="l2", copy=False)
    return result


def de_bias_frame(frame):
    

After Change


    // Then weight each row of that space by "applicability", the probability
    // that each row should be de-biased.  This is also done on shards.
    modified_component = np.zeros(shape=frame.values.shape, dtype=np.float32)
    for shard_start, shard_end in make_shard_endpoints(len(frame)):
        modified_component[shard_start:shard_end, :] = \
            reject_subspace(frame[shard_start:shard_end], components_to_reject).mul(
                applicability[shard_start:shard_end], axis=0).values
    del components_to_reject

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

Frequency: 3

Non-data size: 4

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: 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


Project Name: cornellius-gp/gpytorch
Commit Name: b35804cc94a487791f194faed5dde1c642dcee11
Time: 2019-11-10
Author: gpleiss@gmail.com
File Name: gpytorch/likelihoods/gaussian_likelihood.py
Class Name: GaussianLikelihood
Method Name: expected_log_prob