This is the codebase for building the custom dataset used for the study presented in the publication, Time-series neural networks to predict electromagnetic wave propagation.
A library of 3x3 pillar radii between 75 nm and 250 nm is generated using generate_radii.py. This generates a file called neighbors_library_allrandom.pkl
. This file stores a numpy array with len(5000). Each index contains a list of 9 radii.
Running main.py allows the user to either generate data or reduce the data into volumes, as presented in the paper linked above.
-
Generate data. To run a single simulation:
- Set the config file parameter,
task
to 0. - Create an instance of the Docker image, v3_lightning.
- From
/develop/code/3x3_metasurface
, run:mpirun --allow-run-as-root -np {num_cpu_cores} python3 main.py -config configs/config.yaml -idx {neighbors library index}
- Set the config file parameter,
-
Reduce data.
- Set the config file parameter,
task
to 0. - Running the same Docker container in (1), from
/develop/code/3x3_metasurface
, run:python3 reduce_data.py
- Set the config file parameter,
- Generate data. To launch many simulations:
- Set the config file parameters.
task
: 0deployment_mode
: 1kube.datagen_job.num_sims
: 1500kube.datagen_job.start_group_id
: 0kube.datagen_job.num_parallel_ops
: {your preference}
- Running an instance of the Docker image, kubernetes launcher, navigate to
kubernetes/gen_data/
and runpython3 launch_jobs.py
- Reduce data.
- Set the config file parameters.
task
: 1deployment_mode
: 1
- From
kubernetes/reduce_data
, run:python3 launch_jobs.py