Skip to content

Conversation

MandaKausthubh
Copy link

@MandaKausthubh MandaKausthubh commented Jul 9, 2025

Description

Solves issue: #8

This PR adds support for MolGAN, a GAN-based model for molecular graph generation. It includes the MolGAN class, which is a class compatible with the BaseMolecularGenerator class with configurable architecture. It also uses RewardOracle, which supports both Neural Network-based reward function (based on the RewardNeuralNetwork and the NonNeuralNetwork reward class. However, please note that the neural network RL implementation does require more work. It also allows for future explorations, which can include config classes for defining generators and discriminators in the GAN class. Also allows for the graph implementation, which allows conversion from SMILE data and graphs with graph representation. Note that we do need to activate use_reward for the reward based training to work, otherwise works as a regular GAN. Future PRs can include Hugging Face support and better reward functions.

@aaronmkts
Copy link

Some questions about this implementation:

  1. In the implementation of the generator you hard code the following:
    node = F.gumbel_softmax(node, tau=self.config.tau, hard=True, dim=-1)
    adj = F.gumbel_softmax(adj, tau=self.config.tau, hard=True, dim=1)

However during training this would give discreet structures which can be hard to backprogate through. I believe in the original implementation they use a softmax function with the option for the user to switch between softmax, soft_gumbel and hard gumbel. During evaluation one can then use torch.max to get a discreet structure.

  1. For the reward network they pretrain this for the first half of the epochs, after the first half of the epochs they add the reward network into the generator loss function .

  2. You have two options for the reward, the Oracle and the reward network, I believe there should only be the reward network and the oracle is used to train this network? Ther reward network used in the original paper is the same as the discriminator architecture however they change the last layer to a sigmoid activation function.

Let me know if the above makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants