keras icon indicating copy to clipboard operation
keras copied to clipboard

Add sparse input discretization test

Open AlvaroMaza opened this issue 1 year ago • 14 comments

For my first commit to Keras, I picked the TODO in discretization_test.py.

Please let me know if I misunderstood the requirements, or otherwise made any mistakes.

Thank you!

AlvaroMaza avatar Dec 04 '23 12:12 AlvaroMaza

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Dec 04 '23 12:12 google-cla[bot]

Please take a look at the test failures.

fchollet avatar Dec 04 '23 17:12 fchollet

Changed it so that it checks if the backend is tensorflow

AlvaroMaza avatar Dec 04 '23 18:12 AlvaroMaza

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (9620d23) 79.30% compared to head (b1ac669) 79.49%. Report is 56 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18882      +/-   ##
==========================================
+ Coverage   79.30%   79.49%   +0.18%     
==========================================
  Files         336      336              
  Lines       34549    34863     +314     
  Branches     6799     6853      +54     
==========================================
+ Hits        27400    27713     +313     
- Misses       5567     5572       +5     
+ Partials     1582     1578       -4     
Flag Coverage Δ
keras 79.34% <ø> (+0.17%) :arrow_up:
keras-jax 61.22% <ø> (-0.13%) :arrow_down:
keras-numpy 55.96% <ø> (-0.13%) :arrow_down:
keras-tensorflow 63.22% <ø> (-0.12%) :arrow_down:
keras-torch 63.82% <ø> (-0.28%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Dec 04 '23 23:12 codecov-commenter

This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Dec 26 '23 01:12 github-actions[bot]

@google-cla @github-actions @codecov-commenter #19024 #19023

Sent with GitHawk

davidmerwin avatar Jan 04 '24 16:01 davidmerwin

@google-cla @github-actions @codecov-commenter #19024 #19023 ...

@davidmerwin 4ce03f74-98a8-4242-b923-b60ae71d9b1c

@google-cla @codecov-commenter @github-actions #19022

4ce03f74-98a8-4242-b923-b60ae71d9b1c

Sent with GitHawk

davidmerwin avatar Jan 04 '24 16:01 davidmerwin

@AlvaroMaza Hello! I have a pr right now. And I am changing this file too. Would you be comfortable if I added you as a Coauthor (Co-authored-by) to acknowledge your contributions and incorporate your patches? Your expertise would be greatly valued. This is my patch in a test branch: https://github.com/dugujiujian1999/keras/commit/42775397bfef24c295dbc5458b61a52167a685ea And this is my pr: https://github.com/keras-team/keras/pull/19020

dugujiujian1999 avatar Jan 05 '24 16:01 dugujiujian1999

Sorry for the delay in merging, this was pending due to a failing test. Re-running now.

fchollet avatar Jan 05 '24 17:01 fchollet

Looks like the import breaks something.

dugujiujian1999 avatar Jan 06 '24 00:01 dugujiujian1999

I believe it would be beneficial to reconsider the import method. Here's the suggested approach

if backend.backend() == "tensorflow":
    from keras.utils.module_utils import tensorflow as tf

    print("Using TensorFlow backend.")
    print("TensorFlow version:", tf.__version__)
    print(tf.sparse.from_dense(np.array([[-1.0, 0.2, 0.7, 1.2]])))

dugujiujian1999 avatar Jan 06 '24 01:01 dugujiujian1999

@AlvaroMaza Hello! I have a pr right now. And I am changing this file too. Would you be comfortable if I added you as a Coauthor (Co-authored-by) to acknowledge your contributions and incorporate your patches? Your expertise would be greatly valued. This is my patch in a test branch: dugujiujian1999@4277539 And this is my pr: #19020

Yes of course! No problem at all!

AlvaroMaza avatar Jan 06 '24 17:01 AlvaroMaza

@AlvaroMaza Thank you. I've integrated the patch you provided and subsequently opened a new pr here. FYI: https://github.com/keras-team/keras/pull/19029

dugujiujian1999 avatar Jan 07 '24 10:01 dugujiujian1999

@AlvaroMaza, Looks like there is some conflict with the branch you are working on, could you please resolve it.

sachinprasadhs avatar Jan 17 '24 23:01 sachinprasadhs

Closing inactive stale PR -- feel free to reopen a new one.

fchollet avatar Mar 22 '24 20:03 fchollet