root icon indicating copy to clipboard operation
root copied to clipboard

[tmva][pymva] Improve evaluations in pymva and add support for Keras3 (TF >= 2.16)

Open lmoneta opened this issue 1 year ago • 2 comments

This Pull request starts adding support for new TF version (2.16) coming with Keras3 API.

In addition, it improves the evaluation of models for regression and multi-class by using all events instead of the single event as before. With TF 2.16 s not possible anymore to disable eager execution and have a decent speed i evaluating the model

lmoneta avatar Jun 07 '24 14:06 lmoneta

Test Results

    12 files      12 suites   2d 18h 59m 0s :stopwatch:  2 645 tests  2 645 :white_check_mark: 0 :zzz: 0 :x: 30 016 runs  30 016 :white_check_mark: 0 :zzz: 0 :x:

Results for commit 6e3a9d94.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Jun 07 '24 16:06 github-actions[bot]

Thanks for the PR. Is this code tested anywhere?

dpiparo avatar Jun 10 '24 18:06 dpiparo

Hi @lmoneta, how should we proceed here? There is now TensorFlow 2.19 already, and the last TensorFlow we support is still the 2.15 release. I think the real question is: it it actually worth it to support inference with TensorFlow/Keras given the declining popularity of TensorFlow?

  • https://apxml.com/posts/is-tensorflow-still-relevant
  • https://thenextweb.com/news/why-tensorflow-for-python-is-dying-a-slow-death
  • https://www.reddit.com/r/MachineLearning/comments/16rs7x9/d_is_tensorflow_dead_or_heading_in_that_direction/

The list can go on.

guitargeek avatar May 04 '25 18:05 guitargeek

Also, maybe it makes sense to split the TensorFlow compatibility and the other commit with the general improvements into two separate PRs? Then we can already merge the other improvements, because they are covered by the CI. For the TensorFlow compatibility, we have once again the chicken-and-egg problem that it will only be covered once we allow TF>=2.16 in our requirements.txt for the CI images to pick up, but then builds will be red until the compatibility fix is merged...

guitargeek avatar May 04 '25 18:05 guitargeek

For the TensorFlow compatibility, we have once again the chicken-and-egg problem that it will only be covered once we allow TF>=2.16 in our requirements.txt for the CI images to pick up, but then builds will be red until the compatibility fix is merged...

This problem was resolved now by disabling tmva-pymva in the CI, so that the newest TensorFlow could be installed in the CI images. @lmoneta, if you want, you can now resolve the merge conflicts in this PR to continue working on compatibility with the newest TensorFlow, and our CI will cover it! You just have to turn tmva-pymva back on as well: https://github.com/root-project/root/blob/master/.github/workflows/root-ci-config/buildconfig/global.txt#L94

guitargeek avatar Jun 25 '25 07:06 guitargeek