-
Notifications
You must be signed in to change notification settings - Fork 68
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
Ensure the state attr from molecular graph is consistent with matgl.float_th and include linear layer in TensorNet to match the original implementations #244
Conversation
…in TensorNet class
…oat_th and including linear layer in TensorNet to match the original implementations
WalkthroughThe recent modifications involve enhancing data processing and model architecture within a graph-based module. Specifically, there's an update to how state attributes are converted into tensors, ensuring they're in the correct data type. Additionally, a new neural layer is added to the model, with adjustments made for handling input features under certain conditions, refining both the initialization and the forward pass processes. Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/matgl/graph/data.py (1 hunks)
- src/matgl/models/_tensornet.py (3 hunks)
Additional Context Used
Additional comments not posted (4)
src/matgl/graph/data.py (1)
192-192
: The change to explicitly set the data type ofstate_attrs
tomatgl.float_th
during tensor conversion is correct and aligns with the PR objectives to ensure data type consistency for state attributes. Good job ensuring consistency across the framework.src/matgl/models/_tensornet.py (3)
183-183
: The addition of thenn.Linear
layer is correctly implemented and is likely to enhance the model's ability to learn complex patterns from the data. Good job ensuring consistency in data types throughout the model.
185-185
: The adjustments to input features based on theis_intensive
flag and thereadout_type
are correctly implemented and provide flexibility in configuring the model's behavior. The thoughtful inclusion ofdim_state_feats
wheninclude_state
is true ensures the model can incorporate state features when available.
207-207
: The configuration of the final layer for extensive tasks is correctly implemented, with appropriate handling of thetask_type
parameter. The explicit check to prevent classification tasks from being marked as extensive is a good practice that ensures correct usage of the model.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #244 +/- ##
=======================================
Coverage 98.80% 98.80%
=======================================
Files 33 33
Lines 2750 2752 +2
=======================================
+ Hits 2717 2719 +2
Misses 33 33 ☔ View full report in Codecov by Sentry. |
Summary
Assigned the dtype state_attr into matgl.float_th and added a linear layer in TensorNet to match the original implementation.
Checklist
ruff
.mypy
.duecredit
@due.dcite
decorators to reference relevant papers by DOI (example)Tip: Install
pre-commit
hooks to auto-check types and linting before every commit:Summary by CodeRabbit