Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon 5th No.56】A Physics-Informed Neural Network to solve 2D steady-state heat equation #560

Merged
merged 11 commits into from
Oct 24, 2023

Conversation

Gxinhu
Copy link
Contributor

@Gxinhu Gxinhu commented Oct 6, 2023

PR types

ohters

others

PR changes

others

Describe

PaddlePaddle/Paddle#57262

Result

原始

  • MSE loss 0.019
  • PINN结果与FDM结果 MSE loss 0.0015

复现

  • MSE loss 0.011
  • PINN结果与FDM结果 MSE loss 0.0013
...
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 986/1000][Avg] loss: 0.01095, EQ: 0.00166, BC_top: 0.00329, BC_bottom: 0.00133, BC_left: 0.00253, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 987/1000][Iter: 1/1] lr: 0.00050, loss: 0.01095, EQ: 0.00166, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1204959.66319 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 987/1000][Avg] loss: 0.01095, EQ: 0.00166, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 988/1000][Iter: 1/1] lr: 0.00050, loss: 0.01095, EQ: 0.00166, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00253, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205027.41716 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 988/1000][Avg] loss: 0.01095, EQ: 0.00166, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00253, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 989/1000][Iter: 1/1] lr: 0.00050, loss: 0.01094, EQ: 0.00166, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205147.48129 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 989/1000][Avg] loss: 0.01094, EQ: 0.00166, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 990/1000][Iter: 1/1] lr: 0.00050, loss: 0.01094, EQ: 0.00165, BC_top: 0.00328, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205186.26048 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 990/1000][Avg] loss: 0.01094, EQ: 0.00165, BC_top: 0.00328, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 991/1000][Iter: 1/1] lr: 0.00050, loss: 0.01093, EQ: 0.00165, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205214.21870 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 991/1000][Avg] loss: 0.01093, EQ: 0.00165, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 992/1000][Iter: 1/1] lr: 0.00050, loss: 0.01093, EQ: 0.00165, BC_top: 0.00328, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205184.68439 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 992/1000][Avg] loss: 0.01093, EQ: 0.00165, BC_top: 0.00328, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 993/1000][Iter: 1/1] lr: 0.00050, loss: 0.01093, EQ: 0.00165, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00253, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205198.02212 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 993/1000][Avg] loss: 0.01093, EQ: 0.00165, BC_top: 0.00329, BC_bottom: 0.00132, BC_left: 0.00253, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 994/1000][Iter: 1/1] lr: 0.00050, loss: 0.01092, EQ: 0.00164, BC_top: 0.00328, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205170.49793 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 994/1000][Avg] loss: 0.01092, EQ: 0.00164, BC_top: 0.00328, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 995/1000][Iter: 1/1] lr: 0.00050, loss: 0.01092, EQ: 0.00164, BC_top: 0.00329, BC_bottom: 0.00131, BC_left: 0.00254, BC_right: 0.00213, batch_cost: 0.00822s, reader_cost: 0.00001s, ips: 1205182.53995 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 995/1000][Avg] loss: 0.01092, EQ: 0.00164, BC_top: 0.00329, BC_bottom: 0.00131, BC_left: 0.00254, BC_right: 0.00213
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 996/1000][Iter: 1/1] lr: 0.00050, loss: 0.01091, EQ: 0.00164, BC_top: 0.00327, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214, batch_cost: 0.00821s, reader_cost: 0.00001s, ips: 1205277.54479 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 996/1000][Avg] loss: 0.01091, EQ: 0.00164, BC_top: 0.00327, BC_bottom: 0.00132, BC_left: 0.00254, BC_right: 0.00214
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 997/1000][Iter: 1/1] lr: 0.00050, loss: 0.01091, EQ: 0.00164, BC_top: 0.00329, BC_bottom: 0.00131, BC_left: 0.00254, BC_right: 0.00213, batch_cost: 0.00821s, reader_cost: 0.00001s, ips: 1205395.96890 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 997/1000][Avg] loss: 0.01091, EQ: 0.00164, BC_top: 0.00329, BC_bottom: 0.00131, BC_left: 0.00254, BC_right: 0.00213
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 998/1000][Iter: 1/1] lr: 0.00050, loss: 0.01091, EQ: 0.00163, BC_top: 0.00327, BC_bottom: 0.00132, BC_left: 0.00253, BC_right: 0.00215, batch_cost: 0.00821s, reader_cost: 0.00001s, ips: 1205466.82007 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 998/1000][Avg] loss: 0.01091, EQ: 0.00163, BC_top: 0.00327, BC_bottom: 0.00132, BC_left: 0.00253, BC_right: 0.00215
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 999/1000][Iter: 1/1] lr: 0.00050, loss: 0.01091, EQ: 0.00163, BC_top: 0.00330, BC_bottom: 0.00130, BC_left: 0.00254, BC_right: 0.00213, batch_cost: 0.00821s, reader_cost: 0.00001s, ips: 1205457.18673 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 999/1000][Avg] loss: 0.01091, EQ: 0.00163, BC_top: 0.00330, BC_bottom: 0.00130, BC_left: 0.00254, BC_right: 0.00213
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 1000/1000][Iter: 1/1] lr: 0.00050, loss: 0.01091, EQ: 0.00163, BC_top: 0.00326, BC_bottom: 0.00133, BC_left: 0.00253, BC_right: 0.00215, batch_cost: 0.00821s, reader_cost: 0.00001s, ips: 1205472.65255 samples/s, eta: 0:00:00
[2023/10/06 12:43:12] ppsci INFO: [Train][Epoch 1000/1000][Avg] loss: 0.01091, EQ: 0.00163, BC_top: 0.00326, BC_bottom: 0.00133, BC_left: 0.00253, BC_right: 0.00215
[2023/10/06 12:43:12] ppsci MESSAGE: Finish saving checkpoint to ./output_heat2d/checkpoints/latest
[2023/10/06 12:43:21] ppsci INFO: The norm MSE loss between the FDM and PINN is 0.0013017447935409518

