该项目是《Problem-independent machine learning (PIML)-based topology optimization—A universal approach》的python复现
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
1.7 KiB

> 该项目是《Problem-independent machine learning (PIML)-based topology optimization—A universal approach》的python复现
1 year ago
## 环境依赖
> PyTorch 2.1.0 CUDA 12.1 Ubuntu 20.04 (没有用到新特性,所以应该对旧版本兼容)
```
# matplotlib==3.8.0
# numpy==1.26.2
# scikit_learn==1.3.0
# torch==2.1.0
pip install -r requirements.txt
```
## Usage
TODO: [done] 用argparse模块管理网络参数
1 year ago
### Train
```
python train.py
# --mod [mod1 mod2 mod3] 参数选择训练数据,默认mod1
# e.g. python train.py --mod mod1
```
1 year ago
### Test
```
python test.py
# --mod [mod1 mod2 mod3] 参数选择测试数据,默认mod3
# --pretrained_model_path <xxx_opt.pt> 选择预训练模型,默认./checkpoints/ANN_mod1/ANN_mod1_opt.pt
# e.g. python test.py --mod mod3 --pretrained_model_path ./checkpoints/ANN_mod1/ANN_mod1_opt.pt
```
1 year ago
### TopOpt with EMsFEA net
1 year ago
```
python topopt_EMsFEA.py
# 参数详见options/topopt_options.py
```
1 year ago
## 数据集
> 通过经典二维拓扑优化代码生成的三组形变、密度数据
>
> Download from:
>
> http://118.195.195.192:3000/GyeongYun/EMsFEA-net/raw/branch/resources/datasets.zip
1 year ago
mod1: ![](doc/mod1.jpg)
1 year ago
mod2: ![](doc/mod2.jpg)
1 year ago
mod3: ![](doc/mod3.jpg)
1 year ago
1 year ago
## 项目结构
```
.
|-- README.md
|-- checkpoints
| `-- ...
|-- datasets
| |-- train
| | `--resolution
| | |--u
| | `--xPhys
| |-- test
|-- models
| |-- ANN.py
| |-- AutoEncoder.py
| |-- CNN.py
| `-- __init__.py
|-- options
| |-- __init__.py
| |-- base_options.py
| |-- test_options.py
| `-- train_options.py
|-- requirements.txt
|-- results
|-- test.py
|-- topopt_EMsFEA.py
|-- train.py
|-- utils
| |-- data_loader.py
| |-- data_standardizer.py
| |-- topopt_88.py
| `-- utils.py
`-- visualization.ipynb
1 year ago
```