-
Notifications
You must be signed in to change notification settings - Fork 93
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
Maraboupy core tests #287
Maraboupy core tests #287
Conversation
maraboupy/test/test_core.py
Outdated
ipq.setLowerBound(1, 1) | ||
ipq.setUpperBound(1, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be 0,1 ? otherwise you set x and relu(x) to be always 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make more sense, and I changed it to 0, LARGE because the upper bound comes from the upper bound on the first variable, which Marabou should propagate. I've reformatted the tests a little bit to also check that Marabou provides a default bounds when none are provided, and that bound propagation tightens these bounds as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Do you understand why codecov marks it as fail?
Yeah, codecov is mad that I didn't write a test for the small change I made to Marabou.py. To test that part of the code, we'd have to run tests without numpy installed. I've tested it on my machine, and I don't think it's worth trying to configure tests to run without numpy to show it works. |
* Adding core tests * Updates to testing
* Adding core tests * Updates to testing
The file maraboupy/tests.py was moved and refurbished to create the test_core.py, which tests that Marabou can be called from python by interacting directly with MarabouCore. The test can be run with only pytest installed. Moving MarabouNetworkNNet import into a try block allows Maraboupy to work even when numpy is not installed.
This is a starting point for testing MarabouCore, but there are additional functions not yet tested, such as
In addition, MarabouCore.cpp is not yet part of code coverage