Replies: 1 comment 12 replies
-
Hi @madarax64 The linked notebook did not work because there is no estimator yet that provides gradient calculations for pipelines. The |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to implement black-box attacks against a classifier, which has the usual Sklearn interface i.e fit() and predict() methods. Therefore I made an SKLearn pipeline which converts my input (1D sequence) into a feature vector, then classifies the feature vector using a Logistic Regression classifier. I began with the example in this notebook but it didn't work. I eventually arrived at the BlackBoxClassifier, which allows me supply a simple prediction function. However, even after ensuring that the function produces the output in the specified format (i.e as 1-hot encoded prediction vectors stacked into a matrix) it still doesnt work. I get the following error:
<stack trace>
predictions[begin:end] = self.predict_fn(x_preprocessed[begin:end])
ValueError: setting an array element with a sequence.
I also tried wrapping the pipeline in an
SklearnClassifier
object as follows:wrapper = SklearnClassifier(model = pipeline)
But attempting to generate the attack gives me a completely different error:
<stack trace>
self.theta = 0.01 / np.prod(self.estimator.input_shape)
TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'
Could you please tell me how to resolve these issues?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions