-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add activation functions in jax.nn module #12502
Conversation
…uld work as expected now
# Conflicts: # .github/workflows/test-ivy-cron-multi-version.yml # .github/workflows/test-ivy-cron.yml # ivy/array/experimental/elementwise.py # ivy/compiler/utils/XVX.so # ivy/compiler/utils/XXI.so # ivy/functional/backends/jax/experimental/activations.py # ivy/functional/backends/jax/experimental/layers.py # ivy/functional/backends/numpy/experimental/activations.py # ivy/functional/backends/numpy/experimental/elementwise.py # ivy/functional/backends/tensorflow/experimental/activations.py # ivy/functional/backends/tensorflow/experimental/elementwise.py # ivy/functional/backends/torch/__init__.py # ivy/functional/frontends/jax/numpy/mathematical_functions.py # ivy/functional/frontends/tensorflow/math.py # ivy/functional/frontends/tensorflow/nn.py # ivy/functional/ivy/gradients.py # ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_math.py # ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py # ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py # ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py # run_tests.py # run_tests_CLI/cron_tests_multi_version.py
… (Incorporate Versioning in Mongo DB Schema) [skip ci]
… torch backend related to uint16 (ivy-llc#11848)
…ioning (Backend and Frontend) [skip ci]
…_shared_vars (ivy-llc#11870)" (ivy-llc#11871) This reverts commit 831fe69.
Co-authored by MahmoudAshraf97 <[email protected]>
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.
Great PR, just some suggeted changes, please remove duplicates in particular and update the docstrings. I'll take another look once you're done. Thanks!
ivy/functional/frontends/torch/nn/functional/non_linear_activation_functions.py
Outdated
Show resolved
Hide resolved
@handle_exceptions | ||
@handle_array_like_without_promotion | ||
@handle_array_function | ||
def sigmoid( |
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.
already implemented
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.
Removed
@handle_exceptions | ||
@handle_array_like_without_promotion | ||
@handle_array_function | ||
def softplus( |
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.
already implemented
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.
Removed
@handle_exceptions | ||
@handle_array_like_without_promotion | ||
@handle_array_function | ||
def leaky_relu( |
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.
already implemented
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.
Removed
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.
For most of these, you can use the native numpy out argument on the last operation to make it use the native out handling. For example if the last operation is division you can do np.divide(x,y,out=out)
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.
Some docstrings are incorrect (remain as copies of others) please update them accrdingly
Hi @karalleyna, could you please re-make this PR? It can't get merged as it is now because of the force-push. |
This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days. |
This PR has been closed because it has been marked as stale for more than 7 days with no activity. |
JAX Frontend