Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions deepmd/loss/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def __init__ (self,
limit_pref_e : float = 1.00,
start_pref_f : float = 1000,
limit_pref_f : float = 1.00,
start_pref_v : float = 0,
limit_pref_v : float = 0,
start_pref_ae : float = 0,
limit_pref_ae : float = 0,
start_pref_pf : float = 0,
limit_pref_pf : float = 0,
start_pref_v : float = 0.0,
limit_pref_v : float = 0.0,
start_pref_ae : float = 0.0,
limit_pref_ae : float = 0.0,
start_pref_pf : float = 0.0,
limit_pref_pf : float = 0.0,
relative_f : float = None
) -> None:
self.starter_learning_rate = starter_learning_rate
Expand All @@ -35,11 +35,11 @@ def __init__ (self,
self.start_pref_pf = start_pref_pf
self.limit_pref_pf = limit_pref_pf
self.relative_f = relative_f
self.has_e = (self.start_pref_e != 0 or self.limit_pref_e != 0)
self.has_f = (self.start_pref_f != 0 or self.limit_pref_f != 0)
self.has_v = (self.start_pref_v != 0 or self.limit_pref_v != 0)
self.has_ae = (self.start_pref_ae != 0 or self.limit_pref_ae != 0)
self.has_pf = (self.start_pref_pf != 0 or self.limit_pref_pf != 0)
self.has_e = (self.start_pref_e != 0.0 or self.limit_pref_e != 0.0)
self.has_f = (self.start_pref_f != 0.0 or self.limit_pref_f != 0.0)
self.has_v = (self.start_pref_v != 0.0 or self.limit_pref_v != 0.0)
self.has_ae = (self.start_pref_ae != 0.0 or self.limit_pref_ae != 0.0)
self.has_pf = (self.start_pref_pf != 0.0 or self.limit_pref_pf != 0.0)
# data required
add_data_requirement('energy', 1, atomic=False, must=False, high_prec=True)
add_data_requirement('force', 3, atomic=True, must=False, high_prec=False)
Expand Down
12 changes: 6 additions & 6 deletions source/op/descrpt_se_a_multi_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,16 @@ class DescrptSeAOp : public OpKernel {
float rcut_a;
float rcut_r;
float rcut_r_smth;
std::std::vector<int32> sel_r;
std::std::vector<int32> sel_a;
std::std::vector<int> sec_a;
std::std::vector<int> sec_r;
std::vector<int32> sel_r;
std::vector<int32> sel_a;
std::vector<int> sec_a;
std::vector<int> sec_r;
int ndescrpt, ndescrpt_a, ndescrpt_r;
int nnei, nnei_a, nnei_r, nloc, nall, max_nbor_size;
bool fill_nei_a;

//private func
void cum_sum (std::std::vector<int> & sec, const std::std::vector<int32> & n_sel) const {
void cum_sum (std::vector<int> & sec, const std::vector<int32> & n_sel) const {
sec.resize (n_sel.size() + 1);
sec[0] = 0;
for (int ii = 1; ii < sec.size(); ++ii) {
Expand Down Expand Up @@ -292,4 +292,4 @@ REGISTER_KERNEL_BUILDER(
DescrptSeAOp<GPUDevice, T>);
REGISTER_GPU(float);
REGISTER_GPU(double);
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA
12 changes: 6 additions & 6 deletions source/op/descrpt_se_r_multi_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ class DescrptSeROp : public OpKernel {
private:
float rcut;
float rcut_smth;
std::std::vector<int32> sel;
std::std::vector<int32> sel_null;
std::std::vector<int> sec;
std::std::vector<int> sec_null;
std::vector<int32> sel;
std::vector<int32> sel_null;
std::vector<int> sec;
std::vector<int> sec_null;
int nnei, ndescrpt, nloc, nall;
bool fill_nei_a;

//private func
void cum_sum (std::std::vector<int> & sec, const std::std::vector<int32> & n_sel) const {
void cum_sum (std::vector<int> & sec, const std::vector<int32> & n_sel) const {
sec.resize (n_sel.size() + 1);
sec[0] = 0;
for (int ii = 1; ii < sec.size(); ++ii) {
Expand Down Expand Up @@ -281,4 +281,4 @@ REGISTER_KERNEL_BUILDER(
DescrptSeROp<GPUDevice, T>);
REGISTER_GPU(float);
REGISTER_GPU(double);
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA