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

docs: add document equations for se_atten_v2 #3828

Merged
merged 14 commits into from
May 31, 2024

Conversation

Chengqian-Zhang
Copy link
Collaborator

@Chengqian-Zhang Chengqian-Zhang commented May 28, 2024

Solve issue #3139
"se_atten_v2" is inherited from "se_atten" with the following parameter modifications:

      "tebd_input_mode": "strip",
      "smooth_type_embedding": true,
      "set_davg_zero": false

I add the equations for parameter "tebd_input_mode".

Summary by CodeRabbit

  • Documentation
    • Detailed the default value and functionality of the "tebd_input_mode" parameter.
    • Highlighted the performance superiority of "se_atten_v2" over "se_atten".
    • Specified a model compression requirement for se_atten_v2.

Copy link
Contributor

coderabbitai bot commented May 28, 2024

Walkthrough

Walkthrough

The changes in the train-se-atten.md file focus on detailing the default value and functionality of the "tebd_input_mode" parameter in the context of constructing an embedding matrix. They also highlight the performance superiority of "se_atten_v2" over "se_atten" and specify a model compression requirement for se_atten_v2. These updates aim to clarify the behavior and performance aspects related to specific parameters without altering any exported or public entities.

Changes

File Change Summary
doc/model/train-se-atten.md Added details about the default value and functionality of "tebd_input_mode", highlighted performance of "se_atten_v2" over "se_atten", and specified model compression requirement for se_atten_v2.

Sequence Diagram(s) (Beta)

Silently ignoring generating sequence diagrams as the changes are documentation updates and do not involve modifications to the control flow or new features.


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d5a7f80 and 9ad3a30.

Files selected for processing (1)
  • doc/model/train-se-atten.md (2 hunks)
Additional context used
Markdownlint
doc/model/train-se-atten.md

91-91: Column: 1
Hard tabs


92-92: Column: 18
Hard tabs


93-93: Column: 23
Hard tabs


94-94: Column: 18
Hard tabs


95-95: Column: 17
Hard tabs


96-96: Column: 20
Hard tabs


97-97: Column: 25
Hard tabs


98-98: Column: 23
Hard tabs


99-99: Column: 18
Hard tabs


100-100: Column: 24
Hard tabs


101-101: Column: 23
Hard tabs


102-102: Column: 23
Hard tabs


103-103: Column: 18
Hard tabs


104-104: Column: 1
Hard tabs

Additional comments not posted (1)
doc/model/train-se-atten.md (1)

129-138: Clarify the explanation of "tebd_input_mode" parameter changes.

The explanation of the "tebd_input_mode" parameter changes from "concat" to "strip" is provided, but it could benefit from a clearer distinction between the two modes. Consider adding a brief description of what each mode does at a high level to help readers understand the practical implications of these settings.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Docs label May 28, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
doc/model/train-se-atten.md (3)

Line range hint 238-238: Correct the spelling of "place holder" to "placeholder".

- Atom type indexes (place holder)
+ Atom type indexes (placeholder)

Line range hint 110-110: Consider adding commas for clarity in lists.

- From left to right the members denote the sizes of each hidden layer
+ From left to right, the members denote the sizes of each hidden layer

- to mask the diagonal in the attention weights and False is recommended
+ to mask the diagonal in the attention weights, and False is recommended

Also applies to: 116-116, 142-142, 147-147


Line range hint 91-136: Replace hard tabs with spaces to maintain consistency in formatting.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range and nitpick comments (2)
doc/model/train-se-atten.md (2)

Line range hint 238-238: Correct the spelling in the documentation.

- Atom type indexes (place holder)
+ Atom type indexes (placeholder)

The term "placeholder" is conventionally spelled as one word.


Line range hint 224-224: Specify the language for code blocks.

- ```
+ ```json

For better syntax highlighting and readability, specify the language for the fenced code blocks. This change should be applied to all JSON code blocks in the document.

doc/model/train-se-atten.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (4)
doc/model/train-se-atten.md (4)

Line range hint 238-238: Correct the spelling error.

- place holder
+ placeholder

Line range hint 224-224: Specify the language for code blocks.

- ```json
+ ```json

Line range hint 91-136: Replace hard tabs with spaces for consistency.

