[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-txie-93--cgcnn":3,"similar-txie-93--cgcnn":88},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":18,"owner_location":19,"owner_email":20,"owner_twitter":21,"owner_website":22,"owner_url":23,"languages":24,"stars":29,"forks":30,"last_commit_at":31,"license":32,"difficulty_score":33,"env_os":34,"env_gpu":35,"env_ram":36,"env_deps":37,"category_tags":44,"github_topics":20,"view_count":47,"oss_zip_url":20,"oss_zip_packed_at":20,"status":48,"created_at":49,"updated_at":50,"faqs":51,"releases":87},1341,"txie-93\u002Fcgcnn","cgcnn","Crystal graph convolutional neural networks for predicting material properties.","cgcnn 是一套基于“晶体图卷积神经网络”的开源框架，专门用来“读”晶体结构、“猜”材料性能。它把原子排布和化学键信息自动转成图数据，用深度学习模型一次性预测带隙、弹性模量、形成能等关键指标，省去了传统第一性原理计算的大量时间和算力。  \n适合两类人：  \n1) 材料\u002F化学研究者——只需准备 CIF 结构文件和少量实验或计算标签，就能训练自己的高精度模型；  \n2) 开发者——可加载官方预训练权重，对新晶体批量打分，快速筛选潜在功能材料。  \n亮点在于把晶体学知识与图神经网络无缝结合，模型可解释性强，且支持 PyTorch 生态，安装一条 conda 命令即可上手。","# Crystal Graph Convolutional Neural Networks\n\nThis software package implements the Crystal Graph Convolutional Neural Networks (CGCNN) that takes an arbitary crystal structure to predict material properties. \n\nThe package provides two major functions:\n\n- Train a CGCNN model with a customized dataset.\n- Predict material properties of new crystals with a pre-trained CGCNN model.\n\nThe following paper describes the details of the CGCNN framework:\n\n[Crystal Graph Convolutional Neural Networks for an Accurate and Interpretable Prediction of Material Properties](https:\u002F\u002Flink.aps.org\u002Fdoi\u002F10.1103\u002FPhysRevLett.120.145301)\n\n## Table of Contents\n\n- [How to cite](#how-to-cite)\n- [Prerequisites](#prerequisites)\n- [Usage](#usage)\n  - [Define a customized dataset](#define-a-customized-dataset)\n  - [Train a CGCNN model](#train-a-cgcnn-model)\n  - [Predict material properties with a pre-trained CGCNN model](#predict-material-properties-with-a-pre-trained-cgcnn-model)\n- [Data](#data)\n- [Authors](#authors)\n- [License](#license)\n\n## How to cite\n\nPlease cite the following work if you want to use CGCNN.\n\n```\n@article{PhysRevLett.120.145301,\n  title = {Crystal Graph Convolutional Neural Networks for an Accurate and Interpretable Prediction of Material Properties},\n  author = {Xie, Tian and Grossman, Jeffrey C.},\n  journal = {Phys. Rev. Lett.},\n  volume = {120},\n  issue = {14},\n  pages = {145301},\n  numpages = {6},\n  year = {2018},\n  month = {Apr},\n  publisher = {American Physical Society},\n  doi = {10.1103\u002FPhysRevLett.120.145301},\n  url = {https:\u002F\u002Flink.aps.org\u002Fdoi\u002F10.1103\u002FPhysRevLett.120.145301}\n}\n```\n\n##  Prerequisites\n\nThis package requires:\n\n- [PyTorch](http:\u002F\u002Fpytorch.org)\n- [scikit-learn](http:\u002F\u002Fscikit-learn.org\u002Fstable\u002F)\n- [pymatgen](http:\u002F\u002Fpymatgen.org)\n\nIf you are new to Python, the easiest way of installing the prerequisites is via [conda](https:\u002F\u002Fconda.io\u002Fdocs\u002Findex.html). After installing [conda](http:\u002F\u002Fconda.pydata.org\u002F), run the following command to create a new [environment](https:\u002F\u002Fconda.io\u002Fdocs\u002Fuser-guide\u002Ftasks\u002Fmanage-environments.html) named `cgcnn` and install all prerequisites:\n\n```bash\nconda upgrade conda\nconda create -n cgcnn python=3 scikit-learn pytorch torchvision pymatgen -c pytorch -c conda-forge\n```\n\n*Note: this code is tested for PyTorch v1.0.0+ and is not compatible with versions below v0.4.0 due to some breaking changes.\n\nThis creates a conda environment for running CGCNN. Before using CGCNN, activate the environment by:\n\n```bash\nsource activate cgcnn\n```\n\nThen, in directory `cgcnn`, you can test if all the prerequisites are installed properly by running:\n\n```bash\npython main.py -h\npython predict.py -h\n```\n\nThis should display the help messages for `main.py` and `predict.py`. If you find no error messages, it means that the prerequisites are installed properly.\n\nAfter you finished using CGCNN, exit the environment by:\n\n```bash\nsource deactivate\n```\n\n## Usage\n\n### Define a customized dataset \n\nTo input crystal structures to CGCNN, you will need to define a customized dataset. Note that this is required for both training and predicting. \n\nBefore defining a customized dataset, you will need:\n\n- [CIF](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCrystallographic_Information_File) files recording the structure of the crystals that you are interested in\n- The target properties for each crystal (not needed for predicting, but you need to put some random numbers in `id_prop.csv`)\n\nYou can create a customized dataset by creating a directory `root_dir` with the following files: \n\n1. `id_prop.csv`: a [CSV](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FComma-separated_values) file with two columns. The first column recodes a unique `ID` for each crystal, and the second column recodes the value of target property. If you want to predict material properties with `predict.py`, you can put any number in the second column. (The second column is still needed.)\n\n2. `atom_init.json`: a [JSON](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FJSON) file that stores the initialization vector for each element. An example of `atom_init.json` is `data\u002Fsample-regression\u002Fatom_init.json`, which should be good for most applications.\n\n3. `ID.cif`: a [CIF](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCrystallographic_Information_File) file that recodes the crystal structure, where `ID` is the unique `ID` for the crystal.\n\nThe structure of the `root_dir` should be:\n\n```\nroot_dir\n├── id_prop.csv\n├── atom_init.json\n├── id0.cif\n├── id1.cif\n├── ...\n```\n\nThere are two examples of customized datasets in the repository: `data\u002Fsample-regression` for regression and `data\u002Fsample-classification` for classification. \n\n**For advanced PyTorch users**\n\nThe above method of creating a customized dataset uses the `CIFData` class in `cgcnn.data`. If you want a more flexible way to input crystal structures, PyTorch has a great [Tutorial](http:\u002F\u002Fpytorch.org\u002Ftutorials\u002Fbeginner\u002Fdata_loading_tutorial.html#sphx-glr-beginner-data-loading-tutorial-py) for writing your own dataset class.\n\n### Train a CGCNN model\n\nBefore training a new CGCNN model, you will need to:\n\n- [Define a customized dataset](#define-a-customized-dataset) at `root_dir` to store the structure-property relations of interest.\n\nThen, in directory `cgcnn`, you can train a CGCNN model for your customized dataset by:\n\n```bash\npython main.py root_dir\n```\n\nYou can set the number of training, validation, and test data with labels `--train-size`, `--val-size`, and `--test-size`. Alternatively, you may use the flags `--train-ratio`, `--val-ratio`, `--test-ratio` instead. Note that the ratio flags cannot be used with the size flags simultaneously. For instance, `data\u002Fsample-regression` has 10 data points in total. You can train a model by:\n\n```bash\npython main.py --train-size 6 --val-size 2 --test-size 2 data\u002Fsample-regression\n```\nor alternatively\n```bash\npython main.py --train-ratio 0.6 --val-ratio 0.2 --test-ratio 0.2 data\u002Fsample-regression\n```\n\nYou can also train a classification model with label `--task classification`. For instance, you can use `data\u002Fsample-classification` by:\n\n```bash\npython main.py --task classification --train-size 5 --val-size 2 --test-size 3 data\u002Fsample-classification\n```\n\nAfter training, you will get three files in `cgcnn` directory.\n\n- `model_best.pth.tar`: stores the CGCNN model with the best validation accuracy.\n- `checkpoint.pth.tar`: stores the CGCNN model at the last epoch.\n- `test_results.csv`: stores the `ID`, target value, and predicted value for each crystal in test set.\n\n### Predict material properties with a pre-trained CGCNN model\n\nBefore predicting the material properties, you will need to:\n\n- [Define a customized dataset](#define-a-customized-dataset) at `root_dir` for all the crystal structures that you want to predict.\n- Obtain a [pre-trained CGCNN model](pre-trained) named `pre-trained.pth.tar`.\n\nThen, in directory `cgcnn`, you can predict the properties of the crystals in `root_dir`:\n\n```bash\npython predict.py pre-trained.pth.tar root_dir\n```\n\nFor instace, you can predict the formation energies of the crystals in `data\u002Fsample-regression`:\n\n```bash\npython predict.py pre-trained\u002Fformation-energy-per-atom.pth.tar data\u002Fsample-regression\n```\n\nAnd you can also predict if the crystals in `data\u002Fsample-classification` are metal (1) or semiconductors (0):\n\n```bash\npython predict.py pre-trained\u002Fsemi-metal-classification.pth.tar data\u002Fsample-classification\n```\n\nNote that for classification, the predicted values in `test_results.csv` is a probability between 0 and 1 that the crystal can be classified as 1 (metal in the above example).\n\nAfter predicting, you will get one file in `cgcnn` directory:\n\n- `test_results.csv`: stores the `ID`, target value, and predicted value for each crystal in test set. Here the target value is just any number that you set while defining the dataset in `id_prop.csv`, which is not important.\n\n## Data\n\nTo reproduce our paper, you can download the corresponding datasets following the [instruction](data\u002Fmaterial-data).\n\n## Authors\n\nThis software was primarily written by [Tian Xie](http:\u002F\u002Ftxie.me) who was advised by [Prof. Jeffrey Grossman](https:\u002F\u002Fdmse.mit.edu\u002Ffaculty\u002Fprofile\u002Fgrossman). \n\n## License\n\nCGCNN is released under the MIT License.\n\n\n\n","# 晶体图卷积神经网络\n\n本软件包实现了晶体图卷积神经网络（CGCNN），该网络能够以任意晶体结构为输入，预测材料性质。\n\n该软件包提供两大功能：\n\n- 使用自定义数据集训练CGCNN模型。\n- 使用预训练的CGCNN模型预测新晶体的材料性质。\n\n以下论文详细介绍了CGCNN框架：\n\n[用于准确且可解释的材料性质预测的晶体图卷积神经网络](https:\u002F\u002Flink.aps.org\u002Fdoi\u002F10.1103\u002FPhysRevLett.120.145301)\n\n## 目录\n\n- [如何引用](#how-to-cite)\n- [先决条件](#prerequisites)\n- [使用方法](#usage)\n  - [定义自定义数据集](#define-a-customized-dataset)\n  - [训练CGCNN模型](#train-a-cgcnn-model)\n  - [使用预训练的CGCNN模型预测材料性质](#predict-material-properties-with-a-pre-trained-cgcnn-model)\n- [数据](#data)\n- [作者](#authors)\n- [许可证](#license)\n\n## 如何引用\n\n如需使用CGCNN，请引用以下文献：\n\n```\n@article{PhysRevLett.120.145301,\n  title = {用于准确且可解释的材料性质预测的晶体图卷积神经网络},\n  author = {Xie, Tian 和 Grossman, Jeffrey C.},\n  journal = {Phys. Rev. Lett.},\n  volume = {120},\n  issue = {14},\n  pages = {145301},\n  numpages = {6},\n  year = {2018},\n  month = {Apr},\n  publisher = {美国物理学会},\n  doi = {10.1103\u002FPhysRevLett.120.145301},\n  url = {https:\u002F\u002Flink.aps.org\u002Fdoi\u002F10.1103\u002FPhysRevLett.120.145301}\n}\n```\n\n## 先决条件\n\n本软件包需要以下依赖：\n\n- [PyTorch](http:\u002F\u002Fpytorch.org)\n- [scikit-learn](http:\u002F\u002Fscikit-learn.org\u002Fstable\u002F)\n- [pymatgen](http:\u002F\u002Fpymatgen.org)\n\n如果您是Python新手，安装这些先决条件最简单的方式是通过[conda](https:\u002F\u002Fconda.io\u002Fdocs\u002Findex.html)。安装[conda](http:\u002F\u002Fconda.pydata.org\u002F)后，运行以下命令创建一个名为`cgcnn`的新[环境](https:\u002F\u002Fconda.io\u002Fdocs\u002Fuser-guide\u002Ftasks\u002Fmanage-environments.html)，并安装所有先决条件：\n\n```bash\nconda upgrade conda\nconda create -n cgcnn python=3 scikit-learn pytorch torchvision pymatgen -c pytorch -c conda-forge\n```\n\n*注：此代码已在PyTorch v1.0.0及以上版本上测试通过，由于一些破坏性更改，不兼容v0.4.0以下的版本。\n\n这将创建一个用于运行CGCNN的conda环境。在使用CGCNN之前，通过以下命令激活该环境：\n\n```bash\nsource activate cgcnn\n```\n\n然后，在`cgcnn`目录下，您可以通过运行以下命令来测试所有先决条件是否已正确安装：\n\n```bash\npython main.py -h\npython predict.py -h\n```\n\n这应显示`main.py`和`predict.py`的帮助信息。如果没有错误信息，则说明先决条件已正确安装。\n\n使用完CGCNN后，通过以下命令退出环境：\n\n```bash\nsource deactivate\n```\n\n## 使用方法\n\n### 定义自定义数据集\n\n要将晶体结构输入CGCNN，您需要定义一个自定义数据集。请注意，无论是训练还是预测，都必须定义自定义数据集。\n\n在定义自定义数据集之前，您需要：\n\n- [CIF](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCrystallographic_Information_File)文件，记录您感兴趣的晶体结构。\n- 每个晶体的目标属性（仅在预测时不需要，但您仍需在`id_prop.csv`中填入一些随机数）。\n\n您可以通过创建一个名为`root_dir`的目录来构建自定义数据集，其中包含以下文件：\n\n1. `id_prop.csv`：一个[CSV](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FComma-separated_values)文件，包含两列。第一列记录每个晶体的唯一`ID`，第二列记录目标属性的值。如果您想用`predict.py`预测材料性质，可以在第二列中填入任意数字。（第二列仍然是必需的。）\n\n2. `atom_init.json`：一个[JSON](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FJSON)文件，存储每种元素的初始化向量。`atom_init.json`的一个示例是`data\u002Fsample-regression\u002Fatom_init.json`，对于大多数应用来说应该足够。\n\n3. `ID.cif`：一个[CIF](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCrystallographic_Information_File)文件，记录晶体结构，其中`ID`是该晶体的唯一`ID`。\n\n`root_dir`的结构应如下：\n\n```\nroot_dir\n├── id_prop.csv\n├── atom_init.json\n├── id0.cif\n├── id1.cif\n├── ...\n```\n\n仓库中提供了两个自定义数据集的示例：`data\u002Fsample-regression`用于回归任务，`data\u002Fsample-classification`用于分类任务。\n\n**面向高级PyTorch用户**\n\n上述创建自定义数据集的方法使用了`cgcnn.data`中的`CIFData`类。如果您希望以更灵活的方式输入晶体结构，PyTorch有一个很好的[教程](http:\u002F\u002Fpytorch.org\u002Ftutorials\u002Fbeginner\u002Fdata_loading_tutorial.html#sphx-glr-beginner-data-loading-tutorial-py)，教您如何编写自己的数据集类。\n\n### 训练CGCNN模型\n\n在训练新的CGCNN模型之前，您需要：\n\n- 在`root_dir`中定义自定义数据集，以存储您感兴趣的结构-属性关系。\n\n然后，在`cgcnn`目录下，您可以使用以下命令为您的自定义数据集训练CGCNN模型：\n\n```bash\npython main.py root_dir\n```\n\n您可以通过`--train-size`、`--val-size`和`--test-size`设置训练、验证和测试数据的数量。或者，您也可以使用`--train-ratio`、`--val-ratio`和`--test-ratio`标志。请注意，比率标志不能与大小标志同时使用。例如，`data\u002Fsample-regression`共有10个数据点。您可以按以下方式训练模型：\n\n```bash\npython main.py --train-size 6 --val-size 2 --test-size 2 data\u002Fsample-regression\n```\n或者：\n```bash\npython main.py --train-ratio 0.6 --val-ratio 0.2 --test-ratio 0.2 data\u002Fsample-regression\n```\n\n您还可以通过`--task classification`标志训练分类模型。例如，您可以使用`data\u002Fsample-classification`进行训练：\n\n```bash\npython main.py --task classification --train-size 5 --val-size 2 --test-size 3 data\u002Fsample-classification\n```\n\n训练完成后，您将在`cgcnn`目录下获得三个文件：\n\n- `model_best.pth.tar`：存储具有最佳验证准确率的CGCNN模型。\n- `checkpoint.pth.tar`：存储最后一个epoch的CGCNN模型。\n- `test_results.csv`：存储测试集中每个晶体的`ID`、目标值和预测值。\n\n### 使用预训练的 CGCNN 模型预测材料性质\n\n在开始预测材料性质之前，您需要：\n\n- 在 `root_dir` 目录下[定义一个自定义数据集](#define-a-customized-dataset)，用于存放所有您希望进行预测的晶体结构。\n- 获取一个名为 `pre-trained.pth.tar` 的[预训练 CGCNN 模型](pre-trained)。\n\n随后，在 `cgcnn` 目录下，您可以对 `root_dir` 中的晶体进行性质预测：\n\n```bash\npython predict.py pre-trained.pth.tar root_dir\n```\n\n例如，您可以预测 `data\u002Fsample-regression` 目录中晶体的形成能：\n\n```bash\npython predict.py pre-trained\u002Fformation-energy-per-atom.pth.tar data\u002Fsample-regression\n```\n\n此外，您还可以预测 `data\u002Fsample-classification` 目录中的晶体是金属（1）还是半导体（0）：\n\n```bash\npython predict.py pre-trained\u002Fsemi-metal-classification.pth.tar data\u002Fsample-classification\n```\n\n需要注意的是，对于分类任务，`test_results.csv` 文件中的预测值是一个介于 0 和 1 之间的概率，表示该晶体被分类为 1（即金属，如上述示例）的可能性。\n\n预测完成后，您将在 `cgcnn` 目录下得到一个文件：\n\n- `test_results.csv`：存储测试集中每种晶体的 `ID`、目标值和预测值。其中，目标值只是您在 `id_prop.csv` 文件中定义数据集时设定的任意数值，与实际意义无关。\n\n## 数据\n\n为了复现我们的论文，您可以按照[说明](data\u002Fmaterial-data)下载相应的数据集。\n\n## 作者\n\n本软件主要由 [Tian Xie](http:\u002F\u002Ftxie.me) 编写，并在 [Jeffrey Grossman 教授](https:\u002F\u002Fdmse.mit.edu\u002Ffaculty\u002Fprofile\u002Fgrossman) 的指导下完成。\n\n## 许可证\n\nCGCNN 采用 MIT 许可证发布。","# CGCNN 快速上手指南\n\n## 环境准备\n- 操作系统：Linux \u002F macOS \u002F Windows（推荐 Linux）\n- Python ≥ 3.6\n- PyTorch ≥ 1.0.0（不支持 0.4.0 以下版本）\n- 依赖包：scikit-learn、pymatgen\n\n## 安装步骤\n1. 安装 conda（国内用户可用清华镜像：https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Fanaconda\u002Fminiconda\u002F）\n2. 创建并激活环境\n```bash\nconda upgrade conda\nconda create -n cgcnn python=3 scikit-learn pytorch torchvision pymatgen -c pytorch -c conda-forge\nsource activate cgcnn   # Windows 用 `conda activate cgcnn`\n```\n3. 验证安装\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn.git\ncd cgcnn\npython main.py -h\npython predict.py -h\n```\n无报错即安装成功。\n\n## 基本使用\n### 1. 准备数据集\n在任意目录（如 `mydata`）创建以下文件：\n```\nmydata\n├── id_prop.csv      # 两列：ID, 目标值（预测时可填 0）\n├── atom_init.json   # 元素初始化向量，可直接复制 data\u002Fsample-regression\u002Fatom_init.json\n├── 10001.cif        # 晶体结构文件，文件名与 id_prop.csv 第一列对应\n├── 10002.cif\n└── ...\n```\n\n### 2. 训练模型（回归示例）\n```bash\npython main.py --train-ratio 0.7 --val-ratio 0.1 --test-ratio 0.2 mydata\n```\n训练完成后得到：\n- `model_best.pth.tar`：验证集最佳模型\n- `test_results.csv`：测试集预测结果\n\n### 3. 使用预训练模型预测\n```bash\n# 下载官方预训练模型到 pre-trained 目录\npython predict.py pre-trained\u002Fformation-energy-per-atom.pth.tar mydata\n```\n输出 `test_results.csv` 包含预测值。","某新能源电池初创公司正为下一代高能量密度固态电解质筛选候选材料，团队由 2 名计算材料博士和 3 名实验工程师组成，需在 3 个月内锁定 5 种可合成且离子电导率 >10 mS cm⁻¹ 的晶体。\n\n### 没有 cgcnn 时\n- 博士们先手动整理 3000 条文献数据，再用 VASP 对 200 个结构做第一性原理计算，单点能量跑一次 48 h，GPU 排队 2 周，仅完成 40 个结构就花掉 1 个月。  \n- 实验组拿到 40 个预测值后，发现其中 28 个因合成温度过高被工艺否决，重新筛选又得回到原点。  \n- 由于无法提前评估晶格稳定性，最终烧出的 5 个样品里 3 个在 200 °C 就相变，项目进度被迫延期 6 周。  \n- 预算告急：云计算账单 8 万元，实验耗材 5 万元，仍没拿到一条能用的电解质配方。\n\n### 使用 cgcnn 后\n- 用 cgcnn 预训练模型一次性对 12 000 个 ICSD 晶体做离子电导率预测，10 分钟出结果，直接筛出 150 个候选，计算成本 0 元。  \n- 把公司过去 3 年的实验数据（300 条）喂给 cgcnn 微调，2 小时得到专属模型，再预测合成温度与相稳定性，进一步缩小到 30 个“可合成”结构。  \n- 实验组按优先级烧结前 5 个样品，其中 4 个在 300 °C 下保持立方相，离子电导率实测 12–15 mS cm⁻¹，全部满足指标。  \n- 项目在第 10 周就锁定最终配方，整体研发成本降到 1.2 万元（仅实验耗材），团队提前把原型电池送到车企测试。\n\ncgcnn 让“算得起”与“做得出”第一次在同一条时间线上对齐，把材料试错从月级压缩到小时级。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftxie-93_cgcnn_00fc3130.png","txie-93","Tian Xie","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftxie-93_887eb741.png","Researcher at Microsoft Research working on ML for materials discovery","Microsoft","Cambridge, United Kingdom",null,"xie_tian","txie.me","https:\u002F\u002Fgithub.com\u002Ftxie-93",[25],{"name":26,"color":27,"percentage":28},"Python","#3572A5",100,847,355,"2026-04-09T08:41:20","MIT",2,"Linux, macOS, Windows","未说明（PyTorch 支持 CPU 与 GPU，若用 GPU 需 CUDA 兼容显卡）","未说明",{"notes":38,"python":39,"dependencies":40},"推荐使用 conda 创建独立环境；示例命令默认安装 CPU 版 PyTorch，如需 GPU 版请手动指定 cudatoolkit；代码不兼容 PyTorch 0.4.0 以下版本","3",[41,42,43],"torch>=1.0.0","scikit-learn","pymatgen",[45,46],"开发框架","其他",3,"ready","2026-03-27T02:49:30.150509","2026-04-11T16:58:00.295779",[52,57,62,67,72,77,82],{"id":53,"question_zh":54,"answer_zh":55,"source_url":56},6123,"运行 README 中的预测示例时报错 “IndexError: invalid index of a 0-dim tensor” 怎么办？","该错误是由于 PyTorch 1.0 之后移除了 `volatile=True` 以及 `loss.data[0]` 的写法导致的。官方已合并修复 PR，请同步到最新代码即可解决。","https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn\u002Fissues\u002F9",{"id":58,"question_zh":59,"answer_zh":60,"source_url":61},6124,"用预训练模型预测示例数据得到的 MAE 很大，是哪里做错了？","示例目录 `data\u002Fsample-regression` 中的 `id_prop.csv` 第二列是随意填写的假值，仅用于演示流程。若需真实评估模型，请准备包含真实物性（如形成能、带隙等）的数据集，并替换对应列。","https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn\u002Fissues\u002F13",{"id":63,"question_zh":64,"answer_zh":65,"source_url":66},6125,"训练体模量\u002F剪切模量时 MAE 高达 100 以上，如何降低？","官方实现中对体模量、剪切模量取的是 log10(GPa)。若直接使用原始 GPa 值而不取对数，会导致数值范围过大、MAE 极高。请在数据预处理阶段对目标值取 log10 后再训练。","https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn\u002Fissues\u002F43",{"id":68,"question_zh":69,"answer_zh":70,"source_url":71},6126,"如何把 CGCNN 安装成 Python 包供 matminer 等库调用？","两种常用方式：\n1. 将仓库路径加入 PYTHONPATH：\n   ```bash\n   export PYTHONPATH=\u002Fpath\u002Fto\u002Fcgcnn:$PYTHONPATH\n   ```\n2. 参考 #4 中的做法，自行编写 `setup.py` 实现 pip 安装。\n若不想通过命令行传参，可把 `main.py` 中的参数解析改为：\n   ```python\n   args, unknown = parser.parse_known_args()\n   ```\n即可在脚本内直接调用。","https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn\u002Fissues\u002F12",{"id":73,"question_zh":74,"answer_zh":75,"source_url":76},6127,"`id_prop.csv` 中的 target 列到底是什么？","target 列即你希望模型预测的物性值。示例文件中的 1.0、2.0…10.0 只是随意填写的玩具数据。真实任务中应填入对应晶体结构的实际物性（如形成能、带隙、体模量等）。","https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn\u002Fissues\u002F24",{"id":78,"question_zh":79,"answer_zh":80,"source_url":81},6128,"体模量\u002F剪切模量出现负值时如何处理？","根据热力学要求，体模量与剪切模量不应为负。官方做法是在数据清洗阶段直接剔除所有出现负值的晶体，仅保留正值后再取 log10。","https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn\u002Fissues\u002F19",{"id":83,"question_zh":84,"answer_zh":85,"source_url":86},6129,"如何自己构建与官方一致的 MP 数据集（mp-ids-27430、46744 等）？","1. 在 Materials Project 注册账号获取 API_KEY。\n2. 使用 pymatgen 的 MPRester 批量查询：\n   ```python\n   from pymatgen.ext.matproj import MPRester\n   with MPRester(\"API_KEY\") as m:\n       results = m.query(criteria={'material_id': 'mp-1234'},\n                         properties=['formation_energy_per_atom', 'structure'])\n   ```\n3. 过滤掉计算警告标记的晶体（ill-converged crystals），并对带隙任务只保留具有完整能带结构的条目即可复现官方数据集。","https:\u002F\u002Fgithub.com\u002Ftxie-93\u002Fcgcnn\u002Fissues\u002F15",[],[89,100,108,117,125,134],{"id":90,"name":91,"github_repo":92,"description_zh":93,"stars":94,"difficulty_score":47,"last_commit_at":95,"category_tags":96,"status":48},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,"2026-04-06T06:32:30",[97,45,98,99],"Agent","图像","数据工具",{"id":101,"name":102,"github_repo":103,"description_zh":104,"stars":105,"difficulty_score":47,"last_commit_at":106,"category_tags":107,"status":48},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[45,98,97],{"id":109,"name":110,"github_repo":111,"description_zh":112,"stars":113,"difficulty_score":33,"last_commit_at":114,"category_tags":115,"status":48},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150037,"2026-04-10T23:33:47",[45,97,116],"语言模型",{"id":118,"name":119,"github_repo":120,"description_zh":121,"stars":122,"difficulty_score":33,"last_commit_at":123,"category_tags":124,"status":48},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[45,98,97],{"id":126,"name":127,"github_repo":128,"description_zh":129,"stars":130,"difficulty_score":33,"last_commit_at":131,"category_tags":132,"status":48},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[133,97,98,45],"插件",{"id":135,"name":136,"github_repo":137,"description_zh":138,"stars":139,"difficulty_score":33,"last_commit_at":140,"category_tags":141,"status":48},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[133,45]]