Refactor: Remove the ML training code#7167
Merged
mohanchen merged 1 commit intodeepmodeling:developfrom Mar 28, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the standalone ML training toolchain under module_ofdft/ml_tools (issue #7091) while keeping the runtime NN model used by ML-KEDF/ML-EXX, relocating it to module_ofdft/nn_of.{h,cpp} and updating includes/build wiring accordingly.
Changes:
- Deleted ML training executable sources and helper modules (
train_kedf,data,input,kernel,grid,pauli_potential, andml_tools/CMakeLists.txt). - Added/relocated the libtorch NN module implementation to
source_pw/module_ofdft/nn_of.{h,cpp}. - Updated include paths and CMake source lists to reference the new NN module location.
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| source/source_pw/module_ofdft/nn_of.h | Adds NN module header (now used by runtime ML code). |
| source/source_pw/module_ofdft/nn_of.cpp | Adds NN module implementation (forward pass, layer registration). |
| source/source_pw/module_ofdft/ml_tools/train_kedf.h | Removes training driver API. |
| source/source_pw/module_ofdft/ml_tools/train_kedf.cpp | Removes training loop implementation. |
| source/source_pw/module_ofdft/ml_tools/pauli_potential.h | Removes training-time Pauli potential implementation. |
| source/source_pw/module_ofdft/ml_tools/pauli_potential.cpp | Removes training-time Pauli potential implementation. |
| source/source_pw/module_ofdft/ml_tools/main.cpp | Removes standalone training executable entrypoint. |
| source/source_pw/module_ofdft/ml_tools/kernel.h | Removes training-time kernel utilities. |
| source/source_pw/module_ofdft/ml_tools/kernel.cpp | Removes training-time kernel utilities. |
| source/source_pw/module_ofdft/ml_tools/input.h | Removes training input parser/config. |
| source/source_pw/module_ofdft/ml_tools/input.cpp | Removes training input parser/config. |
| source/source_pw/module_ofdft/ml_tools/grid.h | Removes training-time FFT grid utilities. |
| source/source_pw/module_ofdft/ml_tools/grid.cpp | Removes training-time FFT grid utilities. |
| source/source_pw/module_ofdft/ml_tools/data.h | Removes training dataset loader. |
| source/source_pw/module_ofdft/ml_tools/data.cpp | Removes training dataset loader. |
| source/source_pw/module_ofdft/ml_tools/CMakeLists.txt | Removes separate nnof training build. |
| source/source_pw/module_ofdft/ml_base.h | Updates NN include path to new location. |
| source/source_pw/module_ofdft/CMakeLists.txt | Updates ML-KEDF object sources to compile nn_of.cpp from new location. |
| source/source_estate/module_pot/pot_ml_exx.h | Updates NN include path to new location for ML-EXX. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
Linked Issue
Fix #7091
Unit Tests and/or Case Tests for my changes
What's changed?
Any changes of core modules? (ignore if not applicable)