n2p2 - A neural network potential package
nnp::Training::Property Struct Reference

Specific training quantity (e.g. energies, forces, charges). More...

Collaboration diagram for nnp::Training::Property:

Public Member Functions

 Property (std::string const &property)
 Constructor. More...
 

Public Attributes

std::string property
 Copy of identifier within Property map. More...
 
std::string displayMetric
 Error metric for display. More...
 
std::string tiny
 Tiny abbreviation string for property. More...
 
std::string plural
 Plural string of property;. More...
 
SelectionMode selectionMode
 Selection mode for update candidates. More...
 
std::size_t numTrainPatterns
 Number of training patterns in set. More...
 
std::size_t numTestPatterns
 Number of training patterns in set. More...
 
std::size_t taskBatchSize
 Batch size for each MPI task. More...
 
std::size_t writeCompEvery
 Write comparison every this many epochs. More...
 
std::size_t writeCompAlways
 Up to this epoch comparison is written every epoch. More...
 
std::size_t posUpdateCandidates
 Current position in update candidate list (SM_SORT). More...
 
std::size_t rmseThresholdTrials
 Maximum trials for SM_THRESHOLD selection mode. More...
 
std::size_t countUpdates
 Counter for updates per epoch. More...
 
std::size_t numUpdates
 Number of desired updates per epoch. More...
 
std::size_t patternsPerUpdate
 Patterns used per update. More...
 
std::size_t patternsPerUpdateGlobal
 Patterns used per update (summed over all MPI tasks). More...
 
std::size_t numErrorsGlobal
 Global number of errors per update. More...
 
double epochFraction
 Desired update fraction per epoch. More...
 
double rmseThreshold
 RMSE threshold for update candidates. More...
 
std::vector< int > errorsPerTask
 Errors per task for each update. More...
 
std::vector< int > offsetPerTask
 Offset for combined error per task. More...
 
std::vector< std::string > errorMetrics
 Error metrics available for this property. More...
 
std::map< std::string, double > errorTrain
 Current error metrics of training patterns. More...
 
std::map< std::string, double > errorTest
 Current error metrics of test patterns. More...
 
std::vector< UpdateCandidateupdateCandidates
 Vector with indices of training patterns. More...
 
std::vector< std::vector< int > > weightsPerTask
 Weights per task per updater. More...
 
std::vector< std::vector< int > > offsetJacobian
 Stride for Jacobians per task per updater. More...
 
std::vector< std::vector< double > > error
 Global error vector (per updater). More...
 
std::vector< std::vector< double > > jacobian
 Global Jacobian (per updater). More...
 
std::map< std::size_t, SelectionModeselectionModeSchedule
 Schedule for varying selection mode. More...
 

Detailed Description

Specific training quantity (e.g. energies, forces, charges).

Definition at line 367 of file Training.h.

Constructor & Destructor Documentation

◆ Property()

Training::Property::Property ( std::string const &  property)

Constructor.

Definition at line 3650 of file Training.cpp.

3650 :
3651 property (property ),
3652 displayMetric ("" ),
3653 tiny ("" ),
3654 plural ("" ),
3656 numTrainPatterns (0 ),
3657 numTestPatterns (0 ),
3658 taskBatchSize (0 ),
3659 writeCompEvery (0 ),
3660 writeCompAlways (0 ),
3663 countUpdates (0 ),
3664 numUpdates (0 ),
3665 patternsPerUpdate (0 ),
3667 numErrorsGlobal (0 ),
3668 epochFraction (0.0 ),
3669 rmseThreshold (0.0 )
3670{
3671 if (property == "energy")
3672 {
3673 tiny = "E";
3674 plural = "energies";
3675 errorMetrics = {"RMSEpa", "RMSE", "MAEpa", "MAE"};
3676 }
3677 else if (property == "force")
3678 {
3679 tiny = "F";
3680 plural = "forces";
3681 errorMetrics = {"RMSE", "MAE"};
3682 }
3683 else if (property == "charge")
3684 {
3685 tiny = "Q";
3686 plural = "charges";
3687 errorMetrics = {"RMSE", "MAE"};
3688 }
3689 else
3690 {
3691 throw runtime_error("ERROR: Unknown training property.\n");
3692 }
3693
3694 // Set up error metrics
3695 for (auto m : errorMetrics)
3696 {
3697 errorTrain[m] = 0.0;
3698 errorTest[m] = 0.0;
3699 }
3701}
@ SM_RANDOM
Select candidates randomly.
Definition: Training.h:107
std::size_t numErrorsGlobal
Global number of errors per update.
Definition: Training.h:405
std::size_t numTrainPatterns
Number of training patterns in set.
Definition: Training.h:383
std::size_t writeCompAlways
Up to this epoch comparison is written every epoch.
Definition: Training.h:391
std::string property
Copy of identifier within Property map.
Definition: Training.h:373
SelectionMode selectionMode
Selection mode for update candidates.
Definition: Training.h:381
std::size_t numUpdates
Number of desired updates per epoch.
Definition: Training.h:399
double rmseThreshold
RMSE threshold for update candidates.
Definition: Training.h:409
std::string plural
Plural string of property;.
Definition: Training.h:379
double epochFraction
Desired update fraction per epoch.
Definition: Training.h:407
std::size_t patternsPerUpdate
Patterns used per update.
Definition: Training.h:401
std::size_t taskBatchSize
Batch size for each MPI task.
Definition: Training.h:387
std::string displayMetric
Error metric for display.
Definition: Training.h:375
std::string tiny
Tiny abbreviation string for property.
Definition: Training.h:377
std::vector< std::string > errorMetrics
Error metrics available for this property.
Definition: Training.h:415
std::size_t numTestPatterns
Number of training patterns in set.
Definition: Training.h:385
std::size_t countUpdates
Counter for updates per epoch.
Definition: Training.h:397
std::size_t writeCompEvery
Write comparison every this many epochs.
Definition: Training.h:389
std::map< std::string, double > errorTrain
Current error metrics of training patterns.
Definition: Training.h:418
std::size_t patternsPerUpdateGlobal
Patterns used per update (summed over all MPI tasks).
Definition: Training.h:403
std::map< std::string, double > errorTest
Current error metrics of test patterns.
Definition: Training.h:421
std::size_t rmseThresholdTrials
Maximum trials for SM_THRESHOLD selection mode.
Definition: Training.h:395
std::size_t posUpdateCandidates
Current position in update candidate list (SM_SORT).
Definition: Training.h:393

References displayMetric, errorMetrics, errorTest, errorTrain, plural, property, and tiny.

Member Data Documentation

◆ property

std::string nnp::Training::Property::property

Copy of identifier within Property map.

Definition at line 373 of file Training.h.

Referenced by Property().

◆ displayMetric

std::string nnp::Training::Property::displayMetric

Error metric for display.

Definition at line 375 of file Training.h.

Referenced by Property().

◆ tiny

std::string nnp::Training::Property::tiny

Tiny abbreviation string for property.

Definition at line 377 of file Training.h.

Referenced by Property().

◆ plural

std::string nnp::Training::Property::plural

Plural string of property;.

Definition at line 379 of file Training.h.

Referenced by Property().

◆ selectionMode

SelectionMode nnp::Training::Property::selectionMode

Selection mode for update candidates.

Definition at line 381 of file Training.h.

Referenced by nnp::Training::update().

◆ numTrainPatterns

std::size_t nnp::Training::Property::numTrainPatterns

Number of training patterns in set.

Definition at line 383 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan().

◆ numTestPatterns

std::size_t nnp::Training::Property::numTestPatterns

Number of training patterns in set.

Definition at line 385 of file Training.h.

◆ taskBatchSize

std::size_t nnp::Training::Property::taskBatchSize

Batch size for each MPI task.

Definition at line 387 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan(), and nnp::Training::update().

◆ writeCompEvery

std::size_t nnp::Training::Property::writeCompEvery

Write comparison every this many epochs.

Definition at line 389 of file Training.h.

◆ writeCompAlways

std::size_t nnp::Training::Property::writeCompAlways

Up to this epoch comparison is written every epoch.

Definition at line 391 of file Training.h.

◆ posUpdateCandidates

std::size_t nnp::Training::Property::posUpdateCandidates

Current position in update candidate list (SM_SORT).

