Skip to content

pyNeVer no longer works with convolutional neural networks #40

@AndreaGimelli

Description

@AndreaGimelli

Describe the bug

pyNeVer does not work with convolutional neural networks anymore. When running verification, the following error is encountered:

  File "C:\Users\andr3\PycharmProjects\pyNeVer\pynever\strategies\verification\ssbp\propagation.py", line 203, in make_star_from_bounds
    predicate = LinearFunctions(torch.Tensor(predicate_matrix), torch.Tensor(predicate_bias))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: only one element tensors can be converted to Python scalars

Steps to reproduce

  • Use pyNeVer with a convolutional neural network model
  • Attempt to run verification
  • Observe the ValueError above

Expected behavior

pyNeVer should support verification for convolutional neural networks without raising this error.

Additional context

  • The issue appears related to tensor shape handling in the make_star_from_bounds function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions