  Photonic neural networks have demonstrated their potential over the past
decades, but have not yet reached the full extent of their capabilities. One
reason for this lies in an essential component - the nonlinear activation
function, which ensures that the neural network can perform the required
arbitrary nonlinear transformation. The desired all-optical nonlinear
activation function is difficult to realize, and as a result, most of the
reported photonic neural networks rely on opto-electronic activation functions.
Usually, the sacrifices made are the unique advantages of photonics, such as
resource-efficient coherent and frequency-multiplexed information encoding. In
addition, opto-electronic activation functions normally limit the photonic
neural network depth by adding insertion losses. Here, we experimentally
demonstrate an in-fiber photonic nonlinear activation function based on
stimulated Brillouin scattering. Our design is coherent and frequency
selective, making it suitable for multi-frequency neural networks. The
optoacoustic activation function can be tuned continuously and all-optically
between a variety of activation functions such as LeakyReLU, Sigmoid, and
Quadratic. In addition, our design amplifies the input signal with gain as high
as $20\,\mathrm{dB}$, compensating for insertion losses on the fly, and thus
paving the way for deep optical neural networks.
