Skip to content
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

Merging 0.10.0rc1 back to master #550

Merged
merged 16 commits into from
Jul 7, 2022
Merged

Merging 0.10.0rc1 back to master #550

merged 16 commits into from
Jul 7, 2022

Conversation

ascillitoe
Copy link
Contributor

Merging 0.10.0rc1 back to master so that we can include the optional dependency work (#537) in the final 0.10.0 release.

Changes to detector kwargs and addition of get_config methods.
Addition of pydantic validation of detector configs
Main config driven save/load functionality, testing, and docs.
Utility functions to get and set seeds for the Python, Numpy, TensorFlow and PyTorch random number generators.
This PR implements a number of final fixes and refactorings for the config driven detectors:

1. The `preprocess_at_init` and `preprocess_at_pred` logic implemented in #381 and #458 has been reworked. This turned out to have a problem in how it dealt with `update_x_ref`, since regardless of `x_ref_preprocessed`, we still need to update reference data within `.predict()` when `update_x_ref` is set. All offline drift detectors have been reworked to use the old logic (but with `preprocess_x_ref` renamed `preprocess_at_init`), with the addition that `self.x_ref_preprocessed` is also checked internally. 
2. The previous `get_config` methods involved a lot of boilerplate to try to recover the original args/kwargs from detector attributes. The new approach calls a generic `_set_config()` with `__init__`, and then `self.config` is returned by `get_config`. This should significantly reduce the workload to add save/load to new detectors. To avoid memory overheads, large artefacts such as `x_ref` are not set at `__init__`, and instead are added within `get_config`. 
3. Owing to the ease of implementation with the new `get_config` approach, save/load has been added for the model uncertainty and online detectors!
4. Kernels and `preprocess_fn`'s were previously resolved in `_load_detector_config`, which wasn't consistent with how other artefacts were resolved (it also caused added extra challenges). These are now resolved in `resolve_config` instead. Following this the `KernelConfigResolved` and `PreprocessConfigResolved` pydantic models have been removed (they could be added back but it would complicate `resolve_config`).
5. Fixing determinism in #496 has allowed us to compare original and loaded detector predictions in `test_saving.py`. This uncovered bugs with how kernels were saved and loaded. These have been fixed.
6. The readthedocs.yml has been fully updated to the V2 schema so that we can use Python 3.9 for building the docs. This is required as the `class NDArray(Generic[T], np.ndarray[Any, T])` in `utils._typing` causes an error with `autodoc` on older Python versions.
* Fix for sklearn classifier

* Fix issue with orig_files in saving.py

* Fix NDArray on Python<3.9
Add MANIFEST.in, update CHANGELOG.md and version info.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ascillitoe
Copy link
Contributor Author

All tests passed except cd_clf_cifar10.ipynb which timed out.

@ascillitoe ascillitoe merged commit d05ec7d into master Jul 7, 2022
ascillitoe added a commit that referenced this pull request Jul 7, 2022
ascillitoe added a commit that referenced this pull request Jul 7, 2022
ascillitoe added a commit that referenced this pull request Jul 7, 2022
Repeating #550 (which was reverted) to merge without squashing:

"Merging 0.10.0rc1 back to master so that we can include the optional dependency work (#537) in the final 0.10.0 release."
@ascillitoe ascillitoe deleted the release/0.10.0 branch January 23, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant