Skip to content

Commit ba4f939

Browse files
Merge branch 'develop' into clean_code
2 parents d5fb64a + baba485 commit ba4f939

File tree

134 files changed

+9632
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+9632
-168
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "competition/IJCAI_2024_CAR"]
2+
path = competition/IJCAI_2024_CAR
3+
url = https://atomgit.com/paddlenumberone/ijcai_car.git

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
[**PaddleScience使用文档**](https://paddlescience-docs.readthedocs.io/zh/latest/)
1515

16+
🔥 [IJCAI 2024: 任意三维几何外形车辆的风阻快速预测竞赛](https://competition.atomgit.com/competitionInfo?id=7f3f276465e9e845fd3a811d2d6925b5),欢迎报名参赛。
17+
1618
<!-- --8<-- [start:description] -->
1719
## 👀简介
1820

@@ -36,6 +38,7 @@ PaddleScience 是一个基于深度学习框架 PaddlePaddle 开发的科学计
3638
| 微分方程 | [分数阶微分方程](https://github.com/PaddlePaddle/PaddleScience/blob/develop/examples/fpde/fractional_poisson_2d.py) | 机理驱动 | MLP | 无监督学习 | - | - |
3739
| 光孤子 | [Optical soliton](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/nlsmb) | 机理驱动 | MLP | 无监督学习 | - | [Paper](https://doi.org/10.1007/s11071-023-08824-w)|
3840
| 光纤怪波 | [Optical rogue wave](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/nlsmb) | 机理驱动 | MLP | 无监督学习 | - | [Paper](https://doi.org/10.1007/s11071-023-08824-w)|
41+
| 相场方程 | [Allen-Cahn](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/allen_cahn) | 机理驱动 | MLP | 无监督学习 | - | |
3942

4043
<br>
4144
<p align="center"><b>技术科学(AI for Technology)</b></p>
@@ -219,9 +222,9 @@ PaddleScience 项目欢迎并依赖开发人员和开源社区中的用户,会
219222
旨在鼓励更多的开发者参与到飞桨科学计算社区的开源建设中,帮助社区修复 bug 或贡献 feature,加入开源、共建飞桨。了解编程基本知识的入门用户即可参与,活动进行中:
220223
[PaddleScience 快乐开源活动表单](https://github.com/PaddlePaddle/PaddleScience/issues/379)
221224

222-
- 🔥第五期黑客松
225+
- 🔥第六期黑客松
223226

224-
面向全球开发者的深度学习领域编程活动,鼓励开发者了解与参与飞桨深度学习开源项目与文心大模型开发实践。活动进行中:[【PaddlePaddle Hackathon 5th】开源贡献个人挑战赛](https://github.com/PaddlePaddle/community/blob/master/hackathon/hackathon_5th/%E3%80%90PaddlePaddle%20Hackathon%205th%E3%80%91%E5%BC%80%E6%BA%90%E8%B4%A1%E7%8C%AE%E4%B8%AA%E4%BA%BA%E6%8C%91%E6%88%98%E8%B5%9B%E7%A7%91%E5%AD%A6%E8%AE%A1%E7%AE%97%E4%BB%BB%E5%8A%A1%E5%90%88%E9%9B%86.md#%E4%BB%BB%E5%8A%A1%E5%BC%80%E5%8F%91%E6%B5%81%E7%A8%8B%E4%B8%8E%E9%AA%8C%E6%94%B6%E6%A0%87%E5%87%86)
227+
面向全球开发者的深度学习领域编程活动,鼓励开发者了解与参与飞桨深度学习开源项目与文心大模型开发实践。活动进行中:[【PaddlePaddle Hackathon 5th】开源贡献个人挑战赛](https://github.com/PaddlePaddle/community/blob/master/hackathon/hackathon_6th/%E3%80%90Hackathon%206th%E3%80%91%E5%BC%80%E6%BA%90%E8%B4%A1%E7%8C%AE%E4%B8%AA%E4%BA%BA%E6%8C%91%E6%88%98%E8%B5%9B%E7%A7%91%E5%AD%A6%E8%AE%A1%E7%AE%97%E4%BB%BB%E5%8A%A1%E5%90%88%E9%9B%86.md)
225228
<!-- --8<-- [end:contribution] -->
226229

227230
<!-- --8<-- [start:collaboration] -->

competition/IJCAI_2024_CAR

Submodule IJCAI_2024_CAR added at 4e12f69

competition/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Competition
2+
3+
This part is for all competitions.
4+
Codes of all competitions are stored by submoudule. If you need to obtain it, please initialize the submoudule after cloning PaddleScience.
5+
6+
When you initialize the submoudule, some competitions need your username and password(or token). You can register on the corresponding official website and then get it, usually in "Settings" - "Create Personal Token".
7+
8+
## submodule initialization
9+
10+
``` sh
11+
# for example IJCAI_2024_CAR
12+
cd PaddleScience
13+
git submodule update --init --recursive competition/IJCAI_2024_CAR
14+
```
15+
16+
## competition list
17+
18+
| competition name | submodule name | competition website | official website |
19+
|-------------|-------------|-------------|-------------|
20+
| IJCAI | IJCAI_2024_CAR | [IJCAI_2024_CAR](https://competition.atomgit.com/competitionInfo?id=7f3f276465e9e845fd3a811d2d6925b5) | [atomgit](https://atomgit.com/) |

deploy/python_infer/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from deploy.python_infer.base import Predictor
16+
from deploy.python_infer.pinn_predictor import PINNPredictor
17+
18+
# alias as PINNPredictor can be used in most cases
19+
GeneralPredictor = PINNPredictor
20+
21+
__all__ = [
22+
"Predictor",
23+
"PINNPredictor",
24+
"GeneralPredictor",
25+
]

deploy/python_infer/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Predictor:
3636
3737
Args:
3838
pdmodel_path (Optional[str]): Path to the PaddlePaddle model file. Defaults to None.
39-
pdpiparams_path (Optional[str]): Path to the PaddlePaddle model parameters file. Defaults to None.
39+
pdiparams_path (Optional[str]): Path to the PaddlePaddle model parameters file. Defaults to None.
4040
device (Literal["gpu", "cpu", "npu", "xpu"], optional): Device to use for inference. Defaults to "cpu".
4141
engine (Literal["native", "tensorrt", "onnx", "mkldnn"], optional): Inference engine to use. Defaults to "native".
4242
precision (Literal["fp32", "fp16", "int8"], optional): Precision to use for inference. Defaults to "fp32".
@@ -51,7 +51,7 @@ class Predictor:
5151
def __init__(
5252
self,
5353
pdmodel_path: Optional[str] = None,
54-
pdpiparams_path: Optional[str] = None,
54+
pdiparams_path: Optional[str] = None,
5555
*,
5656
device: Literal["gpu", "cpu", "npu", "xpu"] = "cpu",
5757
engine: Literal["native", "tensorrt", "onnx", "mkldnn"] = "native",
@@ -65,7 +65,7 @@ def __init__(
6565
num_cpu_threads: int = 10,
6666
):
6767
self.pdmodel_path = pdmodel_path
68-
self.pdpiparams_path = pdpiparams_path
68+
self.pdiparams_path = pdiparams_path
6969

7070
self._check_device(device)
7171
self.device = device
@@ -104,13 +104,13 @@ def _create_paddle_predictor(
104104
f"Given 'pdmodel_path': {self.pdmodel_path} does not exist. "
105105
"Please check if it is correct."
106106
)
107-
if not osp.exists(self.pdpiparams_path):
107+
if not osp.exists(self.pdiparams_path):
108108
raise FileNotFoundError(
109-
f"Given 'pdpiparams_path': {self.pdpiparams_path} does not exist. "
109+
f"Given 'pdiparams_path': {self.pdiparams_path} does not exist. "
110110
"Please check if it is correct."
111111
)
112112

113-
config = paddle_inference.Config(self.pdmodel_path, self.pdpiparams_path)
113+
config = paddle_inference.Config(self.pdmodel_path, self.pdiparams_path)
114114
if self.device == "gpu":
115115
config.enable_use_gpu(self.gpu_mem, self.gpu_id)
116116
if self.engine == "tensorrt":

deploy/python_infer/pinn_predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
):
3939
super().__init__(
4040
cfg.INFER.pdmodel_path,
41-
cfg.INFER.pdpiparams_path,
41+
cfg.INFER.pdiparams_path,
4242
device=cfg.INFER.device,
4343
engine=cfg.INFER.engine,
4444
precision=cfg.INFER.precision,

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
./README.md:status
55
--8<--
66

7+
🔥 [IJCAI 2024: 任意三维几何外形车辆的风阻快速预测竞赛](https://competition.atomgit.com/competitionInfo?id=7f3f276465e9e845fd3a811d2d6925b5),欢迎报名参赛。
8+
79
<style>
810
.container {
911
display: flex;
@@ -81,6 +83,7 @@
8183
| 微分方程 | [分数阶微分方程](https://github.com/PaddlePaddle/PaddleScience/blob/develop/examples/fpde/fractional_poisson_2d.py) | 机理驱动 | MLP | 无监督学习 | - | - |
8284
| 光孤子 | [Optical soliton](./zh/examples/nlsmb.md) | 机理驱动 | MLP | 无监督学习 | - | [Paper](https://doi.org/10.1007/s11071-023-08824-w)|
8385
| 光纤怪波 | [Optical rogue wave](./zh/examples/nlsmb.md) | 机理驱动 | MLP | 无监督学习 | - | [Paper](https://doi.org/10.1007/s11071-023-08824-w)|
86+
| 相场方程 | [Allen-Cahn](./zh/examples/allen_cahn.md) | 机理驱动 | MLP | 无监督学习 | - | |
8487

8588
<br>
8689
<p align="center"><b>技术科学(AI for Technology)</b></p>

docs/zh/api/arch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
- DGMR
2828
- ChipDeepONets
2929
- AutoEncoder
30+
- CuboidTransformer
3031
show_root_heading: true
3132
heading_level: 3

docs/zh/api/depoly/python_infer.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Python_infer(Python 推理) 模块
2+
3+
::: deploy.python_infer
4+
handler: python
5+
options:
6+
members:
7+
- Predictor
8+
- GeneralPredictor
9+
- PINNPredictor
10+
show_root_heading: true
11+
heading_level: 3

0 commit comments

Comments
 (0)