AbstractBiological systems rely on complex networks, such as transcriptional circuits and protein-protein interaction networks, to perform a variety of functions e.g. responding to stimuli, directing cell fate, or patterning an embryo. Mathematical models are often used to ask: given some network, what function does it perform? However, we often want precisely the opposite i.e. given some circuit – either observedin vivo, or desired for some engineering objective – what biological networks could execute this function? Here, we adapt optimization algorithms from machine learning to rapidly screen and design gene circuits capable of performing arbitrary functions. We demonstrate the power of this approach by designing circuits (1) that recapitulate importantin vivophenomena, such as oscillators, and (2) to perform complex tasks for synthetic biology, such as counting noisy biological events. Our method can be readily applied to biological networks of any type and size, and is provided as an open-source and easy-to-use python module, GeneNet.