Skip to content
Snippets Groups Projects
Commit 0daaac0c authored by mkirsz's avatar mkirsz
Browse files

Fix to reflect latest changes to the code. Examples compile and produce expected results.

parent 3949c37d
No related branches found
No related tags found
No related merge requests found
Pipeline #33665 canceled
#include <tadah/cutoffs/cut_all.h> #include <tadah/MODELS/cutoffs/cut_all.h>
#include <tadah/descriptors/d_all.h> #include <tadah/MODELS/descriptors/d_all.h>
#include <tadah/models/m_all.h> #include <tadah/MLIP/models/m_all.h>
#include <tadah/basis_functions/bf_all.h> #include <tadah/MLIP/design_matrix/functions/basis_functions/dm_bf_all.h>
#include <tadah/kernels/kern_all.h> #include <tadah/MODELS/functions/kernels/kern_all.h>
#include <tadah/config.h> #include <tadah/CORE/config/config.h>
#include <tadah/structure.h> #include <tadah/MLIP/structure.h>
#include <tadah/descriptors_calc.h> #include <tadah/MLIP/descriptors_calc.h>
#include <tadah/nn_finder.h> #include <tadah/MLIP/nn_finder.h>
#include <tadah/output/output.h> #include <tadah/MLIP/output/output.h>
#include <fstream> #include <fstream>
/** @file ex1.cpp /** @file ex1.cpp
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* To compile with `g++` and run: * To compile with `g++` and run:
* *
* \code{.sh} * \code{.sh}
* $ g++ -std=c++17 -O3 ex1.cpp -o ex1.out -ltadah -fopenmp * $ g++ -std=c++17 -O3 ex1.cpp -o ex1.out -ltadah -llapack -fopenmp
* $ ./ex1.out * $ ./ex1.out
* \endcode * \endcode
* *
...@@ -98,7 +98,7 @@ int main() { ...@@ -98,7 +98,7 @@ int main() {
// BF is used for M_BLR - Bayesian Linear Regression // BF is used for M_BLR - Bayesian Linear Regression
// K is used with M_KRR - Kernel Ridge Regression // K is used with M_KRR - Kernel Ridge Regression
// See documentation for more BF and K // See documentation for more BF and K
using BF=BF_Linear; using BF=DM_BF_Linear;
//using BF=BF_Polynomial2; //using BF=BF_Polynomial2;
//using K=Kern_Linear; //using K=Kern_Linear;
//using K=Kern_Quadratic; //using K=Kern_Quadratic;
...@@ -107,10 +107,10 @@ int main() { ...@@ -107,10 +107,10 @@ int main() {
using M=M_BLR<BF>; using M=M_BLR<BF>;
//using M=M_KRR<K>; //using M=M_KRR<K>;
// STEP 2c: Instantiate a model //// STEP 2c: Instantiate a model
M model(config); M model(config);
std::cout << "TRAINING STAGE..." << std::flush; //std::cout << "TRAINING STAGE..." << std::flush;
// STEP 3: Training - Option 1. // STEP 3: Training - Option 1.
// Train with StructureDB only. We have to provide calculators here. // Train with StructureDB only. We have to provide calculators here.
......
#include <tadah/cutoffs/cut_all.h> #include <tadah/MODELS/cutoffs/cut_all.h>
#include <tadah/descriptors/d_all.h> #include <tadah/MODELS/descriptors/d_all.h>
#include <tadah/models/m_all.h> #include <tadah/MLIP/models/m_all.h>
#include <tadah/descriptors_calc.h> #include <tadah/MLIP/descriptors_calc.h>
#include <tadah/config.h> #include <tadah/CORE/config/config.h>
#include <tadah/structure.h> #include <tadah/MLIP/structure.h>
#include <tadah/nn_finder.h> #include <tadah/MLIP/nn_finder.h>
#include <tadah/output/output.h> #include <tadah/MLIP/output/output.h>
#include <tadah/MLIP/design_matrix/functions/dm_f_all.h>
#include <fstream> #include <fstream>
/** @file ex2.cpp /** @file ex2.cpp
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
* To compile with `g++` and run: * To compile with `g++` and run:
* *
* \code{.sh} * \code{.sh}
* $ g++ -std=c++17 -O3 ex2.cpp -o ex2.out -ltadah -fopenmp * $ g++ -std=c++17 -O3 ex2.cpp -o ex2.out -ltadah -llapack -fopenmp
* $ ./ex2.out * $ ./ex2.out
* \endcode * \endcode
* *
...@@ -64,7 +65,7 @@ int main() { ...@@ -64,7 +65,7 @@ int main() {
// If keyword is not listed use `Cut_Dummy`. // If keyword is not listed use `Cut_Dummy`.
// `pot.tadah`: RCTYPE2B Cut_Cos // `pot.tadah`: RCTYPE2B Cut_Cos
using C2=Cut_Cos; using C2=Cut_Cos;
// `pot.tadah` no keywords ofr three-body and many-body // `pot.tadah` no keywords for three-body and many-body
using C3=Cut_Dummy; using C3=Cut_Dummy;
using CM=Cut_Dummy; using CM=Cut_Dummy;
...@@ -73,7 +74,7 @@ int main() { ...@@ -73,7 +74,7 @@ int main() {
// K is used with M_KRR - Kernel Ridge Regression // K is used with M_KRR - Kernel Ridge Regression
// KEYWORD `MODEL`: first argument is model, second BF/Kernel // KEYWORD `MODEL`: first argument is model, second BF/Kernel
// `pot.tadah`: MODEL M_KRR Kern_Linear // `pot.tadah`: MODEL M_KRR Kern_Linear
using K=Kern_Linear; using K=DM_Kern_Linear;
// STEP 2b: Select Model and instantiate object. // STEP 2b: Select Model and instantiate object.
// `pot.tadah`: MODEL M_KRR Kern_Linear // `pot.tadah`: MODEL M_KRR Kern_Linear
......
ALPHA 1.0 ALPHA 1
BETA 1.0 BETA 1
BIAS true BIAS false
CGRID2B -1 4 1.0 5.3 CGRID2B -1 4 1.0 5.3
CHECKPRESS false DIMER false
DIMER false 0 false
EWEIGHT 1.0 EWEIGHT 1.0
FWEIGHT 1.0 FWEIGHT 1
INIT2B true INIT2B true
INIT3B false INIT3B false
INITMB false INITMB false
LAMBDA 0 LAMBDA 0
MODEL M_BLR BF_Linear MODEL M_BLR BF_Linear
NMEAN 1 194.0239012 198.413198 167.8651188 8.242704556 NORM false
NORM true
NSTDEV 0 2.79425471 2.914508228 1.43784523 0.3225202259
OUTPREC 10 OUTPREC 10
RCTYPE2B Cut_Cos RCTYPE2B Cut_Cos
RCUT2B 5.3 RCUT2B 5.3
SGRID2B -2 4 0.1 1.0 SGRID2B -2 4 0.1 1.0
SWEIGHT 1.0 SWEIGHT 1
TYPE2B D2_Blip TYPE2B D2_Blip
WEIGHTS -4.415741551 0.4218953511 -0.3750771288 -0.06328812171 -0.05230011264 WEIGHTS 0.3501814918 -0.2916197278 -0.08735823387 -0.04659144812
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment