Open
Conversation
|
Thanks for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增 MatInvent
1. 概述
本 PR 新增 MatInvent 模块,将原 PyTorch 版本的晶体材料生成框架迁移至 PaddleMaterials。
2. 主要改动
新增模型模块
ppmat/models/matinvent/- MatInvent 实现rl/- 强化学习核心(采样器、训练工具、模型套件)rewards/- 奖励系统及性质计算器(PyMatGen),其他的奖励机制部分不适用memory/- 回放缓冲区与长期记忆模块支持的骨干网络
配置文件
structure_generation/configs/matinvent/- 两种骨干网络的训练配置测试文件
test/matinvent/- Paddle 与 PyTorch 输出对齐测试3. 使用方法
1. RL
2. 采样
对于 DiffCSP 骨干网络,只需将配置文件替换为
matinvent_diffcsp.yaml。4. 预训练权重
一般不需要单独手动下载,运行测试脚本
test/matinvent/matinvent_test.py会自动下载。如果确实网络原因,手动下载,如下:在 AI Studio 上可下载:https://aistudio.baidu.com/modelsdetail/44805/space paddle版本的模型。或者通过 http下载: wget https://paddle-org.bj.bcebos.com/paddlematerials/checkpoints/structure_generation/MatInvert/matinvent_diffcsp_mp20.pdparams
wget https://paddle-org.bj.bcebos.com/paddlematerials/checkpoints/structure_generation/MatInvert/matinvent_mattergen_mp20.pdparams ;下载之后不需要重命名
原版的模型在HuggingFace 上,需要自己解决 export HF_ENDPOINT=https://hf-mirror.com 的问题,地址:diffcsp.ckpt 来自 https://huggingface.co/jwchen25/MatInvent/diffcsp_mp20/last.ckp mattergen.ckpt 来自 https://huggingface.co/jwchen25/MatInvent/mattergen_base/last.ckpt ; 下载之后重命名为 raw-diffcsp.ckpt 和 raw-mattergen.ckpt
下载好的权重放在 ~/.paddlemat/weights/matinvent 目录下即可
5. 测试结果
测试脚本:
test/matinvent/matinvent_test.py测试说明:
test/matinvent/README.md特别说明:因为 MatInvent 原版代码硬编码了噪声发生器的代码,而且无法通过配置修改。只能进行了monkey patch,patch住了噪声发生器。否则对齐测试无法完成。
详细结果
diffcsp
mattergen
rl
matinvent