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

Changes batch norm momentum defaults to 1-momentum #2100

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

dantreiman
Copy link
Collaborator

tensorflow.keras Batch Norm momentum is parameterized as 1 - torch Batch Norm momentum:

tf.keras.layers.BatchNormalization: (default momentum: 0.99)
moving_mean = moving_mean * momentum + mean(batch) * (1 - momentum)

torch.nn.BatchNorm1d: (default momentum: 0.1)
x_hat = (1 - momentum) * x_hat + momentum * x_t,
where x_hat is the estimated statistic and x_t is the new observed value.

Personally I agree with Tensorflow's definition, nevertheless since we heavily reference the torch docs I do think we should change defaults to match torch.

Going deeper: https://discuss.pytorch.org/t/batch-norm-momentum-default-value/11955

@dantreiman dantreiman changed the title Changes batch norm momentum to 1-momentum Changes batch norm momentum defaults to 1-momentum Jun 6, 2022
@github-actions
Copy link

github-actions bot commented Jun 6, 2022

Unit Test Results

       6 files  ±0         6 suites  ±0   2h 28m 56s ⏱️ +15s
2 805 tests ±0  2 773 ✔️ ±0    32 💤 ±0  0 ±0 
8 415 runs  ±0  8 315 ✔️ ±0  100 💤 ±0  0 ±0 

Results for commit 592db73. ± Comparison against base commit b20cbdd.

♻️ This comment has been updated with latest results.

@dantreiman dantreiman merged commit ec902e2 into ludwig-ai:master Jun 7, 2022
@dantreiman dantreiman deleted the daniel/batch_norm_defaults branch June 7, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants