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/_THRESHOLD). More...
 
std::size_t numGroupedSubCand
 Number of subcandidates which are considered before changing the update candidate. More...
 
std::size_t countGroupedSubCand
 Counter for number of used subcandidates belonging to same update candidate. 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 405 of file Training.h.

Constructor & Destructor Documentation

◆ Property()

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

Constructor.

Definition at line 4085 of file Training.cpp.

4085 :
4086 property (property ),
4087 displayMetric ("" ),
4088 tiny ("" ),
4089 plural ("" ),
4091 numTrainPatterns (0 ),
4092 numTestPatterns (0 ),
4093 taskBatchSize (0 ),
4094 writeCompEvery (0 ),
4095 writeCompAlways (0 ),
4097 numGroupedSubCand (0 ),
4100 countUpdates (0 ),
4101 numUpdates (0 ),
4102 patternsPerUpdate (0 ),
4104 numErrorsGlobal (0 ),
4105 epochFraction (0.0 ),
4106 rmseThreshold (0.0 )
4107{
4108 if (property == "energy")
4109 {
4110 tiny = "E";
4111 plural = "energies";
4112 errorMetrics = {"RMSEpa", "RMSE", "MAEpa", "MAE"};
4113 }
4114 else if (property == "force")
4115 {
4116 tiny = "F";
4117 plural = "forces";
4118 errorMetrics = {"RMSE", "MAE"};
4119 }
4120 else if (property == "charge")
4121 {
4122 tiny = "Q";
4123 plural = "charges";
4124 errorMetrics = {"RMSE", "MAE"};
4125 }
4126 else
4127 {
4128 throw runtime_error("ERROR: Unknown training property.\n");
4129 }
4130
4131 // Set up error metrics
4132 for (auto m : errorMetrics)
4133 {
4134 errorTrain[m] = 0.0;
4135 errorTest[m] = 0.0;
4136 }
4138}
@ SM_RANDOM
Select candidates randomly.
Definition: Training.h:107
std::size_t countGroupedSubCand
Counter for number of used subcandidates belonging to same update candidate.
Definition: Training.h:437
std::size_t numErrorsGlobal
Global number of errors per update.
Definition: Training.h:449
std::size_t numTrainPatterns
Number of training patterns in set.
Definition: Training.h:421
std::size_t writeCompAlways
Up to this epoch comparison is written every epoch.
Definition: Training.h:429
std::string property
Copy of identifier within Property map.
Definition: Training.h:411
SelectionMode selectionMode
Selection mode for update candidates.
Definition: Training.h:419
std::size_t numUpdates
Number of desired updates per epoch.
Definition: Training.h:443
double rmseThreshold
RMSE threshold for update candidates.
Definition: Training.h:453
std::string plural
Plural string of property;.
Definition: Training.h:417
double epochFraction
Desired update fraction per epoch.
Definition: Training.h:451
std::size_t patternsPerUpdate
Patterns used per update.
Definition: Training.h:445
std::size_t taskBatchSize
Batch size for each MPI task.
Definition: Training.h:425
std::string displayMetric
Error metric for display.
Definition: Training.h:413
std::string tiny
Tiny abbreviation string for property.
Definition: Training.h:415
std::vector< std::string > errorMetrics
Error metrics available for this property.
Definition: Training.h:459
std::size_t numTestPatterns
Number of training patterns in set.
Definition: Training.h:423
std::size_t countUpdates
Counter for updates per epoch.
Definition: Training.h:441
std::size_t writeCompEvery
Write comparison every this many epochs.
Definition: Training.h:427
std::size_t numGroupedSubCand
Number of subcandidates which are considered before changing the update candidate.
Definition: Training.h:434
std::map< std::string, double > errorTrain
Current error metrics of training patterns.
Definition: Training.h:462
std::size_t patternsPerUpdateGlobal
Patterns used per update (summed over all MPI tasks).
Definition: Training.h:447
std::map< std::string, double > errorTest
Current error metrics of test patterns.
Definition: Training.h:465
std::size_t rmseThresholdTrials
Maximum trials for SM_THRESHOLD selection mode.
Definition: Training.h:439
std::size_t posUpdateCandidates
Current position in update candidate list (SM_SORT/_THRESHOLD).
Definition: Training.h:431

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 411 of file Training.h.

Referenced by Property().

◆ displayMetric

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

Error metric for display.

Definition at line 413 of file Training.h.

Referenced by Property().

◆ tiny

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

Tiny abbreviation string for property.

Definition at line 415 of file Training.h.

Referenced by Property().

◆ plural

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

Plural string of property;.

Definition at line 417 of file Training.h.

Referenced by Property().

◆ selectionMode

SelectionMode nnp::Training::Property::selectionMode

Selection mode for update candidates.

Definition at line 419 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 421 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 423 of file Training.h.

◆ taskBatchSize

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

Batch size for each MPI task.

Definition at line 425 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 427 of file Training.h.

◆ writeCompAlways

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

Up to this epoch comparison is written every epoch.

Definition at line 429 of file Training.h.

◆ posUpdateCandidates

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

Current position in update candidate list (SM_SORT/_THRESHOLD).

Definition at line 431 of file Training.h.

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

◆ numGroupedSubCand

std::size_t nnp::Training::Property::numGroupedSubCand

Number of subcandidates which are considered before changing the update candidate.

Definition at line 434 of file Training.h.

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

◆ countGroupedSubCand

std::size_t nnp::Training::Property::countGroupedSubCand

Counter for number of used subcandidates belonging to same update candidate.

Definition at line 437 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 439 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 441 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 443 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 445 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 447 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 449 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 451 of file Training.h.

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

◆ rmseThreshold

double nnp::Training::Property::rmseThreshold

RMSE threshold for update candidates.

Definition at line 453 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 455 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 457 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 459 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 462 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 465 of file Training.h.

Referenced by Property().

◆ updateCandidates

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

Vector with indices of training patterns.

Definition at line 467 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 470 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 473 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 476 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 479 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 482 of file Training.h.


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