GithubHelp home page GithubHelp logo

zxycxj / helmholtz-fno Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tfp-photonics/neurop_invdes

0.0 0.0 0.0 41 KB

Neural operator surrogates for electromagnetic inverse design

License: MIT License

Shell 11.26% Python 88.74%

helmholtz-fno's Introduction

Surrogate solvers for electromagnetic field inference and inverse design

This repository contains code for the paper "Neural Operator-Based Surrogate Solver for Free-Form Electromagnetic Inverse Design" (ACS Photonics, arXiv).

Installation

To run the code, set up a conda environment from the provided environment file and activate it:

conda env create -f environment.yml -p your_env_prefix
conda activate your_env_prefix

For data generation, use the environment file env_datagen.yml provided here. Note that the environment files specify strict version requirements - this is simply because everything has been tested using those versions. It is likely that everything works fine for different versions (of PyTorch, for instance), but we can make no guarantees.

Usage

We provide the Slurm batch scripts that were used to perform all the computations in the paper here. While these probably won't run on your particular setup without modification, they should provide enough insight on how to use the data generation, training and inverse design scripts.

FNO & UNet training

To train a surrogate solver, use the file train_surrogates.py, see ./train_surrogates.py --help for a list of parameters. In the simplest case, using just the defaults, you can train an FNO-2D model by simply providing a path to the dataset:

python3 train_surrogates.py --data-dir /path/to/data

Note that the dataloaders used here expect the following folder structure:

data
├── train
│   ├── train_data_0.h5
│   ├── train_data_1.h5
│   ├── etc.
└── test
    ├── test_data_0.h5
    ├── test_data_1.h5
    └── etc.

VAE training

The VAE models can be trained using train_vae.py, see ./train_vae.py --help for a list of parameters. You can simply run the file without providing any arguments, which will train a 2D VAE.

Inverse design

For inverse design, use the file inverse_design_3d.py. We do not currently provide an implementation for 2D inverse design, but it should be straightforward to adapt the current 3D implementation. Please note that this file needs pre-trained FNO and VAE models in TorchScript format.

Data availability

The official research data repository is provided by RADAR4KIT at https://doi.org/10.35097/911.

If you have trouble obtaining the data from the official repository, we additionally provide it via OneDrive here.

If you are downloading the dataset from China, you may download from this link as an alternative option.

Reproducibility

To reproduce results from the paper, please use the commit 73e7e19 (tagged publication).

Citing

If you use this code or associated data for your research, please cite:

@article{augenstein2023neural,
  title = {Neural Operator-Based Surrogate Solver for Free-Form Electromagnetic Inverse Design},
  author = {Augenstein, Yannick and Rep\"{a}n, Taavi and Rockstuhl, Carsten},
  year = 2023,
  journal = {ACS Photonics},
  volume = 10,
  number = 5,
  pages = {1547--1557},
  doi = {10.1021/acsphotonics.3c00156}
}

helmholtz-fno's People

Contributors

yaugenst avatar anlijuncn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.