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

implement batch_normalization #19543

Merged
merged 1 commit into from
Apr 18, 2024
Merged

implement batch_normalization #19543

merged 1 commit into from
Apr 18, 2024

Conversation

lkarthee
Copy link
Contributor

Implemented batch_normalisation, divide_no_nan and few fixes for imports.

Copy link

google-cla bot commented Apr 18, 2024

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.

@lkarthee
Copy link
Contributor Author

Batch Normalisation Test Results
└─▶ KERAS_BACKEND=mlx SKIP_APPLICATIONS_TESTS=True pytest keras/layers/normalization/batch_normalization_test.py
=========================================================================== test session starts ============================================================================
platform darwin -- Python 3.12.2, pytest-8.1.1, pluggy-1.4.0 -- keras/.venv/bin/python3.12
cachedir: .pytest_cache
rootdir: keras
configfile: pyproject.toml
plugins: cov-5.0.0
collected 26 items

keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_bachnorm_ignore_masked_values0 PASSED                                           [  3%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_bachnorm_ignore_masked_values1 PASSED                                           [  7%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_bachnorm_ignore_masked_values2 PASSED                                           [ 11%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_bachnorm_ignore_masked_values3 PASSED                                           [ 15%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_bachnorm_ignore_masked_values4 PASSED                                           [ 19%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_bachnorm_ignore_masked_values5 PASSED                                           [ 23%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_bn_basics PASSED                                                                [ 26%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness0 PASSED                                                             [ 30%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness1 PASSED                                                             [ 34%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness10 PASSED                                                            [ 38%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness11 PASSED                                                            [ 42%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness12 PASSED                                                            [ 46%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness13 PASSED                                                            [ 50%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness14 PASSED                                                            [ 53%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness15 PASSED                                                            [ 57%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness2 PASSED                                                             [ 61%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness3 PASSED                                                             [ 65%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness4 PASSED                                                             [ 69%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness5 PASSED                                                             [ 73%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness6 PASSED                                                             [ 76%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness7 PASSED                                                             [ 80%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness8 PASSED                                                             [ 84%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_correctness9 PASSED                                                             [ 88%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_input_fully_masked0 PASSED                                                      [ 92%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_large_value_within_autocast_scope PASSED                                        [ 96%]
keras/layers/normalization/batch_normalization_test.py::BatchNormalizationTest::test_trainable_behavior PASSED                                                       [100%]

============================================================================ 26 passed in 3.99s ============================================================================

Copy link
Collaborator

@fchollet fchollet left a comment

Choose a reason for hiding this comment

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

Thank you for the PR -- it looks good!

There are several refactors we need to perform right now when we merge master (e.g. we use from keras import tree now, and the code is located at keras/src/ rather than keras/). But they're out of scope for this PR, we'll handle that in the next merge.

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Apr 18, 2024
@fchollet fchollet merged commit 47c032d into keras-team:mlx Apr 18, 2024
6 of 8 checks passed
@google-ml-butler google-ml-butler bot removed ready to pull Ready to be merged into the codebase kokoro:force-run labels Apr 18, 2024
lkarthee added a commit to lkarthee/keras that referenced this pull request Apr 19, 2024
lkarthee added a commit to lkarthee/keras that referenced this pull request Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Assigned Reviewer
Development

Successfully merging this pull request may close these issues.

3 participants