Skip to content

cfschwahn/NN-for-PhCW

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Neural Networks for Photonic Crystal Waveguides

Repository for summer project that followed on from my MPhys final year project Designing Photonic Crystal Waveguides Using Neural Networks (June 2022) supervised by Dr Sebastian Schulz at the University of St Andrews.

Description of Code

Dataset Generation

simulations: cluster_generate.py uniformly samples the 7d design space and simulates the band structures of photonic crystal waveguides using MIT Photonic Bands. Simulations are either 3D or 2D approximations using the effective period method depending on the chosen control file simulations/MPB-control. As simulations are time consuming (taking minutes to several hours), they were run on the Kennedy High Performance Computing Cluster in batches. The corresponding SLURM jobs are in 2D-jobs and 3D-jobs.

preprocessing: merge_csvs.py combines the output of batches of simulations into a single csv. prepare_training_sets.py rescales features to the range $[0,1]$ and creates training, validation and test sets in the ratio 70:15:15.

Neural Network Tuning

NN-tuning: Neural Networks were built using Keras and trained and evaluated with cluster_train.py. Hyperparameters were set in SLURM jobs with the best performing hyperparameters for the 2D and 3D datasets being 2D-jobs/tune-7.job and 3D-jobs/tune-1.job, respectively.

Transfer Learning

transfer-learning: The best 2D NN served as a pretrained model for the 3D dataset and this "transfer learning" process was done using transfer_learning.py.

Neural Network Evaluation

learning-curve: To assess the impact of training set size on NN performance, a learning curve was constructed. NNs were trained and tested using learning-curve.py on subsets of varying size in a number of jobs learning-curve-jobs.

NN-speed-test Measures the inference speed of trained NN.

Related Projects

This project followed Anson Ho's undergraduate disseration which aimed to predict figures of merit instead of band structures.

About

Predicting photonic crystal waveguide bands using neural networks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published