Machine Learning Force Fields for Quantum Dots platform.
Some packages are required to be installed before starting using our MLFF_QD platform.
Some packages are requiered for running the preprocessing. Below we explain what is requiered and how to install it:
The simplest way to install PLAMS is through pip which will automatically get the source code from PyPI:
pip install PLAMS
One can find more information here.
One can install DScribe through pip which will automatically get the latest stable release:
pip install dscribe
They also provide a conda package through conda-forge:
conda install -c conda-forge dscribe
One can find more information here.
To install these packages we recommend to download the latest versions from their original repositories in the links below:
Then, to install them one can do the following in each folder:
pip install .
Apart from usual python packages such as numpy, scipy, sklearn or yaml, one needs to install also periodictable:
pip install periodictable
Some packages are requiered for running the training. Below we explain what is requiered and how to install it.
The simplest way to install SchNetPack is through pip which will automatically get the source code from PyPI:
pip install schnetpack
One can also install the most recent code from their repository:
git clone https://github.com/atomistic-machine-learning/schnetpack.git
cd schnetpack
pip install .
One can install the platform using pip in the following way:
git clone https://github.com/nlesc-nano/MLFF_QD.git
cd MLFF_QD
pip install -e .
The current version of the platform is developped for being run in a cluster. Thus, in this repository one can find the necessary code, a bash script example for submitting jobs in a slurm queue system and an input file example.
This plaform is currently being subject of several changes. Thus, on the meanwhile, descriptions of the files will be included here so they can be used.
The input file for the preprocessing of the data can be found in config/preprocess_config.yaml. The initial data for being processed should be placed in data/raw. This tool is used for preparaing the xyz files in the useful formats after DFT calculations with CP2K.
By default, the preprocessing code assumes that the input file is config/preprocess_config.yaml. If that is the case, it can be run as:
python -m mlff_qd.preprocessing.generate_mlff_dataset
However, if an user wants to specify a different custom configuration file for the preprocessing, the code can be run as:
python -m mlff_qd.preprocessing.generate_mlff_dataset --config config/my_experiment.yaml
Use the generate_scripts.py
script to automatically create a YAML configuration file for training. The script requires two parameters: the platform (-p
) and the output file (-o
).
To generate a configuration file for SchNet, run:
python generate_scripts.py -p schnet -o schnet.yaml
This command produces schnet.yaml
with all necessary settings for training using SchNet.
python generate_scripts.py -p nequip -o nequip.yaml
This generates nequip.yaml
, which is pre-configured for Nequip training.
If an user wants to run locally the training code, one can do the following:
python training.py --config input_file.yaml
By default, if no input file is specified, the training code looks for a file called input.yaml.
This script, analysis/extract_metrics.py
, extracts scalar training metrics from TensorBoard event files and saves them to a CSV file.
-p/--path
: Path to the TensorBoard event file. (Required).-o/--output_file
: Provides the path to the CSV file containing the training metrics.
- Prerequisites Required Python Packages:
tensorboard
You can install these using pip:
pip install tensorboard
To run the script use the following command:
python analysis/extract_metrics.py -p <event_file_path> [-o <output_file_name>]
The analysis/plot.py
script allows you to visualize training progress for your models. It accepts several command-line options to control its behavior. Here’s what each option means:
--platform
: Specifies the model platform. Use eitherschnet
ornequip
.--file
: Provides the path to the CSV file containing the training metrics.--cols
: Sets the number of columns for the subplot grid (default is 2).--out
: Defines the output file name for the saved plot. The name should end with.png
.
To plot the results for SchNet, use the following command:
python analysis/plot.py --platform schnet --file "path/to/schnet_metrics.csv" --cols 2 --out schnet_plot.png
Replace "path/to/schnet_metrics.csv" with the actual path to your SchNet metrics CSV file.
To plot the results for Nequip, use the following command:
python analysis/plot.py --platform nequip --file "path/to/nequip_metrics.csv" --cols 2 --out nequip_plot.png
Replace "path/to/nequip_metrics.csv" with the actual path to your Nequip metrics CSV file.
These commands will generate plots for the respective platforms and save them as PNG files in the current working directory.