optorch: An Open-Source PyTorch Framework for Diffractive Deep Neural Networks
optorch is an open-source Python framework for simulating, training, and deploying Diffractive Deep Neural Networks (D2NNs). Unlike conventional neural networks that rely on electronic matrix multiplication, optical neural networks compute through the physical diffraction of light, enabling ultra-low-latency and energy-efficient AI inference. Built on the Angular Spectrum Method, optorch provides fully differentiable light propagation simulation in a PyTorch-native workflow. A 3-layer D2NN trained with optorch achieves 89.79% MNIST test accuracy using only 2,352 learnable parameters, training in approximately 2 minutes on a standard CPU — within 2% of the original 2018 MIT Science paper while using 340× fewer parameters. optorch is the first pip-installable, PyTorch-native open-source framework for optical neural networks. GitHub: optorch on GitHub
Authors
- Hrishikesh Rajulu
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-05-22
- DOI
- https://doi.org/10.5281/zenodo.20344997
- Primary Topic
- Neural Networks and Reservoir Computing
- Type
- preprint