|
n2p2 - A neural network potential package
|
#include <Prediction.h>


Public Member Functions | |
| Prediction () | |
| void | readStructureFromFile (std::string const &fileName="input.data") |
| void | setup () |
| void | predict () |
Public Member Functions inherited from nnp::Mode | |
| Mode () | |
| void | initialize () |
| Write welcome message with version information. | |
| void | loadSettingsFile (std::string const &fileName="input.nn") |
| Open settings file and load all keywords into memory. | |
| void | setupGeneric (std::string const &nnpDir="", bool skipNormalize=false, bool initialHardness=false) |
| Combine multiple setup routines and provide a basic NNP setup. | |
| void | setupNormalization (bool standalone=true) |
| Set up normalization. | |
| virtual void | setupElementMap () |
| Set up the element map. | |
| virtual void | setupElements () |
| Set up all Element instances. | |
| void | setupCutoff () |
| Set up cutoff function for all symmetry functions. | |
| virtual void | setupSymmetryFunctions () |
| Set up all symmetry functions. | |
| void | setupSymmetryFunctionScalingNone () |
| Set up "empy" symmetry function scaling. | |
| virtual void | setupSymmetryFunctionScaling (std::string const &fileName="scaling.data") |
| Set up symmetry function scaling from file. | |
| virtual void | setupSymmetryFunctionGroups () |
| Set up symmetry function groups. | |
| virtual void | setupSymmetryFunctionCache (bool verbose=false) |
| Set up symmetry function cache. | |
| void | setupSymmetryFunctionMemory (bool verbose=false) |
| Extract required memory dimensions for symmetry function derivatives. | |
| void | setupSymmetryFunctionStatistics (bool collectStatistics, bool collectExtrapolationWarnings, bool writeExtrapolationWarnings, bool stopOnExtrapolationWarnings) |
| Set up symmetry function statistics collection. | |
| void | setupCutoffMatrix () |
| Setup matrix storing all symmetry function cut-offs for each element. | |
| virtual void | setupNeuralNetwork () |
| Set up neural networks for all elements. | |
| virtual void | setupNeuralNetworkWeights (std::map< std::string, std::string > fileNameFormats=std::map< std::string, std::string >()) |
| Set up neural network weights from files with given name format. | |
| virtual void | setupNeuralNetworkWeights (std::string directoryPrefix, std::map< std::string, std::string > fileNameFormats=std::map< std::string, std::string >()) |
| Set up neural network weights from files with given name format. | |
| virtual void | setupElectrostatics (bool initialHardness=false, std::string directoryPrefix="", std::string fileNameFormat="hardness.%03zu.data") |
| Set up electrostatics related stuff (hardness, screening, ...). | |
| void | calculateSymmetryFunctions (Structure &structure, bool const derivatives) |
| Calculate all symmetry functions for all atoms in given structure. | |
| void | calculateSymmetryFunctionGroups (Structure &structure, bool const derivatives) |
| Calculate all symmetry function groups for all atoms in given structure. | |
| void | calculateAtomicNeuralNetworks (Structure &structure, bool const derivatives, std::string id="") |
| Calculate a single atomic neural network for a given atom and nn type. | |
| void | chargeEquilibration (Structure &structure, bool const derivativesElec) |
| Perform global charge equilibration method. | |
| void | calculateEnergy (Structure &structure) const |
| Calculate potential energy for a given structure. | |
| void | calculateCharge (Structure &structure) const |
| Calculate total charge for a given structure. | |
| void | calculateForces (Structure &structure) const |
| Calculate forces for all atoms in given structure. | |
| void | evaluateNNP (Structure &structure, bool useForces=true, bool useDEdG=true) |
| Evaluate neural network potential (includes total energy, optionally forces and in some cases charges. | |
| void | addEnergyOffset (Structure &structure, bool ref=true) |
| Add atomic energy offsets to reference energy. | |
| void | removeEnergyOffset (Structure &structure, bool ref=true) |
| Remove atomic energy offsets from reference energy. | |
| double | getEnergyOffset (Structure const &structure) const |
| Get atomic energy offset for given structure. | |
| double | getEnergyWithOffset (Structure const &structure, bool ref=true) const |
| Add atomic energy offsets and return energy. | |
| double | normalized (std::string const &property, double value) const |
| Apply normalization to given property. | |
| double | normalizedEnergy (Structure const &structure, bool ref=true) const |
| Apply normalization to given energy of structure. | |
| double | physical (std::string const &property, double value) const |
| Undo normalization for a given property. | |
| double | physicalEnergy (Structure const &structure, bool ref=true) const |
| Undo normalization for a given energy of structure. | |
| void | convertToNormalizedUnits (Structure &structure) const |
| Convert one structure to normalized units. | |
| void | convertToPhysicalUnits (Structure &structure) const |
| Convert one structure to physical units. | |
| void | logEwaldCutoffs () |
| Logs Ewald params whenever they change. | |
| std::size_t | getNumExtrapolationWarnings () const |
| Count total number of extrapolation warnings encountered for all elements and symmetry functions. | |
| void | resetExtrapolationWarnings () |
| Erase all extrapolation warnings and reset counters. | |
| NNPType | getNnpType () const |
| Getter for Mode::nnpType. | |
| double | getMeanEnergy () const |
| Getter for Mode::meanEnergy. | |
| double | getConvEnergy () const |
| Getter for Mode::convEnergy. | |
| double | getConvLength () const |
| Getter for Mode::convLength. | |
| double | getConvCharge () const |
| Getter for Mode::convCharge. | |
| double | getEwaldPrecision () const |
| Getter for Mode::ewaldSetup.precision. | |
| double | getEwaldMaxCharge () const |
| Getter for Mode::ewaldSetup.maxCharge. | |
| double | getEwaldMaxSigma () const |
| Getter for Mode::ewaldSetup.maxQsigma. | |
| EWALDTruncMethod | getEwaldTruncationMethod () const |
| Getter for Mode::ewaldSetup.truncMethod. | |
| KSPACESolver | kspaceSolver () const |
| Getter for Mode::kspaceSolver. | |
| double | getMaxCutoffRadius () const |
| Getter for Mode::maxCutoffRadius. | |
| std::size_t | getNumElements () const |
| Getter for Mode::numElements. | |
| ScreeningFunction | getScreeningFunction () const |
| Getter for Mode::screeningFunction. | |
| std::vector< std::size_t > | getNumSymmetryFunctions () const |
| Get number of symmetry functions per element. | |
| bool | useNormalization () const |
| Check if normalization is enabled. | |
| bool | settingsKeywordExists (std::string const &keyword) const |
| Check if keyword was found in settings file. | |
| std::string | settingsGetValue (std::string const &keyword) const |
| Get value for given keyword in Settings instance. | |
| std::vector< std::size_t > | pruneSymmetryFunctionsRange (double threshold) |
| Prune symmetry functions according to their range and write settings file. | |
| std::vector< std::size_t > | pruneSymmetryFunctionsSensitivity (double threshold, std::vector< std::vector< double > > sensitivity) |
| Prune symmetry functions with sensitivity analysis data. | |
| void | writePrunedSettingsFile (std::vector< std::size_t > prune, std::string fileName="output.nn") const |
| Copy settings file but comment out lines provided. | |
| void | writeSettingsFile (std::ofstream *const &file) const |
| Write complete settings file. | |
Public Attributes | |
| std::string | fileNameSettings |
| std::string | fileNameScaling |
| std::string | formatWeightsFilesShort |
| std::string | formatWeightsFilesCharge |
| Structure | structure |
Public Attributes inherited from nnp::Mode | |
| ElementMap | elementMap |
| Global element map, populated by setupElementMap(). | |
| Log | log |
| Global log file. | |
Additional Inherited Members | |
Public Types inherited from nnp::Mode | |
| enum class | NNPType { HDNNP_2G = 2 , HDNNP_4G = 4 , HDNNP_Q = 10 } |
Protected Member Functions inherited from nnp::Mode | |
| void | readNeuralNetworkWeights (std::string const &id, std::string const &fileName) |
| Read in weights for a specific type of neural network. | |
Protected Attributes inherited from nnp::Mode | |
| NNPType | nnpType |
| bool | normalize |
| bool | checkExtrapolationWarnings |
| std::size_t | numElements |
| std::vector< std::size_t > | minNeighbors |
| std::vector< double > | minCutoffRadius |
| double | maxCutoffRadius |
| double | cutoffAlpha |
| double | meanEnergy |
| double | convEnergy |
| double | convLength |
| double | convCharge |
| double | fourPiEps |
| EwaldSetup | ewaldSetup |
| KspaceGrid | kspaceGrid |
| settings::Settings | settings |
| SymFnc::ScalingType | scalingType |
| CutoffFunction::CutoffType | cutoffType |
| ScreeningFunction | screeningFunction |
| std::vector< Element > | elements |
| std::vector< std::string > | nnk |
| std::map< std::string, NNSetup > | nns |
| std::vector< std::vector< double > > | cutoffs |
| Matrix storing all symmetry function cut-offs for all elements. | |
| ErfcBuf | erfcBuf |
Definition at line 27 of file Prediction.h.
| Prediction::Prediction | ( | ) |
Definition at line 28 of file Prediction.cpp.
References fileNameScaling, fileNameSettings, formatWeightsFilesCharge, formatWeightsFilesShort, and nnp::Mode::Mode().

| void Prediction::readStructureFromFile | ( | std::string const & | fileName = "input.data" | ) |
Definition at line 50 of file Prediction.cpp.
References nnp::Mode::convCharge, nnp::Mode::convEnergy, nnp::Mode::convLength, nnp::Mode::elementMap, nnp::Mode::meanEnergy, nnp::Mode::normalize, nnp::Mode::removeEnergyOffset(), and structure.
Referenced by main().


| void Prediction::setup | ( | ) |
Definition at line 36 of file Prediction.cpp.
References fileNameScaling, fileNameSettings, formatWeightsFilesCharge, formatWeightsFilesShort, nnp::Mode::initialize(), nnp::Mode::loadSettingsFile(), nnp::Mode::setupGeneric(), nnp::Mode::setupNeuralNetworkWeights(), nnp::Mode::setupSymmetryFunctionScaling(), and nnp::Mode::setupSymmetryFunctionStatistics().
Referenced by main().


| void Prediction::predict | ( | ) |
Definition at line 67 of file Prediction.cpp.
References nnp::Mode::addEnergyOffset(), nnp::Mode::convCharge, nnp::Mode::convEnergy, nnp::Mode::convLength, nnp::Mode::evaluateNNP(), nnp::Mode::meanEnergy, nnp::Mode::normalize, and structure.
Referenced by main().


| std::string nnp::Prediction::fileNameSettings |
Definition at line 35 of file Prediction.h.
Referenced by Prediction(), and setup().
| std::string nnp::Prediction::fileNameScaling |
Definition at line 36 of file Prediction.h.
Referenced by Prediction(), and setup().
| std::string nnp::Prediction::formatWeightsFilesShort |
Definition at line 37 of file Prediction.h.
Referenced by Prediction(), and setup().
| std::string nnp::Prediction::formatWeightsFilesCharge |
Definition at line 38 of file Prediction.h.
Referenced by Prediction(), and setup().
| Structure nnp::Prediction::structure |
Definition at line 39 of file Prediction.h.
Referenced by main(), predict(), and readStructureFromFile().