HUBioDataLab / DrugGEN

Official implementation of DrugGEN
GNU General Public License v3.0
50 stars 16 forks source link

CUDA out of memory #15

Closed LiuJinzhe-Keepgoing closed 11 months ago

LiuJinzhe-Keepgoing commented 1 year ago

Thank you for your exciting work, which has benefited us a lot. However, when I was following your work, I wanted to use DrugGEN-Prot (the default model) to train two GAN models at the same time. However, when I train on a single Nvidia 3090 graphics card, there will be a CUDA out of memory situation. However, I see that your running graphics card is similar to mine. How should this situation be solved?

atabeyunlu commented 1 year ago

Thank you for your interest in our DrugGEN model. As of now, the model is in an iterative development phase, with ongoing adjustments to its design occurring on a daily basis. Consequently, there may be occasional variations in the required memory allocation. Nevertheless, should you encounter any error messages, I would be delighted to provide assistance.

LiuJinzhe-Keepgoing commented 1 year ago

Thank you very much for your reply, good brother. I have some questions about this code. The discriminator of this model doesn't seem to be perfect, it looks like a DEMO. In addition, in the train.py file, 823-841 lines: ` # bulk_data = load_data(data,

drugs,

            #                      self.inf_batch_size, 
            #                      self.device,
            #                      self.b_dim,
            #                      self.m_dim,
            #                      self.drugs_b_dim,
            #                      self.drugs_m_dim,
            #                      self.z_dim,
            #                      self.vertexes)   

            # drug_graphs, real_graphs, a_tensor, x_tensor, drugs_a_tensor, drugs_x_tensor, z, z_edge, z_node = bulk_data

            z, z_edge, z_node = generate_z_values(
                batch_size=self.batch_size,
                z_dim=self.z_dim,
                vertexes=self.vertexes,
                device=self.device,
            )`

This code doesn't seem to be used, but will it lead to the inability of GAN to generate new molecules? I am deeply inspired by your work, and I especially want to follow such a meaningful work. I look forward to your reply.

atabeyunlu commented 1 year ago

The discriminator of our model employs a straightforward Multi-Layer Perceptron (MLP) architecture. It takes a molecular graph in vectorized form as input and processes it to yield a singular prediction indicating whether the molecule is real or synthetic. While it's possible that additional discriminators may be integrated in the future, the current implementation relies on this MLP.

It's important to note that the code snippet you're observing is presently inactive. As stated in the pre-print, our model doesn't utilize noise inputs; instead, it employs starting molecules to generate new ones. Thus, the function you're reviewing is used solely to generate noise vectors, which aren't presently integrated into the process. Based on our experiments, omitting the use of noise input doesn't appear to have an impact on the generation of new molecules.