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 documentation of the tf.nn.softmax function #53172

Merged
merged 4 commits into from
Jan 5, 2022

Conversation

T-Almeida
Copy link
Contributor

@T-Almeida T-Almeida commented Nov 23, 2021

This PR addresses the issue #53112

As discussed, the tf.nn.softmax documentation states that:

This function performs the equivalent of

softmax = tf.exp(logits) / tf.reduce_sum(tf.exp(logits), axis)

However the above computation is wrong for tensors with rank greater than 1.

I belive that the correct description would be:

softmax = tf.exp(logits) / tf.reduce_sum(tf.exp(logits), axis, keepdims=True)

@google-ml-butler google-ml-butler bot added the size:XS CL Change Size: Extra Small label Nov 23, 2021
@google-cla google-cla bot added the cla: no label Nov 23, 2021
@google-cla google-cla bot added cla: yes and removed cla: no labels Nov 23, 2021
@gbaned gbaned added the comp:ops OPs related issues label Nov 24, 2021
@gbaned gbaned requested a review from jpienaar November 24, 2021 02:42
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Nov 24, 2021
@T-Almeida
Copy link
Contributor Author

Hi, I noticed that the line is longer than 80 characters, any suggestion on how to rewrite it in a two-line format?

P.S. I also tried to run tf_doctest.py (as indicated here: https://www.tensorflow.org/community/contribute/docs_ref) but it throws "AttributeError: module 'tensorflow.python.ops.logging_ops' has no attribute 'enable_interactive_logging"

@gbaned gbaned requested a review from edloper December 3, 2021 18:46
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Dec 4, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Dec 4, 2021
@tensorflowbutler tensorflowbutler removed the awaiting review Pull request awaiting review label Dec 6, 2021
@gbaned gbaned removed the ready to pull PR ready for merge process label Dec 6, 2021
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Dec 6, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Dec 6, 2021
@gbaned gbaned added the kokoro:force-run Tests on submitted change label Dec 6, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Dec 6, 2021
@google-ml-butler google-ml-butler bot added the kokoro:force-run Tests on submitted change label Dec 10, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Dec 10, 2021
@rthadur rthadur removed the ready to pull PR ready for merge process label Dec 10, 2021
@rthadur rthadur added the ready to pull PR ready for merge process label Dec 10, 2021
@gbaned
Copy link
Contributor

gbaned commented Dec 14, 2021

@T-Almeida Can you please address PyLint errors? Thanks!

@google-ml-butler google-ml-butler bot removed the ready to pull PR ready for merge process label Dec 20, 2021
@gbaned gbaned requested a review from edloper December 20, 2021 15:25
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Dec 20, 2021
@gbaned gbaned requested review from edloper and removed request for edloper December 20, 2021 18:29
@T-Almeida
Copy link
Contributor Author

Hi @gbaned, I made two changes in order to fix the PyLint erros, see if its okey

@gbaned gbaned requested review from edloper and removed request for edloper December 21, 2021 15:04
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Dec 31, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Dec 31, 2021
@tensorflowbutler tensorflowbutler removed the awaiting review Pull request awaiting review label Jan 2, 2022
@gbaned gbaned removed the ready to pull PR ready for merge process label Jan 5, 2022
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jan 5, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jan 5, 2022
@copybara-service copybara-service bot merged commit a76c99c into tensorflow:master Jan 5, 2022
@google-ml-butler google-ml-butler bot removed the ready to pull PR ready for merge process label Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:ops OPs related issues size:XS CL Change Size: Extra Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants