The challenge posed by the many-body problem in quantum physics originates from the difficulty of describing the non-trivial correlations encoded in the exponential complexity of the many-body wave function. Here we demonstrate that systematic machine learning of the wave function can reduce this complexity to a tractable computational form, for some notable cases of physical interest. We introduce a variational representation of quantum states based on artificial neural networks with variable number of hidden neurons. A reinforcement-learning scheme is then demonstrated, capable of either finding the ground-state or describing the unitary time evolution of complex interacting quantum systems. We show that this approach achieves very high accuracy in the description of equilibrium and dynamical properties of prototypical interacting spins models in both one and two dimensions, thus offering a new powerful tool to solve the quantum many-body problem.The wave function Ψ is the fundamental object in quantum physics and possibly the hardest to grasp in a classical world. Ψ is a monolithic mathematical quantity that contains all the information on a quantum state, be it a single particle or a complex molecule. In principle, an exponential amount of information is needed to fully encode a generic many-body quantum state. However, Nature often proves herself benevolent, and a wave function representing a physical many-body system can be typically characterized by an amount of information much smaller than the maximum capacity of the corresponding Hilbert space. A limited amount of quantum entanglement, as well as the typicality of a small number of physical states, are then the blocks on which modern approaches build upon to solve the many-body Schrödinger's equation with a limited amount of classical resources.Numerical approaches directly relying on the wave function can either sample a finite number of physically relevant configurations or perform an efficient compression of the quantum state. Stochastic approaches, like quantum Monte Carlo (QMC) methods, belong to the first category and rely on probabilistic frameworks typically demanding a positive-semidefinite wave function. [1][2][3]. Compression approaches instead rely on efficient representations of the wave function, and most notably in terms of matrix product states (MPS) [4][5][6] or more general tensor networks [7,8]. Examples of systems where existing approaches fail are however numerous, mostly due to the sign problem in QMC [9], and to the inefficiency of current compression approaches in high-dimensional systems. As a result, despite the striking success of these methods, a large number of unexplored regimes exist, including many interesting open problems. These encompass fundamental questions ranging from the dynamical properties of high-dimensional systems [10,11] to the exact ground-state properties of strongly interacting fermions [12,13]. At the heart of this lack of understanding lyes the difficulty in finding a general strategy to reduce the exp...