【Hackathon 10th Spring No.9】NewtonNet 复现#262
Open
co63oc wants to merge 4 commits intoPaddlePaddle:developfrom
Open
【Hackathon 10th Spring No.9】NewtonNet 复现#262co63oc wants to merge 4 commits intoPaddlePaddle:developfrom
co63oc wants to merge 4 commits intoPaddlePaddle:developfrom
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.
PaddlePaddle/Paddle#77429
NewtonNet 复现
torch版本
https://github.com/co63oc/NewtonNet/tree/fix1 fix1分支
修改主要为配置修改,输出日志信息,保存权重,转换权重为paddle
配置修改训练批次大小50
转换权重脚本 https://github.com/co63oc/NewtonNet/blob/fix1/scripts/convert_paddle.py
运行脚本
运行输出日志
https://github.com/co63oc/NewtonNet/blob/fix1/scripts/torch_newtonnet.log
当前PR 为paddle版本,需要安装paddle_geometric,paddle_scatter
配置文件 interatomic_potentials/configs/newtonnet/newtonnet.yaml
权重 interatomic_potentials/configs/newtonnet/newtonnet.pdparams,只是用来加载和torch一致的初始化参数,不是训练的结果权重
训练时需要使用数据集计算 stats_calc 更新权重,增加pretrained_need_update_by_train_loader配置,加载数据集后更新权重
增加 clip_grad 配置项,前向计算时需要修改模型参数
模型增加精度配置 precision,用来修改模型精度,修改模型精度时需要修改数据集精度,删除已有数据集 interatomic_potentials/example_data/aspirin/ccsd_train/processed/data.pt 运行后会重新生成
运行脚本
运行日志 https://github.com/co63oc/NewtonNet/blob/fix1/scripts/paddle_newtonnet.log
测试加载相同初始化参数,使用相同数据集按顺序读取训练,训练两轮以上loss一致,因为使用较多scatter计算,训练轮次逐渐增加时会增加浮点误差
torch
paddle
增加 paddle_save_fix,修改 paddle.save 调用会有权重丢失问题,复制权重后保存