Experimental

PhotonLayer trains a multi plane optical front end end to end

PhotonLayer is a deterministic optical AI front end in pure Rust, where a learned phase mask compresses light before any electronics are involved. A June 18 commit trained a multi plane diffractive cascade end to end.

GitHub activity: · Published:

What PhotonLayer is

A camera turns light into numbers and then a model does all the work. PhotonLayer asks whether some of that work can happen in the light itself: a learned phase mask shapes the incoming wavefront so that by the time a sensor reads it, the useful structure is already compressed.

It is written in pure Rust and is deterministic, which is what makes it testable rather than merely theoretical.

What changed

Commit 6204e1c trained a multi plane diffractive cascade end to end rather than optimising a single plane, and commit aae6a82 de-risked initialisation with a small sigma cascade start.

The same day brought a runnable practical to exotic examples ladder and a plain language introduction for non specialists, which is unusual and welcome for optics code.

Get started

A Rust toolchain and a checkout. The hello example is the fastest way in:

cargo run --release --example hello_optics -p photonlayer-core

Expected result: the optical simulation runs and prints its output, with no optical hardware required.

The MNIST benchmarks exercise the trained cascade:

cargo test -p photonlayer-bench --release --test mnist_cascade_bench

No documented MCP server. The supported surface is the Rust workspace, its examples and its benches.

Use it today

Practical case: evaluating whether an optical front end could cut sensing power on an edge device. Input is your classification task. Workflow is run the gradient and cascade benches, compare against an all electronic baseline. Output is a simulated accuracy and compression figure.

Acceptance test: run the cascade bench twice and confirm identical results. The project's determinism claim should hold.

Push it further

Experimental commentary. The far end of this is inference that consumes almost no electrical power because most of the computation happened in free space on the way to the sensor.

Limitation: everything here is simulation. Fabricated masks introduce alignment and tolerance errors the model does not account for. Falsifiable test: perturb the learned phase mask by a realistic fabrication error and measure how far accuracy falls.

Read the original on GitHub commit

Commit 6204e1c — multi-plane diffractive cascade trained end to end

PhotonLayer repository

Back to the newsroom