Home

Awesome

GraDe_IF: Graph Denoising Diffusion for Inverse Protein Folding (NeurIPS 2023)

GraDe_IF

Description

Implementation for "Graph Denoising Diffusion for Inverse Protein Folding" arxiv link.

Requirements

To install requirements:

conda env create -f environment.yml

Usage

Like denoising-diffusion-pytorch, there is a brief introduction to show how this discrete diffusion work.

import sys
sys.path.append('diffusion')

import torch
from torch_geometric.data import Batch
from diffusion.gradeif import GraDe_IF,EGNN_NET
from dataset_src.generate_graph import prepare_graph

gnn = EGNN_NET(input_feat_dim=input_graph.x.shape[1]+input_graph.extra_x.shape[1],hidden_channels=10,edge_attr_dim=input_graph.edge_attr.shape[1])

diffusion_model = GraDe_IF(gnn)

graph = torch.load('dataset/process/test/3fkf.A.pt')
input_graph = Batch.from_data_list([prepare_graph(graph)])

loss = diffusion_model(input_graph)
loss.backward()

_,sample_seq = diffusion_model.ddim_sample(input_graph) #using structure information generate sequence

More details can be found in the jupyter notebook

Parameter Chosen in Sampling

Here is an ablation study of two key parameters, step and diverse, in the ddim_sample function used to get improved results presented in the paper. The following results were computed after 50 ensemble runs. One can find how to do ensembles in the jupyter notebook.

BLOSUM Kernel - Diverse Mode

StepRecovery RatePerplexitySingle Sample Recovery Rate
5000.53414.020.505
2500.53704.060.4679
1000.53564.980.4213
500.48278.020.3745

BLOSUM Kernel - Non-Diverse Mode

StepRecovery RatePerplexitySingle Sample Recovery Rate
5000.53424.020.505
2500.53734.120.4741
1000.53517.430.5016
500.499916.740.4736

Uniform Kernel - Diverse Mode

StepRecovery RatePerplexitySingle Sample Recovery Rate
5000.52864.080.5022
2500.52924.130.4325
1000.53295.280.4222
500.53415.910.4212

Uniform Kernel - Non-Diverse Mode

StepRecovery RatePerplexitySingle Sample Recovery Rate
5000.52864.080.5022
2500.52734.090.4357
1000.52389.490.5095
500.528515.530.5113

Comments

Citation

If you consider our codes and datasets useful, please cite:

@inproceedings{
      yi2023graph,
      title={Graph Denoising Diffusion for Inverse Protein Folding},
      author={Kai Yi and Bingxin Zhou and Yiqing Shen and Pietro Lio and Yu Guang Wang},
      booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
      year={2023},
      url={https://openreview.net/forum?id=u4YXKKG5dX}
      }