The tanh activation function is added#8689
Merged
cclauss merged 13 commits intoTheAlgorithms:masterfrom Apr 25, 2023
Merged
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
rohan472000
approved these changes
Apr 24, 2023
| @@ -0,0 +1,44 @@ | |||
| """ | |||
| This script demonstrates the implementation of the tangent hyperbolic | |||
Contributor
There was a problem hiding this comment.
One minor suggestion I have is to add a brief description of what the function does at the beginning of the docstring. For example:
"""
Implements the tangent hyperbolic or tanh function.
The function takes a vector of K real numbers as input and then applies
the tanh function to each element of the vector. The output values are
mostly in the range (-1, 1).
...
Contributor
Author
There was a problem hiding this comment.
thank you for suggestion✌✌.
Contributor
|
@cclauss kindly review, if need any change then please suggest. |
cclauss
reviewed
Apr 25, 2023
cclauss
reviewed
Apr 25, 2023
cclauss
approved these changes
Apr 25, 2023
tianyizheng02
pushed a commit
to tianyizheng02/Python
that referenced
this pull request
May 29, 2023
* tanh function been added * tanh function been added * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * tanh function is added * tanh function is added * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * tanh function added * tanh function added * tanh function is added * Apply suggestions from code review --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change:
The tanh activation function is added
mathematically (e^x - e^(-x))/(e^x + e^(-x)) redesigned to (2/(1+e^(-2x))-1
Checklist:
Fixes: #{$ISSUE_NO}.