yqiuu d482651e23 | 1 year ago | |
---|---|---|
possion_2d | 1 year ago | |
README.md | 1 year ago |
本项目采用带3个隐藏层的多层感知器,并带有以下特点:
采用以下激活函数:
f(x) = x exp(-x^2/(2e))
最后一层线性层使用weight normalization。
所有权重都采用mindspore
的HeUniform
初始化。
每层的神经元数目为800, 400, 200,100和1。
本赛题要求在矩形、圆形、三角形和五边形内求解泊松方程。需求的数据为在这些区域内和边界的随机样本。矩形和圆形由mindelec
自带的方法给出。三角形和五边形由本代码库给出。本项目假设所有求解区域都在[0, 1] × [0, 1]内。对于四种几何形状,训练集在区域内和边界上都随机生成10^6个点,测试集在区域内和边界上都随机生成5000个点。
├── possion_2d
│ ├── scripts
│ │ ├── run_eval.sh # 验证脚本
│ │ └── run_train_2d.sh # 训练脚本
│ ├── src
│ │ ├── config
│ │ │ ├── dataset_disk.yml # 圆形数据集配置
│ │ │ ├── dataset_pentagon.yml # 五边形数据集配置
│ │ │ ├── dataset_rectangle.yml # 矩形数据集配置
│ │ │ ├── dataset_triangle.yml # 三角形数据集配置
│ │ │ ├── learning_rate.yml # 学习率配置
│ │ │ └── model_2d.yml # 模型参数配置
│ │ ├── geometry # 求解区域采样方法定义
│ │ │ ├── geometry.py
│ │ │ ├── __init__.py
│ │ │ └── shapes.py
│ │ ├── core.py # 泊松方程定义
│ │ ├── dataset.py # 数据集处理定义
│ │ └── networks.py # 神经网络定义
│ ├── eval.py # 验证精度脚本
│ └── train.py # 训练脚本
└── README.md
mindelec
给出的MTLWeightedLossCell
python train.py DATASET_CONFIG src/config/model_2d.yml --save_dir=SAVE_DIR --n_epoch=XXX
其中,DATASET_CONFIG
为数据集配置文件,可选择的文件在config/文件夹内。SAVE_DIR
为checkpoints保存路径。
在scripts/目录下运行./run_train_2d.sh
来训练所有情况。
在scripts目录下运行./run_eval.sh
。
表格内均为相对L2误差,括号内的是在测试集上的误差。矩形区域的解在边界上均为0,因此没有L2相对误差。
Domain | Boundary | |
---|---|---|
矩形 | 0.04% (0.04%) | NA |
圆形 | 0.05% (0.05%) | 0.22% (0.21%) |
三角形 | 0.10% (0.10%) | 0.38% (0.38%) |
五边形 | 0.08% (0.08%) | 0.29% (0.28%) |
[1] Smith L N , Topin N . Super-Convergence: Very Fast Training of Neural Networks Using Large Learning Rates[J]. 2017.
2022昇腾AI创新大赛昇思赛道 第二批 赛题十三:利用MindSpore实现不同几何边界下的2D Poisson方程求解
Python Shell
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》