Abstract In the canonical approach of loop quantum gravity, arguably the most important outstanding problem is finding and interpreting solutions to the Hamiltonian constraint. In this work, we demonstrate that methods of machine learning are in principle applicable to this problem. We consider U(1) BF theory in three dimensions, quantised with loop quantum gravity methods. In particular, we formulate a master constraint corresponding to Hamilton and Gauß constraints using loop quantum gravity methods. To make the problem amenable for numerical simulation we fix a graph and introduce a cutoff on the kinematical degrees of freedom, effectively considering U q ( 1 ) BF theory at a root of unity. We show that the neural network quantum state ansatz can be used to numerically solve the constraints efficiently and accurately. We compute expectation values and fluctuations of certain observables and compare them with exact results or exact numerical methods where possible. We also study the dependence on the cutoff.