Fix compatibility issues with scikit-learn 1.3.0 and tensorflow 2.13.0
Closes #28 (closed) and #29 (closed).
Issue #28 (closed): Fix dtype handling in SklearnSGDModel
- Scikit-Learn 1.3.0 introduced the possibility to use any dtype for SGD-based models' weights.
- As a consequence, this MR introduces the optional 'dtype' argument to
SklearnSGDModel.__init__
and.from_parameters
methods, which is only used withsickit-learn >=1.3
and an un-initialized model. - Coherently (and for all scikit-learn versions), additional type/dtype verification has been implemented under the hood of
_unpack_batch
.
Issue #29 (closed): Fix build_keras_loss
util
- TensorFlow 2.13.0 removed
ValueError
being raised bytf.keras.losses.deserialize
when invalid string inputs are provided. - As a consequence, this MR updates the
build_keras_loss
util to internalize this change. - As a side effect, unit tests for
build_keras_loss
were implemented, resulting in identifying and fixing some bugs.
On the side, the number of collected integration test scenarios from the legacy test/function/test_main.py
was reduced from 27 (or 6 without "--fulltest" flags) to 18 (or 3 without "--fulltest"), to account for the fact that apart from the management of optimizer auxiliary variables in the Scaffold case(s), the rest of the functionalities and code branches are now tested as part of other unit and integration tests (notably, test_quickrun.py
and test_integration.py
).