Closed kenko911 closed 1 week ago
The notebook Training a M3GNet Potential with PyTorch Lightning.ipynb
has been updated to improve how stress data is handled during training. Specifically, the collate function now includes stress data in addition to line graphs, and the Lightning module configuration now incorporates a stress weight parameter to balance its influence during training.
File Path | Change Summary |
---|---|
examples/.../Training a M3GNet Potential with PyTorch Lightning.ipynb |
Modified my_collate_fn to include stress data and set stress_weight in PotentialLightningModule . |
Notebook Metadata | Version changed from "3.10.14" to "3.10.9" . |
sequenceDiagram
participant User
participant Notebook
participant PotentialLightningModule
participant collate_fn_pes
User->>Notebook: Start notebook execution
Notebook->>collate_fn_pes: Initialize with include_line_graph=True, include_stress=True
Notebook->>PotentialLightningModule: Initialize with model, include_line_graph=True, stress_weight=0.01
Note over Notebook,PotentialLightningModule: Training process
PotentialLightningModule->>Notebook: Return training results including stress data
stress_weight
in the PotentialLightningModule
as done in this PR is likely intended to address issues with stress inclusion during training.examples/Training a M3GNet Potential with PyTorch Lightning.ipynb (2)
`139-139`: **Approved: Updated `collate_fn_pes` function call to include stress** The addition of `include_stress=True` aligns with the PR objectives to incorporate stress considerations into the training process. Ensure that this change is consistently applied across all relevant parts of the notebook. --- `153-153`: **Approved: Updated `PotentialLightningModule` initialization with `stress_weight`** The introduction of the `stress_weight=0.01` parameter is a significant enhancement, allowing the model to account for stress during training. Verify that the usage of this parameter is consistent and correctly implemented across the notebook.Verification successful
--- **Approved: Consistent use of `stress_weight` parameter verified** The `stress_weight=0.01` parameter is correctly implemented in the `PotentialLightningModule` initialization within the notebook. This enhancement ensures the model accounts for stress during training. - `examples/Training a M3GNet Potential with PyTorch Lightning.ipynb`: `lit_module = PotentialLightningModule(model=model, include_line_graph=True, stress_weight=0.01)`Scripts executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify consistent use of `stress_weight` parameter across the notebook. # Test: Search for the `PotentialLightningModule` initialization across the notebook. Expect: Only occurrences with `stress_weight`. rg --type python --json $'PotentialLightningModule(.*)stress_weight' ``` Length of output: 100 --- --- Script: ```shell #!/bin/bash # Description: Verify consistent use of `stress_weight` parameter across the notebook. # Test: Search for the `PotentialLightningModule` initialization across the notebook. Expect: Only occurrences with `stress_weight`. rg 'PotentialLightningModule(.*)stress_weight' --glob "*.ipynb" ``` Length of output: 233
Summary
Better Documentation for M3GNet potential training with stresses.
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: