The generative model facilitates the connection between the chemical space and the latent space and provides a continuous representation for a molecule. It is an encoder-decoder architecture, with the encoder translating each chemical molecule into a latent vector z in a multi-dimensional continuous space, and the decoder retrieving the molecular structure from a latent vector z ′ . The optimization takes place in the latent space and the optimized structure is being retrieved using the decoder.