Implementations of the present disclosure relate to visual programming for deep learning. A computer-implemented method comprises presenting a visual representation of an artificial neural network, the visual representation comprising graphical elements representing layers of the artificial neural network; in response to receiving a drag-and-drop operation on the graphical elements, modifying an intermediate representation of the artificial neural network, wherein the intermediate representation is independent of a deep learning framework and the drag-and-drop operation is configured to modify connections between the graphical elements; and modifying, based on the intermediate representation of the artificial neural network, code of the artificial neural network for a target deep learning framework.