Skip to content

This notebook contains code for the machine learning tasks in the electro-optic activation function paper

License

Notifications You must be signed in to change notification settings

fancompute/electro-optic-activation

Repository files navigation

Electro-optic Activation Function

Overview

This repository contains the notebooks for training optical neural networks (ONNs) with the electro-optic activation function proposed in:

The code for generating the main results of the above paper are provided in the Jupyter notebooks in this repository. See the section below for more details on each of the notebooks. Please consider citing the above paper if you use any of the code in this repository.

Contents

  • study_characterization.ipynb - Activation function characterization results (some of the initial figures in the paper).
  • study_xor.ipynb - Training results for the XOR logic function task (results in Fig. 5 of the paper). Note: this uses the neuroptica ONN simulator framework.
  • study_mnist.ipynb - Training results for the MNIST image recognition task (results in Fig. 6 of the paper). Note: this uses the neurophox ONN simulator framework.

Note on result consistency

You will need to set the PYTHONHASHSEED environment variable (in addition to setting the seeds for the various packages inside the notebook). For example, you can run jupyter lab like so:

PYTHONHASHSEED=0 jupyter lab

Note: for some reason this still doesn't give completely consistent results from run to run.

About

This notebook contains code for the machine learning tasks in the electro-optic activation function paper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published