Wavefield solutions from machine learned functions constrained by the Helmholtz equation