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

Consistent activation functions between backends #3431

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Mar 7, 2024

  1. add relu, gelu, gelu_tf, relu6, softplus, sigmoid, and linear to dpmodel;
  2. add gelu_tf, relu6, soft6, softplus, and sigmoid to pt;
  3. change gelu in pt from non-approximate to approximate. If one still wants to use the non-approximate version, we may consider to add a new key;
  4. add linear to tf;
  5. none in tf now returns lambda x: x instead of None to be type consistent;
  6. support uppercase in all backends;
  7. add consistent tests.

1. add relu, gelu, gelu_tf, relu6, softplus, and sigmoid to dpmodel;
2. add gelu_tf, relu6, soft6, softplus, sigmoid to pt;
3. change gelu in pt from non-approximate to approximate. If one still wants to use the non-approximate version, we may consider to add a new key.
4. none in tf now returns lambda x: x instead of None to be type consistent.
5. support uppercase in all backends.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 98.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 77.08%. Comparing base (09bd522) to head (ca004b4).

Files Patch % Lines
deepmd/dpmodel/utils/network.py 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3431      +/-   ##
==========================================
+ Coverage   76.98%   77.08%   +0.09%     
==========================================
  Files         427      394      -33     
  Lines       36753    31991    -4762     
  Branches     1621      909     -712     
==========================================
- Hits        28295    24659    -3636     
+ Misses       7590     6804     -786     
+ Partials      868      528     -340     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Mar 8, 2024
Merged via the queue into deepmodeling:devel with commit dabbd35 Mar 8, 2024
48 checks passed
@njzjz njzjz mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants