This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def simple_cf_generator(factual_oh, adapted_nn, tolerance=100): | |
# Get the current prediction result of the factual class | |
current_pred = adapted_nn.predict(np.array([factual_oh]))[0][0] | |
# The predictor will always start with a probability lower than 0.5 | |
if current_pred < 0.5: | |
predictor = adapted_nn.predict | |
else: | |
predictor = lambda x: 1 - adapted_nn(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
absl-py==1.0.0 | |
alabaster==0.7.12 | |
albumentations==0.1.12 | |
altair==4.2.0 | |
appdirs==1.4.4 | |
argon2-cffi==21.3.0 | |
argon2-cffi-bindings==21.2.0 | |
arviz==0.12.0 | |
astor==0.8.1 | |
astropy==4.3.1 |