NeVerTools / pyNeVer

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

Refactor abstraction.py #25

Closed sdemarch closed 18 hours ago

sdemarch commented 3 months ago

Restructure the module abstraction.py to handle abstract interpretation objects and methods

darioguidotti commented 3 months ago

It might make sense to transform AbsNeuralNetwork into a wholly abstract class, requiring the implementation of forward and backward methods. Subsequently, we would have AbsSeqNetwork and AbsAcyclicNetwork, both inheriting from AbsNeuralNetwork as well as their respective counterparts in networks.py (SequentialNetwork and AcyclicNetwork). This approach ensures the inheritance of all node management methods, mitigating redundancy in the codebase.

To make this approach work we will need to complete the planned refactoring in node.py (#24) and networks.py (#23).

sdemarch commented 3 months ago

Should it be the case that, instead of a method build_abs_network in verification.py, the same procedure is the abstract class constructor in abstraction.py? It is (and should) never the case that an abstract network is initialized without the complete concrete network.

TL;DR AbsSeqNetwork init method should contain the code of __build_abs_seq_network?

sdemarch commented 3 months ago

We decided to structure the module as follows: