How wangchenghuidream/rnnmgm works
Project Type & Purpose
• This project is centered on developing and training recurrent neural network (RNN) based models for molecular generation.
• It supports both a generative model (CLM_RNN) and a predictive (scorer or regressor) model, with the workflow including data preprocessing, training (with both pretraining and fine-tuning steps), generation of new molecules, and the scoring of generated outputs.
• The README outlines distinct sections for data preprocessing, training (with separate launchers for generation and predictive tasks), generation, and scoring.
File Structure
• Data Directory: Contains various CSV and ZIP files along with README documentation. These represent the datasets that are used for both training the models and generating molecules.
• Model Files: Found under the "models" directory – including clm_rnn.py (likely for generating molecule sequences) and reg_rnn.py (for predictive/regression tasks). This indicates a separation between modules hence designating clear architectural boundaries.
• Launcher Scripts:
• launcher_of_clm.py for operations related to the generative model.
• launcher_of_sm.py for operations related to the predictive scoring model.
• Utility Modules:
• The "utils" directory contains important helper scripts like augmentation (data preprocessing), builder, and tools.
• A dedicated "SA_Score" package under "utils" serves for scoring functions, complete with its own initialization, test, and data files.
• Configs File: A top-level configuration script likely used to centralize parameters across modules.
a. Main Components:
• Data Layer: Represented by the "data" directory, including all raw CSV/ZIP inputs.
• Data Preprocessing Module: Illustrated by the utils/augmentation.py and possibly aspects of the builder and other tools in utils.
• Generative Model (CLM_RNN): Encapsulated by models/clm_rnn.py and launched via launcher_of_clm.py. This should also cover the two-stage training (pretrain and fine-tune) process.
• Predictive/Scoring Model (Reg_RNN): Located in models/reg_rnn.py and launched via launcher_of_sm.py, with close integration to scoring logic from SA_Score.
• Scoring Module: The SA_Score subpackage (within utils), including its scoring functions and unit tests.
• Configuration Module: The configs.py file ensuring centralized parameters and configuration management.
b. Interactions & Data Flow:
• From the Data Layer to the Data Preprocessing Module (augmentation functions and builders).
• From the Preprocessing Module to both the Generative Model (training via launcher_of_clm.py) and Predictive Model (training via launcher_of_sm.py).
• Data flow between the output of pretraining and fine-tuning (as one feeds into the predictive model training, where pretrainer parameters are specified).
• Links between the Predictive Model and the Scoring Module (where score() is triggered).
c. Architectural Patterns & Design Principles:
• Separation of concerns: Distinct modules handle data preprocessing, model training, generation, and scoring.
• Pipeline flow: The architecture is designed as a pipeline – starting with raw data, moving through preprocessing, training, and finally generation/scoring.
• Reusability & Modularity: The use of subdirectories (models, utils with SA_Score subpackage) suggests an emphasis on modularity.
d. Relevant Technologies & Frameworks:
• While not explicitly stated, the naming conventions (RNN, augmentation) imply usage of machine learning libraries (such as PyTorch or TensorFlow) for model training.
• The project may also include traditional Python tools for data handling (pandas, numpy) indicated by CSV usage.
• Clearly denote the custom scoring utilities in SA_Score which appear to be significant.
Elements
• Optionally, add sequence labels to illustrate the training steps (pretrain, fine-tune, generate, and score).