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

Update BatchNormalization documentation #43998

Closed
vermouth1992 opened this issue Oct 14, 2020 · 3 comments
Closed

Update BatchNormalization documentation #43998

vermouth1992 opened this issue Oct 14, 2020 · 3 comments
Assignees
Labels
comp:keras Keras related issues type:docs-bug Document issues

Comments

@vermouth1992
Copy link

Thank you for submitting a TensorFlow documentation issue. Per our GitHub
policy, we only address code/doc bugs, performance issues, feature requests, and
build/installation issues on GitHub.

The TensorFlow docs are open source! To get involved, read the documentation
contributor guide: https://www.tensorflow.org/community/contribute/docs

URL(s) with the issue:

https://www.tensorflow.org/api_docs/python/tf/keras/layers/BatchNormalization

Description of issue (what needs changing):

Clear description

The document should mention that the axis can take in a list of integers, not just an integer. I tested it and it is already implemented in the TensorFlow. I was not aware of it and used reshape and transpose, which is inefficient.

Correct links

Is the link to the source code correct?

Parameters defined

Are all parameters defined and formatted correctly?

The axis can be a list of integers.

Returns defined

Are return values defined?

Raises listed and defined

Are the errors defined? For example,
https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/feature_column/categorical_column_with_vocabulary_file#raises

Usage example

Is there a usage example?

See the API guide: https://www.tensorflow.org/community/contribute/docs_ref
on how to write testable usage examples.

Request visuals, if applicable

Are there currently visuals? If not, will it clarify the content?

Submit a pull request?

Are you planning to also submit a pull request to fix the issue? See the docs
contributor guide: https://www.tensorflow.org/community/contribute/docs,
docs API guide: https://www.tensorflow.org/community/contribute/docs_ref and the
docs style guide: https://www.tensorflow.org/community/contribute/docs_style

@Saduf2019
Copy link
Contributor

@vermouth1992
Could you please explain the issue faced.

@Saduf2019 Saduf2019 added the stat:awaiting response Status - Awaiting response from author label Oct 14, 2020
@vermouth1992
Copy link
Author

vermouth1992 commented Oct 14, 2020

There is no practical issue I am facing. However, the documentation is misleading. For example, if we want the batch normalization layer to normalize over multiple dimensions, the following code is working

import tensorflow as tf
layer = tf.keras.layers.BatchNormalization(axis=[0, 2])
a = layer(tf.random.normal([3, 100, 10]))

However, the documentation says that the axis argument must be an integer, which confuses me at the beginning. So I have to use a reshape + transpose to implement the same functionality, which is ineffective.

@Saduf2019 Saduf2019 added type:docs-bug Document issues comp:keras Keras related issues and removed stat:awaiting response Status - Awaiting response from author labels Oct 14, 2020
@Saduf2019 Saduf2019 assigned ymodak and unassigned Saduf2019 Oct 14, 2020
copybara-service bot pushed a commit that referenced this issue Oct 14, 2020
PiperOrigin-RevId: 337182753
Change-Id: I3e42be2bda1256577a74b351e6e13dd7dd2153d2
@ymodak
Copy link
Contributor

ymodak commented Oct 14, 2020

Thanks for your issue. The docs are now updated.

axis: Integer or a list of integers, the axis that should be normalized

@ymodak ymodak closed this as completed Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:keras Keras related issues type:docs-bug Document issues
Projects
None yet
Development

No branches or pull requests

3 participants