Definition at line 393 of file Training.h.

Referenced by nnp::Training::update().

◆ rmseThresholdTrials

std::size_t nnp::Training::Property::rmseThresholdTrials

Maximum trials for SM_THRESHOLD selection mode.

Definition at line 395 of file Training.h.

Referenced by nnp::Training::update().

◆ countUpdates

std::size_t nnp::Training::Property::countUpdates

Counter for updates per epoch.

Definition at line 397 of file Training.h.

Referenced by nnp::Training::update().

◆ numUpdates

std::size_t nnp::Training::Property::numUpdates

Number of desired updates per epoch.

Definition at line 399 of file Training.h.

Referenced by nnp::Training::setupTraining(), and nnp::Training::setupUpdatePlan().

◆ patternsPerUpdate

std::size_t nnp::Training::Property::patternsPerUpdate

Patterns used per update.

Definition at line 401 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan(), and nnp::Training::update().

◆ patternsPerUpdateGlobal

std::size_t nnp::Training::Property::patternsPerUpdateGlobal

Patterns used per update (summed over all MPI tasks).

Definition at line 403 of file Training.h.

Referenced by nnp::Training::setupTraining(), and nnp::Training::setupUpdatePlan().

◆ numErrorsGlobal

std::size_t nnp::Training::Property::numErrorsGlobal

Global number of errors per update.

Definition at line 405 of file Training.h.

Referenced by nnp::Training::allocateArrays(), and nnp::Training::setupUpdatePlan().

◆ epochFraction

double nnp::Training::Property::epochFraction

Desired update fraction per epoch.

Definition at line 407 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan().

◆ rmseThreshold

double nnp::Training::Property::rmseThreshold

RMSE threshold for update candidates.

Definition at line 409 of file Training.h.

Referenced by nnp::Training::update().

◆ errorsPerTask

std::vector<int> nnp::Training::Property::errorsPerTask

Errors per task for each update.

Definition at line 411 of file Training.h.

Referenced by nnp::Training::allocateArrays(), nnp::Training::setupUpdatePlan(), and nnp::Training::update().

◆ offsetPerTask

std::vector<int> nnp::Training::Property::offsetPerTask

Offset for combined error per task.

Definition at line 413 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan(), and nnp::Training::update().

◆ errorMetrics

std::vector<std::string> nnp::Training::Property::errorMetrics

Error metrics available for this property.

Definition at line 415 of file Training.h.

Referenced by Property().

◆ errorTrain

std::map< std::string, double> nnp::Training::Property::errorTrain

Current error metrics of training patterns.

Definition at line 418 of file Training.h.

Referenced by Property(), and nnp::Training::update().

◆ errorTest

std::map< std::string, double> nnp::Training::Property::errorTest

Current error metrics of test patterns.

Definition at line 421 of file Training.h.

Referenced by Property().

◆ updateCandidates

std::vector<UpdateCandidate> nnp::Training::Property::updateCandidates

Vector with indices of training patterns.

Definition at line 423 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan(), and nnp::Training::update().

◆ weightsPerTask

std::vector< std::vector<int> > nnp::Training::Property::weightsPerTask

Weights per task per updater.

Definition at line 426 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan(), and nnp::Training::update().

◆ offsetJacobian

std::vector< std::vector<int> > nnp::Training::Property::offsetJacobian

Stride for Jacobians per task per updater.

Definition at line 429 of file Training.h.

Referenced by nnp::Training::setupUpdatePlan(), and nnp::Training::update().

◆ error

std::vector< std::vector<double> > nnp::Training::Property::error

Global error vector (per updater).

Definition at line 432 of file Training.h.

Referenced by nnp::Training::allocateArrays(), and nnp::Training::update().

◆ jacobian

std::vector< std::vector<double> > nnp::Training::Property::jacobian

Global Jacobian (per updater).

Definition at line 435 of file Training.h.

Referenced by nnp::Training::allocateArrays(), and nnp::Training::update().

◆ selectionModeSchedule

std::map< std::size_t, SelectionMode> nnp::Training::Property::selectionModeSchedule

Schedule for varying selection mode.

Definition at line 438 of file Training.h.


The documentation for this struct was generated from the following files: