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

Create general math ops for TensorFlow #5660

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

arisdelacruz
Copy link
Contributor

Description

This is an attempt to write a general entry on TensorFlow math

Issue Solved

Closes #4594

Type of Change

  • Adding a new entry

Checklist

  • [/] All writings are my own.
  • [/] My entry follows the Codecademy Docs style guide.
  • [/] My changes generate no new warnings.
  • [/] I have performed a self-review of my own writing and code.
  • [/] I have checked my entry and corrected any misspellings.
  • [/] I have made corresponding changes to the documentation if needed.
  • [/] I have confirmed my changes are not being pushed from my forked main branch.
  • [/] I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • [/] I have linked any issues that are relevant to this PR in the Issues Solved section.

@SaviDahegaonkar SaviDahegaonkar self-assigned this Nov 22, 2024
Copy link
Collaborator

@SaviDahegaonkar SaviDahegaonkar left a 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! 🙂

content/tensorflow/concepts/math/math.md Show resolved Hide resolved
content/tensorflow/concepts/math/math.md Outdated Show resolved Hide resolved
content/tensorflow/concepts/math/math.md Show resolved Hide resolved
Comment on lines +81 to +90
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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.

content/tensorflow/concepts/math/math.md Outdated Show resolved Hide resolved
content/tensorflow/concepts/math/math.md Outdated Show resolved Hide resolved
@SaviDahegaonkar SaviDahegaonkar added new entry New entry or entries status: under review Issue or PR is currently being reviewed tensorflow status: review 1️⃣ completed status: waiting for author and removed status: under review Issue or PR is currently being reviewed labels Nov 23, 2024
arisdelacruz and others added 6 commits November 25, 2024 11:03
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Concept Entry] TensorFlow math
2 participants