Yingtong Hu 04e391ee4d | 1 year ago | |
---|---|---|
.. | ||
scripts | 2 years ago | |
src | 2 years ago | |
README.md | 3 months ago | |
README_CN.md | 3 months ago | |
eval.py | 2 years ago | |
train.py | 2 years ago |
The conventional electromagnetic simulation method is based on finite element method or finite difference method, which requires a lot of iterative calculation, leads to a long time of calculation and cannot meet the requirements of modern product design for simulation efficiency. The AI method directly obtains electromagnetic field distribution through end-to-end simulation calculation, skipping iterative calculation, greatly improving the simulation speed and shortening the product R&D period.
Generate electromagnetic field inputs data based on Point Cloud Data Generation and Point Cloud Data Compression, and then call src/inputs_process.py
to bind the inputs with coordinates and source location information. The abel needs to be generated by using commercial simulation software or a finite difference time domain algorithm, and then src/label_process.py
is called to obtain the final label. The mobile phone data used in the training and evaluation process involves commercial secrets, so it cannot be displayed to the outside. You can use the src/sample.py
script to generate random data for model function verification.
After installing MindSpore Elec, you can perform the following training and evaluation steps:
# Example of Training Process
bash run_train.sh [DATASET_PATH]
# Example of Evaluation Process
bash run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]
.
└─full_em
├─README.md
├─scripts
├──run_train.sh # Start Ascend training.
├──run_eval.sh # Start Ascend evaluation.
├─src
├──input_process.py # Pre-processes of the training input
├──label_process.py # Pre-processes of the training label.
├──config.py # Parameter configuration
├──dataset.py # Dataset configuration
├──loss.py # Loss function
├──maxwell_model.py # Electromagnetic simulation model of point cloud data
├──train.py #Training network
├──eval.py #Evaluate the network
You can configure training parameters in the src/config.py file.
"epochs": 500, # Training epoch numbers
"batch_size": 8, # Batch size of input tensor
"lr": 0.00001, # Init value of learning rate
"t_solution": 162, # Time axis resolution
"x_solution": 50, # Spatial X-axis resolution
"y_solution": 50, # Spatial Y-axis resolution
"z_solution": 8, # Spatial Z-axis resolution
"save_checkpoint_epochs": 5, # Checkpoint Save Interval
"keep_checkpoint_max": 20 # Maximum number of saved checkpoints
bash run_train.sh [DATASET_PATH]
Set the following script parameter:
DATASET_PATH
: path of the training dataThe training result will be stored in the train
folder in the current path. You can find the checkpoint file and the result in the log.
Check the checkpoint path used for evaluation before running the following command. Set the checkpoint path to an absolute path, for example, username/train/ckpt/Maxwell3d-5_1275.ckpt
.
bash run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]
Set the following script parameters:
DATASET_PATH
: path of the evaluation datasetCHECKPOINT_PATH
: absolute path of the checkpoint fileCheckpoints are generated during training.
The evaluation result will be stored in the eval
folder in the example path. You can find the following results in the log:
test_res: l2_error: 0.9250676897
The seed of the "create_dataset" function is set in dataset.py, and the random seed in train.py is also used.
Visit the official website home page.
MindScience is scientific computing kits for various industries based on the converged MindSpore framework.
Jupyter Notebook Python Unity3D Asset Pickle nesC other
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》