Neural Arithmetic
Collection of layers that can perform arithmetic operations such as addition, subtraction, multiplication, and division in a single layer. Implements NALU, iNALU, NMU & NAU, and NPU.
And additionally FastNAU
and FastNPU
for use with DiffEqFlux.jl.
Simple Neural Arithmetic
As an example, we can train different layers to learn the function f
f(x,y) = (x+y, x*y, 1/x, sqrt(x))
which has two inputs and four outputs. The figure below plots the prediction error of each layer and output for training and testing datapoints. All layers that were trained on a range U(0.1,2).