@paddle-bot
Copy link

paddle-bot bot commented Oct 6, 2023

Thanks for your contribution!

@Gxinhu Gxinhu force-pushed the heat_pinn branch 2 times, most recently from 7aff7f8 to 722ab8b Compare October 6, 2023 12:57
@luotao1
Copy link
Collaborator

luotao1 commented Oct 9, 2023

开发之前请撰写 RFC 文档:PaddleSciece RFC 文档

@Gxinhu
Copy link
Contributor Author

Gxinhu commented Oct 9, 2023

开发之前请撰写 RFC 文档:PaddleSciece RFC 文档

已补交RFC

jointContribution/Heat_PINN/README.md Outdated Show resolved Hide resolved
jointContribution/Heat_PINN/main.py Outdated Show resolved Hide resolved
jointContribution/Heat_PINN/main.py Outdated Show resolved Hide resolved
jointContribution/Heat_PINN/main.py Outdated Show resolved Hide resolved
jointContribution/Heat_PINN/main.py Outdated Show resolved Hide resolved
- Moved the folder to the 'examples' directory for better organization.
- Renamed the file to 'heat_pinn' for consistency.
- Added documentation for 'heat_pinn'.
- Resolved post-processing issue.
@@ -0,0 +1,196 @@
# Heat_PINN

<a href="https://aistudio.baidu.com/aistudio/projectdetail/6184070?contributionType=1&sUid=438690&shared=1&ts=1684239806160" class="md-button md-button--primary" style>AI Studio快速体验</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个[AI Studio快速体验]并不是该案例,可以先不写

docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
mkdocs.yml Outdated
@@ -39,6 +39,7 @@ nav:
- 方程求解:
- Volterra_IDE: zh/examples/volterra_ide.md
- Laplace2D: zh/examples/laplace2d.md
- Heat_PINN: zh/examples/heat_pinn.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以新增一个传热目录,将该案例放在传热目录下

Gxinhu and others added 2 commits October 23, 2023 13:59
Co-authored-by: liaoxin2 <136409501+liaoxin2@users.noreply.github.com>
- Introduce a new folder for related documents.
- Eliminate unnecessary images.
- Enhance result.
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
Gxinhu and others added 3 commits October 24, 2023 16:25
Co-authored-by: liaoxin2 <136409501+liaoxin2@users.noreply.github.com>
@Gxinhu Gxinhu requested a review from liaoxin2 October 24, 2023 08:50
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
docs/zh/examples/heat_pinn.md Outdated Show resolved Hide resolved
@Gxinhu Gxinhu requested a review from liaoxin2 October 24, 2023 09:28
Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output_heat2d下的权重已经上传好了,所以output_heat2d文件夹可以删掉了。辛苦删除一下。其他的没什么大问题

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HydrogenSulfate HydrogenSulfate merged commit c1c70b3 into PaddlePaddle:develop Oct 24, 2023
1 check passed
@luotao1
Copy link
Collaborator

luotao1 commented Nov 2, 2023

hi, @Gxinhu

  • 非常感谢你对飞桨框架的贡献,我们正在运营一个PFCC组织,会通过定期分享技术知识与发布开发者主导任务的形式持续为飞桨框架做贡献,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 ext_paddle_oss@baidu.com,我们会邀请你加入~

@luotao1
Copy link
Collaborator

luotao1 commented Dec 26, 2023

hi, @Gxinhu

huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
…eady-state heat equation (PaddlePaddle#560)

* Add Heat PINN

* Following the suggestion
- Moved the folder to the 'examples' directory for better organization.
- Renamed the file to 'heat_pinn' for consistency.
- Added documentation for 'heat_pinn'.
- Resolved post-processing issue.

* Fix typos

Co-authored-by: liaoxin2 <136409501+liaoxin2@users.noreply.github.com>

* Refine documentation for Heat PINN:

- Introduce a new folder for related documents.
- Eliminate unnecessary images.
- Enhance result.

* Apply suggestions from code review

Co-authored-by: liaoxin2 <136409501+liaoxin2@users.noreply.github.com>

* Fix typos

* Add Paddle licenses

* Fix doc number error

* Delete output folder

---------

Co-authored-by: liaoxin2 <136409501+liaoxin2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants