Class DeepBaseModelDevi#

Inheritance Relationships#

Derived Types#

Class Documentation#

class DeepBaseModelDevi#

Subclassed by deepmd::DeepPotModelDevi, deepmd::DeepSpinModelDevi

Public Functions

DeepBaseModelDevi()#

DP model deviation constructor without initialization.

virtual ~DeepBaseModelDevi()#
inline double cutoff() const#

Get the cutoff radius.

Returns:

The cutoff radius.

inline int numb_types() const#

Get the number of types.

Returns:

The number of types.

inline int numb_types_spin() const#

Get the number of types with spin.

Returns:

The number of types with spin.

inline int dim_fparam() const#

Get the dimension of the frame parameter.

Returns:

The dimension of the frame parameter.

inline int dim_aparam() const#

Get the dimension of the atomic parameter.

Returns:

The dimension of the atomic parameter.

template<typename VALUETYPE>
void compute_avg(VALUETYPE &dener, const std::vector<VALUETYPE> &all_energy)#

Compute the average energy.

Parameters:
  • dener[out] The average energy.

  • all_energy[in] The energies of all models.

template<typename VALUETYPE>
void compute_avg(std::vector<VALUETYPE> &avg, const std::vector<std::vector<VALUETYPE>> &xx)#

Compute the average of vectors.

Parameters:
  • avg[out] The average of vectors.

  • xx[in] The vectors of all models.

template<typename VALUETYPE>
void compute_std(std::vector<VALUETYPE> &std, const std::vector<VALUETYPE> &avg, const std::vector<std::vector<VALUETYPE>> &xx, const int &stride)#

Compute the standard deviation of vectors.

Parameters:
  • std[out] The standard deviation of vectors.

  • avg[in] The average of vectors.

  • xx[in] The vectors of all models.

  • stride[in] The stride to compute the deviation.

template<typename VALUETYPE>
void compute_relative_std(std::vector<VALUETYPE> &std, const std::vector<VALUETYPE> &avg, const VALUETYPE eps, const int &stride)#

Compute the relative standard deviation of vectors.

Parameters:
  • std[out] The standard deviation of vectors.

  • avg[in] The average of vectors.

  • eps[in] The level parameter for computing the deviation.

  • stride[in] The stride to compute the deviation.

template<typename VALUETYPE>
void compute_std_e(std::vector<VALUETYPE> &std, const std::vector<VALUETYPE> &avg, const std::vector<std::vector<VALUETYPE>> &xx)#

Compute the standard deviation of atomic energies.

Parameters:
  • std[out] The standard deviation of atomic energies.

  • avg[in] The average of atomic energies.

  • xx[in] The vectors of all atomic energies.

template<typename VALUETYPE>
void compute_std_f(std::vector<VALUETYPE> &std, const std::vector<VALUETYPE> &avg, const std::vector<std::vector<VALUETYPE>> &xx)#

Compute the standard deviation of forces.

Parameters:
  • std[out] The standard deviation of forces.

  • avg[in] The average of forces.

  • xx[in] The vectors of all forces.

template<typename VALUETYPE>
void compute_relative_std_f(std::vector<VALUETYPE> &std, const std::vector<VALUETYPE> &avg, const VALUETYPE eps)#

Compute the relative standard deviation of forces.

Parameters:
  • std[out] The relative standard deviation of forces.

  • avg[in] The relative average of forces.

  • eps[in] The level parameter for computing the deviation.

inline bool is_aparam_nall() const#

Get whether the atom dimension of aparam is nall instead of fparam.

Parameters:

aparam_nall[out] whether the atom dimension of aparam is nall instead of fparam.

Protected Attributes

unsigned numb_models#
std::vector<std::shared_ptr<deepmd::DeepBaseModel>> dpbases#
bool inited#