- <hard tabs>
+ <appropriate number of spaces>

Line range hint 110-110: Add missing commas for clarity.

- From left to right the members denote
+ From left to right, the members denote

Also applies to: 142-142

Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.18%. Comparing base (3a7fbcf) to head (9ad3a30).
Report is 124 commits behind head on devel.

❗ There is a different number of reports uploaded between BASE (3a7fbcf) and HEAD (9ad3a30). Click for more details.

HEAD has 24 uploads less than BASE
Flag BASE (3a7fbcf) HEAD (9ad3a30)
28 4
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3828      +/-   ##
==========================================
- Coverage   82.61%   75.18%   -7.43%     
==========================================
  Files         515      515              
  Lines       49566    49558       -8     
  Branches     2985     2985              
==========================================
- Hits        40949    37262    -3687     
- Misses       7706    11463    +3757     
+ Partials      911      833      -78     

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

Copy link
Collaborator

@iProzd iProzd left a comment

Choose a reason for hiding this comment

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

  1. Using tebd_input_mode instead of "tebd_input_mode" for model params.
  2. It's better to place "concat" formulation in the description of se_atten descriptor (e.g. "Note that we obtain G using the type embedding method by default in this descriptor. By default, we concat the type embeddings...") and keep doc for tebd_input_mode and "strip" formulation in se_atten_v2, by introducing "strip" as a default value for tebd_input_mode in se_atten_v2 .

@njzjz njzjz linked an issue May 28, 2024 that may be closed by this pull request
@njzjz
Copy link
Member

njzjz commented May 28, 2024

@iProzd I notice the documentation for se_atten is still old. Update: revised in #3832.

@Chengqian-Zhang Chengqian-Zhang changed the title Add document equations for se_atten_v2 docs: add document equations for se_atten_v2 May 29, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
doc/model/train-se-atten.md (2)

Line range hint 233-233: Correct the spelling of "place holder" to "placeholder".

- Atom type indexes (place holder)
+ Atom type indexes (placeholder)

Line range hint 219-219: Specify the language for fenced code blocks to enable proper syntax highlighting.

- ```json
+ ```json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
doc/model/train-se-atten.md (3)

Line range hint 234-234: Correct the spelling of "place holder" to "placeholder".

- Atom type indexes (place holder)
+ Atom type indexes (placeholder)

Line range hint 95-140: Replace hard tabs with spaces for consistent formatting.

- "descriptor" :{
-          "type":		"se_atten",
-          "rcut_smth":	0.50,
-          "rcut":		6.00,
-          "sel":		120,
-          "neuron":		[25, 50, 100],
-          "axis_neuron":	16,
-          "resnet_dt":	false,
-          "attn":	128,
-          "attn_layer":	2,
-          "attn_mask":	false,
-          "attn_dotr":	true,
-          "seed":	1
- }
+ "descriptor" :{
+          "type":        "se_atten",
+          "rcut_smth":   0.50,
+          "rcut":        6.00,
+          "sel":         120,
+          "neuron":      [25, 50, 100],
+          "axis_neuron": 16,
+          "resnet_dt":   false,
+          "attn":        128,
+          "attn_layer":  2,
+          "attn_mask":   false,
+          "attn_dotr":   true,
+          "seed":        1
+ }

Line range hint 220-220: Specify the language for fenced code blocks to improve readability.

- ```
+ ```json

doc/model/train-se-atten.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
doc/model/train-se-atten.md (2)

Line range hint 238-238: Correct the spelling of "place holder" to "placeholder".

- Atom type indexes (place holder)
+ Atom type indexes (placeholder)

Line range hint 224-224: Specify the language for fenced code blocks.

- ```json
+ ```json

@njzjz njzjz enabled auto-merge May 29, 2024 20:46
@njzjz njzjz added this pull request to the merge queue May 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 29, 2024
@njzjz njzjz added this pull request to the merge queue May 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 29, 2024
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue May 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 30, 2024
@Chengqian-Zhang
Copy link
Collaborator Author

I think it is better to update the documentation in #3840.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
doc/model/train-se-atten.md (1)

Line range hint 91-104: Replace hard tabs with spaces for consistency.

-	"descriptor" :{
+  "descriptor" :{
-          "type":		"se_atten",
+          "type":        "se_atten",
-          "rcut_smth":	0.50,
+          "rcut_smth":   0.50,
-          "rcut":		6.00,
+          "rcut":        6.00,
-          "sel":		120,
+          "sel":         120,
-          "neuron":		[25, 50, 100],
+          "neuron":      [25, 50, 100],
-          "axis_neuron":	16,
+          "axis_neuron": 16,
-          "resnet_dt":	false,
+          "resnet_dt":   false,
-          "attn":	128,
+          "attn":        128,
-          "attn_layer":	2,
+          "attn_layer":  2,
-          "attn_mask":	false,
+          "attn_mask":   false,
-          "attn_dotr":	true,
+          "attn_dotr":   true,
-          "seed":	1
+          "seed":        1

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue May 31, 2024
Merged via the queue into deepmodeling:devel with commit e3acea5 May 31, 2024
60 checks passed
@njzjz njzjz added this to the v2.2.11 milestone Jun 4, 2024
@@ -122,6 +126,16 @@ We highly recommend using the version 2.0 of the attention-based descriptor `"se
"set_davg_zero": false
```

When using PyTorch backend, you must continue to use descriptor `"se_atten"` and specify `tebd_input_mode` as `"strip"` and `smooth_type_embedding` as `"true"`, which achieves the effect of `"se_atten_v2"`. The `tebd_input_mode` can take `"concat"` and `"strip"` as values. When using TensorFlow backend, you need to use descriptor `"se_atten_v2"` and do not need to set `tebd_input_mode` and `smooth_type_embedding` because the default value of `tebd_input_mode` is `"strip"`, and the default value of `smooth_type_embedding` is `"true"` in TensorFlow backend. When `tebd_input_mode` is set to `"strip"`, the embedding matrix $\mathcal{G}^i$ is constructed as:
Copy link
Member

Choose a reason for hiding this comment

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

When cherry-picking #3828 to r2, need to check if this sentence applies to r2. Need review from @iProzd

Copy link
Collaborator

@iProzd iProzd Jun 29, 2024

Choose a reason for hiding this comment

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

In tensorflow, only type_one_side=false is supported when using se_atten_v2, see #3745 . So the formulation below is only the former one. Other sentences about tf are correct.

njzjz pushed a commit to njzjz/deepmd-kit that referenced this pull request Jul 2, 2024
Solve issue deepmodeling#3139
`"se_atten_v2"` is inherited from `"se_atten"` with the following
parameter modifications:

```json
      "tebd_input_mode": "strip",
      "smooth_type_embedding": true,
      "set_davg_zero": false
```

I add the equations for parameter `"tebd_input_mode"`.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Detailed the default value and functionality of the
`"tebd_input_mode"` parameter.
- Highlighted the performance superiority of `"se_atten_v2"` over
`"se_atten"`.
  - Specified a model compression requirement for `se_atten_v2`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com>
(cherry picked from commit e3acea5)
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz mentioned this pull request Jul 2, 2024
njzjz pushed a commit that referenced this pull request Jul 3, 2024
Solve issue #3139
`"se_atten_v2"` is inherited from `"se_atten"` with the following
parameter modifications:

```json
      "tebd_input_mode": "strip",
      "smooth_type_embedding": true,
      "set_davg_zero": false
```

I add the equations for parameter `"tebd_input_mode"`.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Detailed the default value and functionality of the
`"tebd_input_mode"` parameter.
- Highlighted the performance superiority of `"se_atten_v2"` over
`"se_atten"`.
  - Specified a model compression requirement for `se_atten_v2`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com>
(cherry picked from commit e3acea5)
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this pull request Sep 18, 2024
Solve issue deepmodeling#3139
`"se_atten_v2"` is inherited from `"se_atten"` with the following
parameter modifications:

```json
      "tebd_input_mode": "strip",
      "smooth_type_embedding": true,
      "set_davg_zero": false
```

I add the equations for parameter `"tebd_input_mode"`.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Detailed the default value and functionality of the
`"tebd_input_mode"` parameter.
- Highlighted the performance superiority of `"se_atten_v2"` over
`"se_atten"`.
  - Specified a model compression requirement for `se_atten_v2`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com>
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.

[Docs] document equations for se_atten_v2
4 participants