-
Notifications
You must be signed in to change notification settings - Fork 187
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 8th No.11】DrivAerNet++ 论文复现 #1062
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
@HydrogenSulfate @wangguan1995 麻烦两位飞桨导师检查下该PR。 |
|
||
DrivAerNet++: A Large-Scale Multimodal Car Dataset with Computational Fluid Dynamics Simulations and Deep Learning Benchmarks(DrivAerNet++:一个包含计算流体力学模拟和深度学习基准的大规模多模态汽车数据集) | ||
|
||
## 论文信息: |
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.
已删除
|
||
DrivAerNet++ 提供了一个用于汽车空气动力学性能预测的多模态数据集,任务目标是基于输入数据预测汽车的空气阻力系数($C_d$)。 | ||
|
||
##### 输入 : |
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.
已删除
|
||
|
||
def train(cfg: DictConfig): | ||
|
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.
已删除
"input_keys": ("vertices",), | ||
"label_keys": ("cd_value",), | ||
"weight_keys": ("weight_keys",), |
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.
请实用cfg的配置
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.
不太懂这里的意思
哦字打错了,是“使用”,就是这里不要用hard code的字符串,而是用cfg的属性
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.
已解决
"input_keys": ("vertices",), | ||
"label_keys": ("cd_value",), | ||
"weight_keys": ("weight_keys",), |
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.
已解决
ppsci/arch/regpointnet.py
Outdated
Initialize the RegPointNet model for regression tasks with enhanced complexity, | ||
including additional layers and residual connections. | ||
|
||
Parameters: |
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.
- docstring和现有代码保持一致,用Args而不是Parameters
- __init__的docstring移动到类下方
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.
已修改
ppsci/arch/regpointnet.py
Outdated
""" | ||
Forward pass of the network. | ||
|
||
Parameters: |
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.
已修改
ppsci/arch/regpointnet.py
Outdated
x (Tensor): Input tensor of shape (batch_size, 3, num_points). | ||
|
||
Returns: | ||
Tensor: Output tensor of the predicted scalar value. |
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.
返回值类型请写完整,paddle.Tensor
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.
ok
normalized_data = (data - mean_vals) / std_vals | ||
return normalized_data | ||
|
||
def mean_normalize(self, data: paddle.Tensor) -> paddle.Tensor: |
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.
已删除
normalized_data = (data - min_vals) / (max_vals - min_vals) | ||
return normalized_data | ||
|
||
def z_score_normalize(self, data: paddle.Tensor) -> paddle.Tensor: |
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.
已删除
@LilaKen 有时间可以参考review建议,修改一下 |
@LilaKen commit时还麻烦再解决一下冲突 |
已解决 |
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.
ppsci/arch/regpointnet.py
Outdated
Returns: | ||
paddle.Tensor: Output tensor of the predicted scalar value. |
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.
- 返回值类型不对
- forward缺少type hint
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.
已修改
ppsci/arch/regpointnet.py
Outdated
Forward pass of the network. | ||
|
||
Args: | ||
x (Tensor): Input tensor of shape (batch_size, 3, num_points). |
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.
paddle.Tensor
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.
已修改
f"Error loading point cloud from {load_path}: {e}" | ||
) from e | ||
|
||
def __getitem__(self, idx: int, apply_augmentations: bool = True): |
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.
apply_augmentations这个参数没用到
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.
已删除
apply_augmentations (bool, optional): Whether to apply data augmentations. Defaults to True. | ||
|
||
Returns: | ||
Tuple[paddle.Tensor, paddle.Tensor]: The sample (point cloud) and its label (Cd value). |
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.
修改为Tuple[Dict[str, np.ndarray], Dict[str, np.ndarray], Dict[str, np.ndarray]]:
2. **批次大小的影响**: | ||
- 如果使用不同的批次大小(batch size),R² 的结果可能会显著不同。例如,较小的批次可能会导致更大的方差,从而影响 R² 的计算。因此,基于批次的 R² 计算结果依赖于批次大小的选择,缺乏稳定性。 | ||
|
||
```python |
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.
python和
python格式化后还是```python
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.
整个文档是否能用 vscode 的markdown插件格式化一下?
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.
已格式化
self.subset_indices = self.data_frame[ | ||
self.data_frame["Design"].isin(subset_ids) | ||
].index.tolist() | ||
self.data_frame = self.data_frame.loc[self.subset_indices].reset_index( | ||
drop=True | ||
) |
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.
同,除打开文件外的操作请不要放到try内
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.
ok
mkdocs.yml
Outdated
@@ -76,6 +76,8 @@ nav: | |||
- tempoGAN: zh/examples/tempoGAN.md | |||
- NSFNet4: zh/examples/nsfnet4.md | |||
- ViV: zh/examples/viv.md | |||
- DrivAerNet: zh/examples/drivaernet.md |
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.
- DrivAerNet在69行已经有了
- DrivAerNetPlusPlus可以移动到70行
@LilaKen 有时间麻烦再改一下 |
好的,可能需要过几天,手头上导师有些事情,我处理完把这个处理好,顺便也把DrivAerNet的重新pr更新一遍。 |
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.
收到
ppsci/arch/regpointnet.py
Outdated
# Ensure x is in the shape (bs, C, L) | ||
if len(x.shape) != 3: | ||
raise ValueError( | ||
f"Input tensor should have shape (batch_size, C, L), but got {x.shape}" | ||
) | ||
|
||
# Initialize an empty list to store the processed samples | ||
processed_samples = [] | ||
|
||
# Apply data augmentation and normalization for each sample in the batch | ||
augmentation = DataAugmentation() | ||
for i in range(bs): | ||
sample = x[i].numpy() # Convert to numpy array for data augmentation | ||
sample = augmentation.translate_pointcloud(sample) | ||
sample = augmentation.jitter_pointcloud(sample) | ||
sample = self.min_max_normalize(sample) | ||
processed_samples.append(sample) | ||
|
||
# Stack the processed samples back into a batch tensor | ||
x_processed = paddle.to_tensor(np.stack(processed_samples, axis=0)) | ||
|
||
# Ensure the processed tensor has the same shape as the original input | ||
if x_processed.shape != x.shape: | ||
raise ValueError( | ||
f"Processed tensor shape {x_processed.shape} does not match original input shape {x.shape}" | ||
) |
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.
不好意思,之前找复现bug的时候挪动了一下,已经重新调回数据集加载py文件中。
Co-authored-by: HydrogenSulfate <[email protected]>
Co-authored-by: HydrogenSulfate <[email protected]>
Co-authored-by: HydrogenSulfate <[email protected]>
```python | ||
# 源代码DeepSurrogates/train_RegPointNet.py中的R²计算 |
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.
这个代码块不需要整体缩进4个空格吧?
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.
已取消缩进
4. 启动 Globus Connect 个人版。由于第一次运行,因此必须先完成设置,然后才能运行完整的应用程序。 | ||
|
||
```sh | ||
$ ./globusconnectpersonal |
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.
sh命令里的美元符号建议删掉,全文检查一下
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.
已删除
## 2. 问题定义 | ||
|
||
#### 2.1 数据集呈现 |
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.
已修改
|
||
为了预测汽车的空气阻力系数 ($C_d$),本研究采用基于深度学习的回归方法,使用两种点云处理模型 **RegDGCNN** 和 **RegPointNet**,分别从输入数据中提取几何特征并完成回归任务。这些模型能够高效处理 3D 点云数据,并结合设计参数,构建端到端的预测框架。 | ||
|
||
##### **1. RegDGCNN** |
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. RegDGCNN** | |
1. RegDGCNN |
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.
已修改
Co-authored-by: HydrogenSulfate <[email protected]>
PR types
Others
PR changes
APIs、Docs
Describe
本PR的目标是复现RegPointNet网络,将DrivAerNet++处理成ppsci版API,并且加入对应的文档说明。
论文信息
现结果