Fig. 3: Architecture and performance of the neural network (NN).

a Illustration of the neural network. The demodulated optical rotation signals' quadratures X and Y at the first and second harmonics of ωm form the 4-dimensional input. The NN gives the magnitude of the magnetic field B and its direction θ, φ as output. b Training process of the NN. Loss of the training set and validation set decreases with the rounds of iteration. Mean squared error is used as the loss function. There is no obvious difference between the training loss and validation loss which means no over-fitting. c Test of the validity of NN. Scattered points are predictions from the trained NN and solid lines are the dense reproduction of the input data through an inverse NN (see text), which show good agreement. In c1: θ = 60°, φ = 60°, in c2: φ = 60°, ΩL = 997 Hz, and in c3: θ = 60°, ΩL = 997 Hz.