How shenwanxiang/acanet works
Project type and purpose
• This is a Python-based open-source machine learning library (“clsar”) for molecular activity prediction, implementing a custom “Activity-Cliff-Aware” loss (ACA-Loss) and a graph-neural-network model (ACANet). It provides both PyTorch and TensorFlow backends, a scikit-learn–style API, command-line entrypoints, and hyperparameter-tuning routines.
File structure
• Top-level packaging/configuration:
• setup.py, MANIFEST.in, requirements.txt, README.md, .github/CI workflows
• Core library module “clsar/”:
• dataset/data.py – data-loading and preprocessing
• feature/featurizer.py – graph conversion and featurization
• model/
– model.py: GNN architecture
– loss.py, loss_tf.py: ACA-Loss implementations (PyTorch & TF)
– train.py: training loop, backprop orchestration
– saver.py: checkpointing and model I/O
• main.py: high-level ACANet class, CLI & API façade
• “experiment/” tree: notebooks, scripts, and results for benchmarking (not part of the runtime library)
README for additional insights
• It describes two main functionalities:
a) ACALoss: enhances metric learning in latent space + regression
b) ACANet: wraps dataset loading, loss hyperparameter tuning (opt_cliff_by_cv, opt_alpha_by_cv), cross-validation, fit, predict
• It shows dependency on external datasets (MPCD) and that the model interfaces like scikit-learn
Diagramming recommendations
• Use clear, concise labels for each module (e.g., “data.py: Data Loader”, “model.py: GNN”)
• Blue for Data/Feature
• Orange for Model/Loss
• Purple for Training/Saving
• Yellow for API/CLI
• Gray for External dependencies & CI/CD