126 bool skipNormalize =
false,
127 bool initialHardness =
false);
181 std::string
const& fileName =
"scaling.data");
188#ifndef N2P2_NO_SF_CACHE
221 bool collectStatistics,
222 bool collectExtrapolationWarnings,
223 bool writeExtrapolationWarnings,
224 bool stopOnExtrapolationWarnings);
248 std::map<std::string,
249 std::string> fileNameFormats =
250 std::map<std::string,
266 std::string directoryPrefix,
267 std::map<std::string,
268 std::string> fileNameFormats =
269 std::map<std::string,
282 std::string directoryPrefix =
284 std::string fileNameFormat =
285 "hardness.%03zu.data");
299 bool const derivatives);
314 bool const derivatives);
342 bool const derivatives,
343 std::string
id =
"");
353 bool const derivativesElec);
385 bool useForces =
true,
386 bool useDEdG =
true);
422 bool ref =
true)
const;
431 double normalized(std::string
const& property,
442 bool ref =
true)
const;
451 double physical(std::string
const& property,
461 bool ref =
true)
const;
543 std::string
const& keyword)
const;
551 std::string
const& keyword)
const;
573 std::vector<double> > sensitivity);
580 std::vector<std::size_t> prune,
582 =
"output.nn")
const;
588 std::ofstream*
const& file)
const;
647 std::vector<std::string>
nnk;
661 std::string
const& fileName);
CutoffType
List of available cutoff function types.
Setup data for Ewald summation.
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
std::vector< std::vector< double > > cutoffs
Matrix storing all symmetry function cut-offs for all elements.
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.
void logEwaldCutoffs()
Logs Ewald params whenever they change.
virtual void setupElementMap()
Set up the element map.
void readNeuralNetworkWeights(std::string const &id, std::string const &fileName)
Read in weights for a specific type of neural network.
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 setupGeneric(std::string const &nnpDir="", bool skipNormalize=false, bool initialHardness=false)
Combine multiple setup routines and provide a basic NNP setup.
std::vector< std::string > nnk
virtual void setupElectrostatics(bool initialHardness=false, std::string directoryPrefix="", std::string fileNameFormat="hardness.%03zu.data")
Set up electrostatics related stuff (hardness, screening, ...).
std::vector< std::size_t > pruneSymmetryFunctionsRange(double threshold)
Prune symmetry functions according to their range and write settings file.
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.
ScreeningFunction screeningFunction
SymFnc::ScalingType scalingType
void calculateAtomicNeuralNetworks(Structure &structure, bool const derivatives, std::string id="")
Calculate atomic neural networks for all atoms in given structure.
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.
bool useNormalization() const
Check if normalization is enabled.
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.
settings::Settings settings
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.
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 chargeEquilibration(Structure &structure, bool const derivativesElec)
Perform global charge equilibration method.
void calculateSymmetryFunctions(Structure &structure, bool const derivatives)
Calculate all symmetry functions 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 setupCutoffMatrix()
Setup matrix storing all symmetry function cut-offs for each element.
std::map< std::string, NNSetup > nns
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 getConvCharge() const
Getter for Mode::convCharge.
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.
ActivationFunction
List of available activation function types.
A screening functions for use with electrostatics.
ScalingType
List of available scaling types.
Reads and analyzes settings file and stores parameters.
Helper class to store previously calculated values of erfc() that are needed during the charge equili...
std::vector< NeuralNetwork::ActivationFunction > activationFunctionsPerLayer
Activation function type per layer.
std::vector< int > numNeuronsPerLayer
Number of neurons per layer.
int numLayers
Number of NN layers (including input and output layer).
Setup data for one neural network.
std::string keywordSuffix
Suffix for keywords (NN topology related).
std::vector< Topology > topology
Per-element NN topology.
std::string weightFileFormat
Format for weight files.
std::string id
NN identifier, e.g. "short", "charge",...
std::string keywordSuffix2
Suffix for some other keywords (weight file loading related).
std::string name
Description string for log output, e.g. "electronegativity".
Storage for one atomic configuration.