Conversation
rminism, regenerated reference data, formatted with black and isort
This commit refactors tests by removing redundant comments and code, updates the order and node parameters in generate_reference_data.py, reduces the number of epochs in training to improve performance, ensures consistent network output, and updates binary reference data for regression tests. It also modifies certain parameters and test setups for improved performance and more efficient testing across regression and training scripts.
… brevity and replaced custom test runner with pytest.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive test suite, implements deterministic behavior for reproducible training, and formats the codebase using black and isort for consistent styling.
- Adds regression and training tests with 30 test cases for both Lorenz and advection-diffusion systems
- Fixes TensorFlow and numpy seeds to ensure deterministic neural network outputs and training
- Formats all Python files using black and isort to improve code readability and maintainability
Reviewed Changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| main/x_grid.py | Reformatted nested arrays and improved error handling for missing nodes/weights |
| main/tests/test_*.py | Added comprehensive test suites for network initialization, training behavior, and regression testing |
| main/requirements.txt | Added testing and formatting dependencies (pytest, black, isort) |
| main/pyproject.toml | Added isort configuration to match black formatting |
| main/newton.py | Reformatted code for improved readability |
| main/neural_net.py | Added deterministic seed handling and reformatted network definitions |
| main/main.py | Reformatted imports and function calls for consistency |
| main/irk_coefficients.py | Reformatted nested arrays and improved code structure |
| main/README.md | Added project documentation explaining the PINN algorithm and usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
crewsdw
left a comment
There was a problem hiding this comment.
Looks good to me. I set up my system to run these scripts again, working on your new branch. Interestingly, I'm not seeing the Newton step converge like it used to. Not sure what's going on with that. I need to check against the original write-up.
Interesting stuff with the tests. So the intention is to port this to pytorch? Is it better for this kind of application?
Since the architecture is pretty simple, I don't think it would be worth it to move to pytorch, we can stick with TF. It could be that there is seed sensitivity or the upgrade to the latest TF broke something. |
To run tests, from the root of the repo run
"pytest ."
Make sure you have installed all the requirements into your python environment via
pip install -r requirements.txtTesting results: