Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a label check for Trades adversarial trainer. #2230

Closed
GiulioZizzo opened this issue Jul 28, 2023 · 0 comments · Fixed by #2231
Closed

Adding a label check for Trades adversarial trainer. #2230

GiulioZizzo opened this issue Jul 28, 2023 · 0 comments · Fixed by #2231
Assignees
Labels
improvement Improve implementation
Projects
Milestone

Comments

@GiulioZizzo
Copy link
Collaborator

Describe the bug
The trades adversarial trainer assumes in a few places that the label format is one-hot encoded. We propose a simple change to check the dimensionality of the supplied labels in a few places before applying an argmax operation.

To Reproduce
Steps to reproduce the behavior:

  1. Go to test_adversarial_trainer_trades_pytorch.py
  2. Add a line such as y_test_mnist = np.argmax(y_test_mnist, axis=1) after loading the MNIST data to give labels in index style.
  3. numpy.AxisError: axis 1 is out of bounds for array of dimension 1 error will be given.

Expected behavior
The classifier should be able to handle different label formats, or provide an informative warning message if the wrong label format is supplied.

System information (please complete the following information):

  • OS: MacOS
  • Python version: 3.9
  • ART version or commit number: ART 1.15
  • TensorFlow / Keras / PyTorch / MXNet version: torch==2.0.1
@beat-buesser beat-buesser added the improvement Improve implementation label Aug 7, 2023
@beat-buesser beat-buesser added this to the ART 1.15.1 milestone Aug 7, 2023
@beat-buesser beat-buesser added this to Issues open in ART 1.15.1 Aug 10, 2023
@beat-buesser beat-buesser moved this from Issues open to Issues in progress in ART 1.15.1 Aug 10, 2023
@beat-buesser beat-buesser linked a pull request Aug 17, 2023 that will close this issue
12 tasks
@beat-buesser beat-buesser moved this from Issues in progress to Issues closed in ART 1.15.1 Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improve implementation
Projects
No open projects
ART 1.15.1
Issues closed
Development

Successfully merging a pull request may close this issue.

2 participants