c35b902f44627bc53be6152092bc60ae82b1fe2e,art/attacks/inference/membership_inference.py,MembershipInferenceBlackBox,fit,#MembershipInferenceBlackBox#Any#Any#Any#Any#,195
Before Change
Default is probability.
:return: An array holding the inferred membership status, 1 indicates a member and 0 indicates non-member.
if "input_type" not in kwargs.keys():
self.input_type = "probability"
else:
self.input_type = kwargs.get("input_type")
if y.shape[0] != x.shape[0]:
raise ValueError("Number of rows in x and y do not match")
if self.estimator.input_shape[0] != x.shape[1]:
raise ValueError("Shape of x does not match input_shape of classifier")
After Change
// members
features = self.estimator.loss(x, y).astype(np.float32).reshape(-1, 1)
// non-members
test_features = self.estimator.loss(test_x, test_y).astype(np.float32).reshape(-1, 1)
else:
raise ValueError("Illegal value for parameter `input_type`.")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c35b902f44627bc53be6152092bc60ae82b1fe2e
Time: 2020-08-25
Author: abigailt@il.ibm.com
File Name: art/attacks/inference/membership_inference.py
Class Name: MembershipInferenceBlackBox
Method Name: fit
Project Name: reinforceio/tensorforce
Commit Name: 62cea7fcfcc9e20b784e08bddce5dc69b9578ef4
Time: 2019-01-05
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/models/pg_model.py
Class Name: PGModel
Method Name: tf_baseline_loss
Project Name: cornellius-gp/gpytorch
Commit Name: b7be03229cc3798de8493f0b7f9b271e6be317a2
Time: 2018-10-28
Author: gardner.jake@gmail.com
File Name: gpytorch/mlls/exact_marginal_log_likelihood.py
Class Name: ExactMarginalLogLikelihood
Method Name: forward