Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding Relu2#2582

Merged
awni merged 10 commits intoml-explore:mainfrom
Goekdeniz-Guelmez:adding-relu2
Sep 10, 2025
Merged

Adding Relu2#2582
awni merged 10 commits intoml-explore:mainfrom
Goekdeniz-Guelmez:adding-relu2

Conversation

@Goekdeniz-Guelmez
Copy link
Contributor

Proposed changes

Addreses one part of #2579 . Ive added a simple mx.square(relu(x)) and added the make_activation_module(relu2) too.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@Goekdeniz-Guelmez Goekdeniz-Guelmez changed the title in. com. Adding Relu2 Sep 10, 2025
@awni
Copy link
Member

awni commented Sep 10, 2025

Could you add the new function and class to the docs?

@Goekdeniz-Guelmez
Copy link
Contributor Author

should be updated

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@awni awni merged commit db5443e into ml-explore:main Sep 10, 2025
5 of 7 checks passed
@Goekdeniz-Guelmez Goekdeniz-Guelmez deleted the adding-relu2 branch September 10, 2025 14:27
faisalmemon pushed a commit to faisalmemon/mlx that referenced this pull request Oct 30, 2025
* in. com.

* upd. ackn.

* update __init__

* nits

* nits + format

* used mx.maximum(x, 0) instead of calling the function and moves relu6 under relu2 to make it nicer

* same with _make_activation_module

* Update python/mlx/nn/layers/activations.py

upd

Co-authored-by: Awni Hannun <[email protected]>

* update funct.rst

* upd. layers.rst

---------

Co-authored-by: Awni Hannun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants