Giter Club home page Giter Club logo

rl-molecular-geometry-optimizer-with-chemical-information's Introduction

Getting Started

A guide on how to set up the project on a local machine. This section should include steps to install any dependencies required to run the project.

Installation

# create a new conda environment
conda env create -f environment.yml
conda activate rl-opt

# install the packages
pip install -r requirements.txt

Brief Folder Structure

Explain the organization of this project's folders and their contents:

.
├── Evaluation
│   ├── compare.py
│   ├── pysisyphus
│   ├── test-configs
│   └── worker.py
└── Train
    ├── configs
    ├── pysisyphus
    └── run.py

Train

  • configs: Contains the configuration files for training the model.
  • pysisyphus: this package is modified from the original pysisyphus. Optimizer.py is modified to the generator. It is also added RDKit.py as a new calcaulator.
  • run.py: This file is the entry point for starting the model training process.

Table Configs

In configs

Config File Description
cart1/v4.ini It corresponds to Group A.
many5103/v3.ini It corresponds to Group B.
many510/v3.ini It corresponds to Group C.
schnet1/v11.ini It corresponds to Group D.

Evaluation

  • test-configs: you can determine the dataset, the type of coordinates(e.g. cartesian(cart) or internal(redund) coordinates), the type of calculator(e.g. mmff or psi4) and the type of optimizer(e.g. bfgs or rl).
  • worker.py: This file is to collect the data(.json) which the optimizer optimize the molecular geometry.
  • compare.py: This file is to compare the performance of different optimizers after collecting the data.

Usage

Training

Run the training script

cd Train
python run.py \
    --name NAME \ 
    --version VERSION \
    --seed SEED

For example

We select the configuration file at many510/v3.ini and set the name as many510 and the version as 3. The seed is set as 283484033. The command is as follows:

cd Train
python run.py \
    --name many510 \ 
    --version 3 \
    --seed 283484033

After training, the model will be stored in Train/saves/NAME/VERSION/. You need to copy or move the model to the Evaluation folder if you want to evaluate the model.

Fine-tune

cd Train
python runWithPretrain.py \
    --name many510 \
    --version 3 \
    -r 708700354 \
    --pre_trained saves/RL-many510/v3/seed-283484033/best_model.pt \

Evaluation

Before we compare the performance of different optimizers, we need to collect the data(.json) which the optimizer optimize the molecular geometry. The data will be stored in Result-GROUP_NAME/OPTIMIZER_NAME/.

To collect the data, we can run the evaluation script first.

python worker.py --name GROUP_NAME --opt_key OPTIMIZER_NAME -p

For example

BFGS

In our setup, we have chosen BFGS (denoted as bfgs) as our optimizer. To utilize a dataset with perturbations, add the -p flag. If you prefer to use a dataset without perturbations, simply omit the -p flag. The script fetches its settings from the configuration file located at test-configs/bfgs.yml, which specifies which dataset to use.

The command to execute the script is:

python worker.py --name group-C --opt_key bfgs -p

RL model

To run the dataset without perturbations, use the following command. The script fetches its settings from the configuration file located at test-configs/rl.yml, which specifies which dataset to employ.

The command is as follows:

python worker.py --name group-C --opt_key rl

Comparison

After collecting the data, we can compare the performance of different optimizers by running the following script.

python compare.py

Evaluation with e-Baker dataset

cd e-Baker-Evaluation
python main.py

rl-molecular-geometry-optimizer-with-chemical-information's People

Contributors

littlemoonstones avatar

Stargazers

 avatar DICP_Zhou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.