-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Create general math ops for TensorFlow #5660
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @arisdelacruz,
The entry is nicely written, but I have suggested a few corrections please make them asap and let me know. Thank you for contributing to Codecademy Docs! 🙂
import tensorflow as tf | ||
|
||
a = tf.constant([1.0, 2.0, 3.0]) | ||
|
||
# Exponential and logarithmic functions | ||
|
||
tf.math.exp(a) # Element-wise exponential | ||
tf.math.log(a) # Element-wise natural logarithm | ||
tf.math.log10(a) # Element-wise base-10 logarithm | ||
tf.math.log1p(a) # Element-wise natural logarithm of (1 + x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import tensorflow as tf | |
a = tf.constant([1.0, 2.0, 3.0]) | |
# Exponential and logarithmic functions | |
tf.math.exp(a) # Element-wise exponential | |
tf.math.log(a) # Element-wise natural logarithm | |
tf.math.log10(a) # Element-wise base-10 logarithm | |
tf.math.log1p(a) # Element-wise natural logarithm of (1 + x) | |
import tensorflow as tf | |
a = tf.constant([1.0, 2.0, 3.0]) | |
# Exponential and logarithmic functions | |
tf.math.exp(a) # Element-wise exponential | |
tf.math.log(a) # Element-wise natural logarithm | |
tf.math.log10(a) # Element-wise base-10 logarithm | |
tf.math.log1p(a) # Element-wise natural logarithm of (1 + x) | |
This code throws an AttributeError
as the function tf.math.log10(a)
does not actually exist in Tensorflow. Please make this example a valid example or just add another example instead of this.
Co-authored-by: Savi Dahegaonkar <124272050+SaviDahegaonkar@users.noreply.github.com>
Co-authored-by: Savi Dahegaonkar <124272050+SaviDahegaonkar@users.noreply.github.com>
Co-authored-by: Savi Dahegaonkar <124272050+SaviDahegaonkar@users.noreply.github.com>
Co-authored-by: Savi Dahegaonkar <124272050+SaviDahegaonkar@users.noreply.github.com>
Co-authored-by: Savi Dahegaonkar <124272050+SaviDahegaonkar@users.noreply.github.com>
Description
This is an attempt to write a general entry on TensorFlow math
Issue Solved
Closes #4594
Type of Change
Checklist
main
branch.Issues Solved
section.