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

Add mul(x, sigmoid(x)) to swish substitution. #1165

Merged
merged 7 commits into from
Aug 14, 2024
Merged

Conversation

elad-c
Copy link
Collaborator

@elad-c elad-c commented Aug 13, 2024

Pull Request Description:

This PR adds a substitution for replacing mul(x, sigmoid(x)) with swish.

Checklist before requesting a review:

  • I set the appropriate labels on the pull request.
  • I have added/updated the release note draft (if necessary).
  • I have updated the documentation to reflect my changes (if necessary).
  • All function and files are well documented.
  • All function and classes have type hints.
  • There is a licenses in all file.
  • The function and variable names are informative.
  • I have checked for code duplications.
  • I have added new unittest (if necessary).

Copy link
Collaborator

@reuvenperetz reuvenperetz left a comment

Choose a reason for hiding this comment

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

We do not need such a substituion for torch?

graph.remove_edge(input_node, mul_node)
graph.remove_edge(sigmoid_node, mul_node)
graph.remove_node(sigmoid_node)
graph.remove_node(mul_node)
Copy link
Collaborator

@reuvenperetz reuvenperetz Aug 14, 2024

Choose a reason for hiding this comment

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

If mul is an output for the model it will fail...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Might be relevant for many substitutions... @ofirgo

tests/keras_tests/models_tests/test_networks_runner.py Outdated Show resolved Hide resolved
@elad-c elad-c merged commit ac28761 into main Aug 14, 2024
29 checks passed
@elad-c elad-c deleted the sigmoid_mul_substitution branch August 14, 2024 11:54
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.

2 participants