-
Notifications
You must be signed in to change notification settings - Fork 223
PBDL model for 物理感知神经网络流固耦合计算加速方法研究-王兆坤 #1137
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
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
examples/PBDL/forceInfo.csv
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
def main(OUTPUT_DIR): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! The main(OUTPUT_DIR) function is intended to be used later. I’ll keep it and add at least a pass statement to avoid syntax issues. Implementation is coming soon.
for i, (x1_batch, x2_batch, y_batch) in enumerate(train_loader): | ||
x1_batch, x2_batch, y_batch = ( | ||
x1_batch.to(device), | ||
x2_batch.to(device), | ||
y_batch.to(device), | ||
) | ||
break | ||
for i, (x1_test, x2_test, y_test) in enumerate(test_loader): | ||
x1_test, x2_test, y_test = ( | ||
x1_test.to(device), | ||
x2_test.to(device), | ||
y_test.to(device), | ||
) | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两段for循环的作用是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两段 for 循环的作用是提取训练集和测试集中的第一个batch 数据,并将其移动到对应的计算设备(如 GPU 或 CPU)。其中的 break 语句用于确保循环只执行一次,防止遍历完整个数据集。主要用途是用于调试或验证数据加载过程是否正确。如果后续进入正式训练阶段,这两个 break 语句是可以删除的,从而让训练/测试完整遍历整个数据集。
examples/PBDL/ibm.py
Outdated
np.linalg.norm(test_prediction - test_target) | ||
/ np.linalg.norm(test_target) | ||
) | ||
with open(f"{OUTPUT_DIR}/TestingLoss_L2.dat", "a") as file2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文件路径请使用os.path.join来拼接
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢提醒!我会将相关路径拼接方式统一改为 os.path.join(OUTPUT_DIR, ...) 的形式。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
输出的日志不用上传
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是测试过程中实时监测的Loss文件,我们会在后续提交中将它们移除。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
输出的日志不用上传
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是训练过程中监测的Loss文件,我们会在后续提交中将它们移除。
examples/PBDL/output/checkpoint.pth
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请转换成.pdparams
格式的文件
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
examples/PBDL/output/loss.dat
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
输出的日志不用上传
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
examples/PBDL/output/nohup.out
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
输出的日志不用上传
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 这个文件和checkpoint.pth有什么区别,如果是重复的文件,可以删除,否则请转换成
.pdparams
格式的文件
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢您的提醒!这两个文件的主要区别如下:
1)checkpoint.pth:保存的是训练过程中的中间权重,同时还包含了优化器状态、当前轮次、loss 等信息,方便训练中断后继续训练(resume training)。
2)trained_model.pth:保存了最终的模型参数,用于推理或测试阶段的加载。
delete TestingLoss_L2.dat
delete TrainingLoss_L2.dat
PR types
New Features
PR changes
Others.
Add an example about PBDL model used in '物理感知神经网络流固耦合计算加速方法研究'
Describe
This is the physics-based deep learning model to predict body force used in immerse boundary method. It can accelerate the traditional LBM calculation by this rapid predicted body force.