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

Improved Rigor of PReLU Test #3498

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

Micky774
Copy link
Collaborator

@Micky774 Micky774 commented Nov 22, 2023

What does this PR do?

Improves the rigor of the existing PReLU activation unit test by checking for correctness in produced output, as well as verifying that the correct parameter dictionary is produced upon initialization

Fixes # (issue)

Checklist

  • This PR fixes a minor issue (e.g.: typo or small bug) or improves the docs (you can dismiss the other
    checks if that's the case).
  • This change is discussed in a Github issue/
    discussion (please add a
    link).
  • The documentation and docstrings adhere to the
    documentation guidelines.
  • This change includes necessary high-coverage tests.
    (No quality testing = no merge!)

cc: @chiamp

Copy link

google-cla bot commented Nov 22, 2023

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.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (70214f4) 52.98% compared to head (8845a65) 52.98%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3498   +/-   ##
=======================================
  Coverage   52.98%   52.98%           
=======================================
  Files          94       94           
  Lines       11206    11206           
=======================================
  Hits         5937     5937           
  Misses       5269     5269           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chiamp chiamp mentioned this pull request Nov 27, 2023
4 tasks

from flax import linen as nn

# Parse absl flags test_srcdir and test_tmpdir.
jax.config.parse_flags_with_absl()


class ActivationTest(parameterized.TestCase):
class ActivationTest(JaxTestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think JaxTestCase is deprecated. Is there a reason why we're using this over parameterized.TestCase?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't know about the deprecation and was using it for its array assert methods. I see now the recommended resolution is to use parameterized.TestCase with the usual numpy testing utils. I'll update accordingly!

Copy link
Collaborator

@chiamp chiamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@copybara-service copybara-service bot merged commit c3c4cbf into google:main Nov 28, 2023
4 checks passed
@Micky774 Micky774 deleted the prelu_correctness_check branch November 28, 2023 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants