-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[tmva][pymva] Deprecate the PyKeras method
#20588
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
Conversation
The new Keras 3 API broke the existing TMVA `PyKeras` method. Re-implementing the method for Keras 3 turned out to be difficult, as it is not possible anymore to disable eager execution and have a decent speed in evaluating the model for single events. So large-scale refactoring would be necessary to implement `PyKeras` again with good performance (see also root-project#15790). Nowadays, we also have the RBatchGenerator to train Keras models directly with batches that are provided by ROOT. Therefore, the TMVA `PyKeras` method is not the only way anymore to train a Keras model with ROOT data without 3rd party libraries for the IO. That means it's not an essential feature anymore, and deprecating it will even make the situation clearer for the user, as there are not two different ways anymore to train Keras models on ROOT data.
| kPyAdaBoost , | ||
| kPyGTB , | ||
| kPyKeras , | ||
| kPyKeras, // deprecated, will be removed in ROOT 6.42 |
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 we mark this with R__DEPRECATED?
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.
I don't think you can mark individual enum elements as deprecated with R__DEPRECATED (it's only for functions and classes).
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.
Actually you can since C++17! (and we're doing it already, see RNTupleTypes.hxx)
|
I would wait to deprecate the PyKeras interface. Once we merge #15790, the work in refactoring is already done there, we can easily support Keras 3. |
Test Results 22 files 22 suites 3d 20h 28m 48s ⏱️ For more details on these failures, see this check. Results for commit c49354f. |
|
Let's give some more time to @lmoneta to fix PyMVA. |
The new Keras 3 API broke the existing TMVA
PyKerasmethod.Re-implementing the method for Keras 3 turned out to be difficult, as it is not possible anymore to disable eager execution and have a decent speed in evaluating the model for single events. So large-scale refactoring would be necessary to implement
PyKerasagain with good performance (see also #15790).Nowadays, we also have the RBatchGenerator to train Keras models directly with batches that are provided by ROOT. Therefore, the TMVA
PyKerasmethod is not the only way anymore to train a Keras model with ROOT data without 3rd party libraries for the IO. That means it's not an essential feature anymore, and deprecating it will even make the situation clearer for the user, as there are not two different ways anymore to train Keras models on ROOT data.Note that it doesn't help us in this case to use the deprecation macros, because
tmva-pymvais always disabled anyway. So we would not benefit from the automatic removal-reminder errors that one would get in the next development cycle.I also opened a separate PR that exercises the eventual removal in the next development cycle, also showing that after
PyKerasis gone, we can enabletmva-pymvaagain, as the other methods it provides work just fine (except for for corner cases like PyTorch on Linux ARM):PyKerasmethod #20577