A computer-implemented method of machine-learning a neural network comprising: - providing a Variational Auto-encoder, VAE, architecture for a neural network which is configured at inference to take as an input a 2D sketch and a random variable (ε), and to output a 3D model represented by the 2D sketch; and - learning the neural network; wherein a 2D sketch is a 2D image data structure comprising one or more strokes representing a 3D shape from a respective viewpoint from where the 3D shape is visible, wherein the neural network comprises: - a first part which is configured to take the 2D sketch and the random variable (ε) as inputs and to provide a respective output, and - a second part which is configured to take the respective output of the first part as input and to output the 3D model; wherein the 3D model is defined by a section and an extrusion, the section being defined by a list of positional parameters, and the neural network comprises a recurrent neural network, RNN, configured to output a value for the list; and wherein the neural network is further configured to output a value (h) for the extrusion based on a final state of the RNN, the section being further defined by a number representing a type of the section, the neural network being further configured to output a vector representing a probability distribution for the number, and the outputting of the value (h) for the extrusion and/or for the list of positional parameters is further based on the vector representing the probability distribution. - providing a Variational Auto-encoder, VAE, architecture for a neural network which is configured at inference to take as an input a 2D sketch and a random variable (ε), and to output a 3D model represented by the 2D sketch; and - learning the neural network; wherein a 2D sketch is a 2D image data structure comprising one or more strokes representing a 3D shape from a respective viewpoint from where the 3D shape is visible, wherein the neural network comprises: - a first part which is configured to take the 2D sketch and the random variable (ε) as inputs and to provide a respective output, and - a second part which is configured to take the respective output of the first part as input and to output the 3D model; wherein the 3D model is defined by a section and an extrusion, the section being defined by a list of positional parameters, and the neural network comprises a recurrent neural network, RNN, configured to output a value for the list; and wherein the neural network is further configured to output a value (h) for the extrusion based on a final state of the RNN, the section being further defined by a number representing a type of the section, the neural network being further configured to output a vector representing a probability distribution for the number, and the outputting of the value (h) for the extrusion and/or for the list of positional parameters is further based on the vector representing the probability distribution. wherein a 2D sketch is a 2D image data structure comprising one or more strokes representing a 3D shape from a respective viewpoint from where the 3D shape is visible, wherein the neural network comprises: - a first part which is configured to take the 2D sketch and the random variable (ε) as inputs and to provide a respective output, and - a second part which is configured to take the respective output of the first part as input and to output the 3D model; - a first part which is configured to take the 2D sketch and the random variable (ε) as inputs and to provide a respective output, and - a second part which is configured to take the respective output of the first part as input and to output the 3D model; wherein the 3D model is defined by a section and an extrusion, the section being defined by a list of positional parameters, and the neural network comprises a recurrent neural network, RNN, configured to output a value for the list; and wherein the neural network is further configured to output a value (h) for the extrusion based on a final state of the RNN, the section being further defined by a number representing a type of the section, the neural network being further configured to output a vector representing a probability distribution for the number, and the outputting of the value (h) for the extrusion and/or for the list of positional parameters is further based on the vector representing the probability distribution.