NeVerTools / pyNeVer

A Python library for learning and verification of neural networks and other machine learning models
Other
9 stars 3 forks source link

Refactor verification.py #27

Closed darioguidotti closed 1 month ago

darioguidotti commented 4 months ago

As we add support for non-sequential NNs, I believe we should refactor the class NeverVerification as, right now, it is very specialised for ReLU FC NNs. In particular we need to solve the following issues:

  1. we need to find a better way to pass the heuristic and parameters to use for the abstract transformers of the node (maybe a dictionary?) since, in principle, we could need specifications regarding heuristic and related parameters for non-ReLU nodes.

  2. __build_abst_network(...) need to be rewritten to support non-sequential networks. We also need to understand if this kind of function wouldn't make more sense in conversion.py. (Eventually connected to #26)

  3. __compute_output_starset(...) should be rewritten to make use of (or substituted altogether with) the forward(...) methods of the related concrete AbsNeuralNetworks (or corresponding class following #25 and #23).

sdemarch commented 4 months ago

I second the idea in point 1. to use a dictionary for the verification parameters. It is the way we handle it in SearchVerification and it could be a dictionary defined by the base class, with all verification strategies using it to store their parameters.

darioguidotti commented 4 months ago

Some notes and considerations:

sdemarch commented 4 months ago

We decided to structure the properties like this: