Skip to content

Commit 6c98b37

Browse files
committed
Remove useless input parameters: of_ml_nnode and of_ml_nlayer
1 parent a79c595 commit 6c98b37

File tree

6 files changed

+5
-38
lines changed

6 files changed

+5
-38
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@
212212
- [ML-KEDF: machine learning based kinetic energy density functional for OFDFT](#ml-kedf-machine-learning-based-kinetic-energy-density-functional-for-ofdft)
213213
- [of\_ml\_gene\_data](#of_ml_gene_data)
214214
- [of\_ml\_device](#of_ml_device)
215-
- [of\_ml\_nnode](#of_ml_nnode)
216-
- [of\_ml\_nlayer](#of_ml_nlayer)
217215
- [of\_ml\_feg](#of_ml_feg)
218216
- [of\_ml\_nkernel](#of_ml_nkernel)
219217
- [of\_ml\_kernel](#of_ml_kernel)
@@ -2269,20 +2267,6 @@ Warning: this function is not robust enough for the current version. Please try
22692267
- **gpu**: GPU
22702268
- **Default**: cpu
22712269

2272-
### of_ml_nnode
2273-
2274-
- **Type**: Integer
2275-
- **Availability**: OFDFT
2276-
- **Description**: Hyperparameter: number of node of hidden layer.
2277-
- **Default**: 100
2278-
2279-
### of_ml_nlayer
2280-
2281-
- **Type**: Integer
2282-
- **Availability**: OFDFT
2283-
- **Description**: Hyperparameter: number of hidden layer.
2284-
- **Default**: 3
2285-
22862270
### of_ml_feg
22872271

22882272
- **Type**: Integer
@@ -2475,7 +2459,7 @@ Warning: this function is not robust enough for the current version. Please try
24752459

24762460
- **Type**: Boolean
24772461
- **Availability**: OFDFT
2478-
- **Description**: For test. Read in the density, and output the F and Pauli potential.
2462+
- **Description**: FOR TEST. Read in the density, and output the F and Pauli potential.
24792463
- **Default**: False
24802464

24812465
[back to top](#full-list-of-input-keywords)

source/module_esolver/esolver_of_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void ESolver_OF::init_kedf(const Input_para& inp)
7272
this->ml_ = new KEDF_ML();
7373
this->ml_->set_para(this->pw_rho->nrxx, this->dV_, this->nelec_[0], inp.of_tf_weight, inp.of_vw_weight,
7474
inp.of_ml_chi_p, inp.of_ml_chi_q, inp.of_ml_chi_xi, inp.of_ml_chi_pnl, inp.of_ml_chi_qnl,
75-
inp.of_ml_nnode, inp.of_ml_nlayer, inp.of_ml_nkernel, inp.of_ml_kernel, inp.of_ml_kernel_scaling,
75+
inp.of_ml_nkernel, inp.of_ml_kernel, inp.of_ml_kernel_scaling,
7676
inp.of_ml_yukawa_alpha, inp.of_ml_kernel_file, inp.of_ml_gamma, inp.of_ml_p, inp.of_ml_q, inp.of_ml_tanhp, inp.of_ml_tanhq,
7777
inp.of_ml_gammanl, inp.of_ml_pnl, inp.of_ml_qnl, inp.of_ml_xi, inp.of_ml_tanhxi,
7878
inp.of_ml_tanhxi_nl, inp.of_ml_tanh_pnl, inp.of_ml_tanh_qnl, inp.of_ml_tanhp_nl, inp.of_ml_tanhq_nl, inp.of_ml_device, this->pw_rho);

source/module_hamilt_pw/hamilt_ofdft/kedf_ml.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ void KEDF_ML::set_para(
1717
const std::vector<double> &chi_xi,
1818
const std::vector<double> &chi_pnl,
1919
const std::vector<double> &chi_qnl,
20-
const int nnode,
21-
const int nlayer,
2220
const int &nkernel,
2321
const std::vector<int> &kernel_type,
2422
const std::vector<double> &kernel_scaling,
@@ -76,6 +74,8 @@ void KEDF_ML::set_para(
7674

7775
if (PARAM.inp.of_kinetic == "ml")
7876
{
77+
int nnode = 100;
78+
int nlayer = 3;
7979
this->nn = std::make_shared<NN_OFImpl>(this->nx, 0, this->ninput, nnode, nlayer, this->device);
8080
torch::load(this->nn, "net.pt", this->device_type);
8181
std::cout << "load net done" << std::endl;

source/module_hamilt_pw/hamilt_ofdft/kedf_ml.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class KEDF_ML
3333
const std::vector<double> &chi_xi,
3434
const std::vector<double> &chi_pnl,
3535
const std::vector<double> &chi_qnl,
36-
const int nnode,
37-
const int nlayer,
3836
const int &nkernel,
3937
const std::vector<int> &kernel_type,
4038
const std::vector<double> &kernel_scaling,

source/module_io/read_input_item_ofdft.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,6 @@ void ReadInput::item_ofdft()
221221
read_sync_string(input.of_ml_device);
222222
this->add_item(item);
223223
}
224-
{
225-
Input_Item item("of_ml_nnode");
226-
item.annotation = "Hyperparameter: number of node of hidden layer";
227-
read_sync_int(input.of_ml_nnode);
228-
this->add_item(item);
229-
}
230-
{
231-
Input_Item item("of_ml_nlayer");
232-
item.annotation = "Hyperparameter: number of hidden layer";
233-
read_sync_int(input.of_ml_nlayer);
234-
this->add_item(item);
235-
}
236224
{
237225
Input_Item item("of_ml_feg");
238226
item.annotation = "The Free Electron Gas limit: 0: no, 3: yes";

source/module_parameter/input_parameter.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,7 @@ struct Input_para
212212
bool of_ml_gene_data = false; ///< Generate training data or not
213213
// device
214214
std::string of_ml_device = "cpu"; ///< Run NN on GPU or CPU
215-
// size of nn 2023-04-19
216-
int of_ml_nnode = 100; ///< Hyperparameter: number of node of hidden layer
217-
int of_ml_nlayer = 3; ///< Hyperparameter: number of hidden layer
218-
int of_ml_feg = 0; ///< The Free Electron Gas limit: 0: no, 3: yes
215+
int of_ml_feg = 0; ///< The Free Electron Gas limit: 0: no, 3: yes
219216
// kernel
220217
int of_ml_nkernel = 1; ///< Number of kernels
221218
std::vector<int> of_ml_kernel = {1}; ///< Type of kernel, 1 for wt, 2 for yukawa, and 3 for TKK

0 commit comments

Comments
 (0)