In 4D Printing, active materials are embedded in structures such that the application of an external stimulus, usually coming from the environment, results in a structural response. To design structures that achieve a targeted shape change for a defined stimulus, also known as shape morphing, the material distribution and structure needs to be tuned. However, the computational design of such material distributions and structures is a challenging task and remains, despite recent advances, unable to fully leverage the entire design freedom offered by state-of-the-art 4D printing technology. Notable gaps concern the handling of large and complex deformations, the high computational cost, and the exploration of the design space by the generation of alternative solutions. In this article, a method is presented to fill this gap. First, an artificial neural net is trained that represents a deformation map that occurs during actuation. Then, a shape morphing truss is designed that achieves this deformation during actuation. The method is used to solve four shape morphing problems, where superior capabilities are demonstrated in terms of magnitude and complexity of deformations that can be handled, efficient generation of alternative solutions and versatility. Due to these capabilities, the method enables exploration of the full potential of 4D printing technology to create stimuli-responsive, multifunctional structures.