6c7cd14922969eb8aa7f9276e5702e081d13538a,tests/attacks/inference/test_attribute_inference.py,,test_white_box,#Any#Any#,31

Before Change


        test_diff = np.abs(inferred_test - x_test_feature)
        assert sum(train_diff) < sum(test_diff)
        //TODO: to be removed
        break

if __name__ == "__main__":
    pytest.cmdline.main("-q {} --mlFramework=scikitlearn --durations=0".format(__file__).split(" "))

After Change


        // print(classifier)
        attack = AttributeInferenceWhiteBox(classifier, attack_feature=attack_feature)
        x_train_predictions = np.array([np.argmax(arr) for arr in classifier.predict(x_train_iris)]).reshape(-1,1)
        x_test_predictions = np.array([np.argmax(arr) for arr in classifier.predict(x_test_iris)]).reshape(-1,1)
        inferred_train = attack.infer(x_train_for_attack, x_train_predictions, values=values, priors=priors)
        inferred_test = attack.infer(x_test_for_attack, x_test_predictions, values=values, priors=priors)
        train_diff = np.abs(inferred_train - x_train_feature)
        test_diff = np.abs(inferred_test - x_test_feature)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 6c7cd14922969eb8aa7f9276e5702e081d13538a
Time: 2020-05-26
Author: abigailt@il.ibm.com
File Name: tests/attacks/inference/test_attribute_inference.py
Class Name:
Method Name: test_white_box


Project Name: rtavenar/tslearn
Commit Name: 46cb0b5b2cf2d836a2cf96be95d4e25a4004675e
Time: 2018-10-22
Author: guillaume.androz@gmail.com
File Name: tslearn/clustering.py
Class Name: KShape
Method Name: _fit_one_init


Project Name: yahoo/TensorFlowOnSpark
Commit Name: 981e4266d4ea816b08a762193bd52f40cd1a3242
Time: 2019-08-07
Author: leewyang@verizonmedia.com
File Name: examples/mnist/keras/mnist_inference.py
Class Name:
Method Name: inference