mlx icon indicating copy to clipboard operation
mlx copied to clipboard

Extend activation functions

Open nsantavas opened this issue 1 year ago • 3 comments

Hi everyone,

Proposal:

I would like to propose the addition of several other activation functions to the framework:

  • [ ] LeakyReLU
  • [ ] PReLU
  • [ ] ReLU6
  • [ ] Tanh
  • [ ] Softplus
  • [ ] Mish etc.

I am willing to contribute these or others.

nsantavas avatar Dec 08 '23 15:12 nsantavas

That would be awesome, please add them (+ tests / docs) if you can. We'd love to take a PR for that.

We mostly follow the PyTorch nn API so try to follow that for naming conventions / arguments where it makes sense.

awni avatar Dec 08 '23 18:12 awni

Here are other activation functions implemented by PyTorch, while MLX don't have:

@awni If it is necessary, I can add them and make PRs.

AtomicVar avatar Jan 23 '24 12:01 AtomicVar

Cool! I'm not opposed to adding some of these, but It's also not a big priority as they are not used that much. If you are interested in contributing them that would be great

awni avatar Jan 23 '24 21:01 awni