Skip to content

Repository files navigation

ActiveDiff

hydra Copier

Experiment on image generation for nanophotonics by active search with diffusion model. The objective is to generate splitters designs with performance evaluated with EM solver Meep. An initial training set was generated generated with the EM solver and gradient methods. The Active Search generation is then performed in these steps: For num_epochs:

  1. Train a diffusion model on the training data.
  2. Generate new samples.
  3. Discard samples that satisfy sample_distance_to_training_set < distance_threshold.
  4. Discard samples that satisfy sample_fom < fom_threshold.
  5. For each pair of the remaining samples, discard one of the two samples if sample_distance_to_each_other < distance_threshold.
  6. Add the selected samples to the training ser.

The point of step 3 is to prevent the addition of new samples that are too similar to the initial training set to ensure a growing diversity in the data generation. After only 2 epochs, the process discovers samples that are

Installation

Pymeep is needed and is only available by compilation or via conda-forge. The following steps will install pymeep and the rest of the venv.

conda create -n mp -c conda-forge pymeep
uv venv --system-site-packages
source .venv/bin/activate
uv sync --extra dev
mkdir data
wget -O data/nanophotodata.zip --no-check-certificate -r 'https://drive.google.com/uc?export=download&id=1oRCZmrC0aGuYBmA2VRkR9rROH-XtWnd8'
unzip data/nanophotodata.zip -d data

Or just run

install.sh

Usage

. .venv/bin/activate
python reg_transfo/main.py --help

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages