cli-anything-unimol-tools
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUni-Mol Tools - Molecular Property Prediction CLI
Uni-Mol Tools - 分子属性预测CLI工具
Package:
Command:
cli-anything-unimol-toolspython3 -m cli_anything.unimol_toolsPackage:
Command:
cli-anything-unimol-toolspython3 -m cli_anything.unimol_toolsDescription
说明
Interactive CLI for training and inference of molecular property prediction models using Uni-Mol Tools. Supports 5 task types: binary classification, regression, multiclass, multilabel classification, and multilabel regression.
用于使用Uni-Mol Tools进行分子属性预测模型训练与推理的交互式CLI工具。支持5种任务类型:二分类、回归、多分类、多标签分类和多标签回归。
Key Features
核心特性
- Project Management: Organize experiments with named projects
- 5 Task Types: Classification, regression, multiclass, multilabel variants
- Model Tracking: Automatic performance history and rankings
- Smart Storage: Analyze usage and clean up underperformers
- JSON API: Full automation support with flag
--json
- 项目管理:使用命名项目组织实验
- 5种任务类型:分类、回归、多分类、多标签变体
- 模型追踪:自动记录性能历史与排名
- 智能存储:分析存储使用情况并清理性能不佳的模型
- JSON API:通过标志支持完全自动化
--json
Common Commands
常用命令
Project Management
项目管理
bash
undefinedbash
undefinedCreate a new project
创建新项目
project create --name drug_discovery
project create --name drug_discovery
List all projects
列出所有项目
project list
project list
Switch to a project
切换到指定项目
project switch --name drug_discovery
undefinedproject switch --name drug_discovery
undefinedTraining
训练
bash
undefinedbash
undefinedTrain a classification model
训练分类模型
train --data-path train.csv --target-col active --task-type classification --epochs 10
train --data-path train.csv --target-col active --task-type classification --epochs 10
Train a regression model
训练回归模型
train --data-path train.csv --target-col affinity --task-type regression --epochs 10
undefinedtrain --data-path train.csv --target-col affinity --task-type regression --epochs 10
undefinedModel Management
模型管理
bash
undefinedbash
undefinedList all trained models
列出所有已训练模型
models list
models list
Show model details and performance
查看模型详情与性能
models show --model-id <id>
models show --model-id <id>
Rank models by performance
按性能对模型排名
models rank
undefinedmodels rank
undefinedStorage & Cleanup
存储与清理
bash
undefinedbash
undefinedAnalyze storage usage
分析存储使用情况
storage analyze
storage analyze
Automatic cleanup of poor performers
自动清理性能不佳的模型
cleanup auto
cleanup auto
Manual cleanup with criteria
按条件手动清理
cleanup manual --max-models 10 --min-score 0.7
undefinedcleanup manual --max-models 10 --min-score 0.7
undefinedPrediction
预测
bash
undefinedbash
undefinedMake predictions with a trained model
使用已训练模型进行预测
predict --model-id <id> --data-path test.csv
undefinedpredict --model-id <id> --data-path test.csv
undefinedData Format
数据格式
CSV files must contain:
- column: Molecular structures in SMILES format
SMILES - Target column(s): Values to predict (name specified via )
--target-col
Example:
csv
SMILES,target
CCO,1
CCCO,0
CC(C)O,1CSV文件必须包含:
- 列:SMILES格式的分子结构
SMILES - 目标列:待预测的值(通过指定名称)
--target-col
示例:
csv
SMILES,target
CCO,1
CCCO,0
CC(C)O,1Task Types
任务类型
- classification: Binary classification (0/1)
- regression: Continuous value prediction
- multiclass: Multiple class classification
- multilabel_classification: Multiple binary labels
- multilabel_regression: Multiple continuous values
- classification:二分类(0/1)
- regression:连续值预测
- multiclass:多分类
- multilabel_classification:多标签二分类
- multilabel_regression:多标签连续值预测
JSON Mode
JSON模式
Add flag to any command for machine-readable output:
--jsonbash
python3 -m cli_anything.unimol_tools --json models listOutput format:
json
{
"status": "success",
"data": [...],
"message": "..."
}在任意命令后添加标志以获取机器可读输出:
--jsonbash
python3 -m cli_anything.unimol_tools --json models list输出格式:
json
{
"status": "success",
"data": [...],
"message": "..."
}Interactive Mode
交互模式
Launch without commands for interactive REPL:
bash
python3 -m cli_anything.unimol_toolsFeatures:
- Tab completion
- Command history
- Contextual help
- Project state persistence
不添加命令直接启动即可进入交互式REPL:
bash
python3 -m cli_anything.unimol_tools特性:
- 制表符补全
- 命令历史
- 上下文帮助
- 项目状态持久化
Test Data
测试数据
Example datasets available at:
https://github.com/545487677/CLI-Anything-unimol-tools/tree/main/unimol_tools/examples
Includes data for all 5 task types.
示例数据集可在以下地址获取:
https://github.com/545487677/CLI-Anything-unimol-tools/tree/main/unimol_tools/examples
包含适用于所有5种任务类型的数据。
Requirements
环境要求
- Python 3.8+
- PyTorch 1.12+
- Uni-Mol Tools backend
- 4GB+ RAM (8GB+ recommended for training)
- Python 3.8+
- PyTorch 1.12+
- Uni-Mol Tools后端
- 4GB以上内存(训练推荐8GB以上)
Installation
安装方法
bash
cd unimol_tools/agent-harness
pip install -e .bash
cd unimol_tools/agent-harness
pip install -e .Documentation
文档
- SOP: UNIMOL_TOOLS.md
- Quick Start: docs/guides/02-QUICK-START.md
- Full Documentation: docs/README.md
- 标准操作流程:UNIMOL_TOOLS.md
- 快速开始:docs/guides/02-QUICK-START.md
- 完整文档:docs/README.md
Testing
测试
bash
cd docs/test
bash run_tests.sh --unit -v # Unit tests (67 tests)
bash run_tests.sh --full -v # Full test suitebash
cd docs/test
bash run_tests.sh --unit -v # 单元测试(67项测试)
bash run_tests.sh --full -v # 完整测试套件Performance Tips
性能优化建议
- Start with 10 epochs for initial experiments
- Use smaller batch sizes if memory is limited
- Monitor storage with
storage analyze - Use to identify best performers
models rank - Clean up regularly with
cleanup auto
- 初始实验先以10个epoch起步
- 内存有限时使用更小的批次大小
- 使用监控存储情况
storage analyze - 使用识别最优模型
models rank - 定期使用清理模型
cleanup auto
Troubleshooting
故障排查
- CUDA errors: Reduce batch size or use CPU mode
- CSV not recognized: Verify SMILES column exists
- Low accuracy: Try more epochs or adjust learning rate
- Storage full: Run to free space
cleanup auto
- CUDA错误:减小批次大小或切换到CPU模式
- CSV无法识别:确认SMILES列存在
- 准确率低:尝试增加epoch数或调整学习率
- 存储已满:运行释放空间
cleanup auto
Related
相关链接
- Uni-Mol Tools: https://github.com/dptech-corp/Uni-Mol/tree/main/unimol_tools
- Uni-Mol Paper: https://arxiv.org/abs/2209.11126
- CLI-Anything: https://github.com/HKUDS/CLI-Anything
- Uni-Mol Tools:https://github.com/dptech-corp/Uni-Mol/tree/main/unimol_tools
- Uni-Mol论文:https://arxiv.org/abs/2209.11126
- CLI-Anything:https://github.com/HKUDS/CLI-Anything