  We propose a novel paradigm to vector magnetometry based on machine learning.
Unlike conventional schemes where one measured signal explicitly connects to
one parameter, here we encode the three-dimensional magnetic-field information
in the set of four simultaneously acquired signals, i.e., the oscillating
optical rotation signal's harmonics of a frequency modulated laser beam
traversing the atomic sample. The map between the recorded signals and the
vectorial field information is established through a pre-trained deep neural
network. We demonstrate experimentally a single-shot all optical vector atomic
magnetometer, with a simple scalar-magnetometer design employing only one
elliptically-polarized laser beam and no additional coils. Magnetic field
amplitude sensitivities of about 100 $\textrm{fT}/\sqrt{\textrm{Hz}}$ and
angular sensitivities of about 100 $\mu rad/\sqrt{\textrm{Hz}}$ (for a magnetic
field of about 140 nT) are derived from the neural network. Our approach can
reduce the complexity of the architecture of vector magnetometers, and may shed
light on the general design of multiparameter sensing.
