Materials with target nonlinear mechanical response can support the design of innovative soft robots, wearable devices, footwear, and energy-absorbing systems, yet it is challenging to realize them. Here, mechanical metamate- rials based on hinged quadrilaterals are used as a platform to realize target nonlinear mechanical responses. It is first shown that by changing the shape of the quadrilaterals, the amount of internal rotations induced by the applied compression can be tuned, and a wide range of mechanical responses is achieved. Next, a neural network is introduced that provides a computation- ally inexpensive relationship between the parameters describing the geometry and the corresponding stress–strain response. Finally, it is shown that by combining the neural network with an evolution strategy, one can efficiently identify geometries resulting in a wide range of target nonlinear mechanical responses and design optimized energy-absorbing systems, soft robots, and morphing structures.