adversarial-robustness-toolbox icon indicating copy to clipboard operation
adversarial-robustness-toolbox copied to clipboard

Enable batches with variable length/size inputs

Open davidslater opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. If the input into the PyTorch classifier wrapper has variable length samples (e.g., the batch is a 1D numpy object array, where the samples (objects) of np arrays of different length/size).

Places that currently throw errors: https://github.com/IBM/adversarial-robustness-toolbox/blob/master/art/classifiers/pytorch.py#L147 https://github.com/IBM/adversarial-robustness-toolbox/blob/master/art/classifiers/pytorch.py#L193-L194 (I think it also throws errors in gradient calculations as well - basically anywhere torch.from_numpy shows up.)

I have not tested it on Keras or TensorFlow, but I am guessing that they may have similar issues.

Describe the solution you'd like Enable input samples to classifier/estimator wrappers to be of variable size (variable length for audio, variable sizes for images, variables frames and sizes for video); this would also need to extend into the calculation of loss and class gradients for use in attacks.

davidslater avatar Jun 11 '20 21:06 davidslater

Possibly related to #458

davidslater avatar Jun 11 '20 21:06 davidslater