`(batch_size, 1, input_shape)` when `label` parameter is specified.
:rtype: `np.ndarray`
grads = np.zeros((np.shape(x)[0], 2, np.shape(x)[1]))
for i in range(np.shape(x)[0]):
// get gradient for the two classes GPC can maximally have
for i_c in range(2):
ind = self.predict(x[i].reshape(1, -1))[0, i_c]
After Change
for i_c in range(2):
ind = self.predict(x[i].reshape(1, -1))[0, i_c]
sur = self.predict(np.repeat(x_preprocessed[i].reshape(1, -1),
np.shape(x_preprocessed)[1], 0) + eps * np.eye(np.shape(x_preprocessed)[1]))[:, i_c]
grads[i, i_c] = ((sur - ind) * eps).reshape(1, -1)
grads = self._apply_preprocessing_gradient(x, grads)