fancompute / neuroptica

Flexible simulation package for optical neural networks
https://doi.org/10.1109/JSTQE.2019.2930455
MIT License
208 stars 40 forks source link

Autograd activations #6

Open twhughes opened 5 years ago

twhughes commented 5 years ago

This introduces automatic computation of the backpropagation through activation functions.

Changes:

There is only one Nonlinearity class. Real, complex, and non-holomorphic activations handled exactly the same way.

You only need to specify the forward_pass() method of each nonlinearity. Autograd will take care of the backward pass for you.