The ability to tailor a specific electromagnetic field pattern along an arbitrary selected surface is interesting and of substantial importance, given its numerous immediate applications. It belongs to a class of inverse source problems, and, as such, it is particularly challenging when only partial data are given. Here, a deep learning-based method that is able to map the electromagnetic field from an arbitrarily selected surface to a flat surface is presented. This method is used to realize, experimentally, arbitrary target field patterns on an arbitrary concave surface facing a source field on a flat programmable optical element. In addition, phase retrieval capability is demonstrated for finding both the phase and amplitude on an input flat surface from knowing only the amplitude on an arbitrarily selected surface.