164 std::string
const& fileName =
"scaling.data");
171#ifndef N2P2_NO_SF_CACHE
204 bool collectStatistics,
205 bool collectExtrapolationWarnings,
206 bool writeExtrapolationWarnings,
207 bool stopOnExtrapolationWarnings);
229 std::string
const& fileNameFormatShort
230 =
"weights.%03zu.data",
231 std::string
const& fileNameFormatCharge
232 =
"weightse.%03zu.data");
246 bool const derivatives);
261 bool const derivatives);
290 bool const derivatives);
350 bool ref =
true)
const;
358 double normalized(std::string
const& property,
369 bool ref =
true)
const;
377 double physical(std::string
const& property,
387 bool ref =
true)
const;
460 std::string
const& keyword)
const;
468 std::string
const& keyword)
const;
490 std::vector<double> > sensitivity);
497 std::vector<std::size_t> prune,
499 =
"output.nn")
const;
505 std::ofstream*
const& file)
const;
536 std::string
const& fileName);
CutoffType
List of available cutoff function types.
Logging class for library output.
Base class for all NNP applications.
double physicalEnergy(Structure const &structure, bool ref=true) const
Undo normalization for a given energy of structure.
bool checkExtrapolationWarnings
NNPType getNnpType() const
Getter for Mode::nnpType.
void setupNormalization(bool standalone=true)
Set up normalization.
ElementMap elementMap
Global element map, populated by setupElementMap().
std::vector< double > minCutoffRadius
void addEnergyOffset(Structure &structure, bool ref=true)
Add atomic energy offsets to reference energy.
void initialize()
Write welcome message with version information.
virtual void setupElementMap()
Set up the element map.
std::size_t getNumElements() const
Getter for Mode::numElements.
virtual void setupNeuralNetwork()
Set up neural networks for all elements.
virtual void setupSymmetryFunctionCache(bool verbose=false)
Set up symmetry function cache.
double getConvLength() const
Getter for Mode::convLength.
void readNeuralNetworkWeights(std::string const &type, std::string const &fileName)
Read in weights for a specific type of neural network.
std::vector< std::size_t > pruneSymmetryFunctionsRange(double threshold)
Prune symmetry functions according to their range and write settings file.
SymFnc::ScalingType scalingType
double physical(std::string const &property, double value) const
Undo normalization for a given property.
void writePrunedSettingsFile(std::vector< std::size_t > prune, std::string fileName="output.nn") const
Copy settings file but comment out lines provided.
virtual void setupSymmetryFunctionGroups()
Set up symmetry function groups.
std::vector< Element > elements
double getMaxCutoffRadius() const
Getter for Mode::maxCutoffRadius.
double normalized(std::string const &property, double value) const
Apply normalization to given property.
void calculateAtomicNeuralNetworks(Structure &structure, bool const derivatives)
Calculate a single atomic neural network for a given atom and nn type.
bool useNormalization() const
Check if normalization is enabled.
virtual void setupNeuralNetworkWeights(std::string const &fileNameFormatShort="weights.%03zu.data", std::string const &fileNameFormatCharge="weightse.%03zu.data")
Set up neural network weights from files.
void convertToNormalizedUnits(Structure &structure) const
Convert one structure to normalized units.
void calculateEnergy(Structure &structure) const
Calculate potential energy for a given structure.
void calculateSymmetryFunctionGroups(Structure &structure, bool const derivatives)
Calculate all symmetry function groups for all atoms in given structure.
double getConvEnergy() const
Getter for Mode::convEnergy.
void setupSymmetryFunctionScalingNone()
Set up "empy" symmetry function scaling.
std::string settingsGetValue(std::string const &keyword) const
Get value for given keyword in Settings instance.
virtual void setupSymmetryFunctionScaling(std::string const &fileName="scaling.data")
Set up symmetry function scaling from file.
std::vector< std::size_t > getNumSymmetryFunctions() const
Get number of symmetry functions per element.
std::size_t getNumExtrapolationWarnings() const
Count total number of extrapolation warnings encountered for all elements and symmetry functions.
void removeEnergyOffset(Structure &structure, bool ref=true)
Remove atomic energy offsets from reference energy.
bool settingsKeywordExists(std::string const &keyword) const
Check if keyword was found in settings file.
double getMeanEnergy() const
Getter for Mode::meanEnergy.
void resetExtrapolationWarnings()
Erase all extrapolation warnings and reset counters.
double getEnergyWithOffset(Structure const &structure, bool ref=true) const
Add atomic energy offsets and return energy.
void setupGeneric(bool skipNormalize=false)
Combine multiple setup routines and provide a basic NNP setup.
std::vector< std::size_t > minNeighbors
void convertToPhysicalUnits(Structure &structure) const
Convert one structure to physical units.
void calculateCharge(Structure &structure) const
Calculate total charge for a given structure.
virtual void setupSymmetryFunctions()
Set up all symmetry functions.
void calculateSymmetryFunctions(Structure &structure, bool const derivatives)
Calculate all symmetry functions for all atoms in given structure.
void calculateForces(Structure &structure) const
Calculate forces for all atoms in given structure.
void setupSymmetryFunctionStatistics(bool collectStatistics, bool collectExtrapolationWarnings, bool writeExtrapolationWarnings, bool stopOnExtrapolationWarnings)
Set up symmetry function statistics collection.
void setupCutoff()
Set up cutoff function for all symmetry functions.
void loadSettingsFile(std::string const &fileName="input.nn")
Open settings file and load all keywords into memory.
std::vector< std::size_t > pruneSymmetryFunctionsSensitivity(double threshold, std::vector< std::vector< double > > sensitivity)
Prune symmetry functions with sensitivity analysis data.
double getEnergyOffset(Structure const &structure) const
Get atomic energy offset for given structure.
void setupSymmetryFunctionMemory(bool verbose=false)
Extract required memory dimensions for symmetry function derivatives.
void writeSettingsFile(std::ofstream *const &file) const
Write complete settings file.
double normalizedEnergy(Structure const &structure, bool ref=true) const
Apply normalization to given energy of structure.
CutoffFunction::CutoffType cutoffType
virtual void setupElements()
Set up all Element instances.
Reads and analyzes settings file and stores parameters.
ScalingType
List of available scaling types.
Storage for one atomic configuration.