ykiiiiii / GraDe_IF

Graph Denoising Diffusion for Inverse Protein Folding(NeurIPS 2023)
50 stars 5 forks source link

no attribute '__check_input__' #5

Closed QUEST2179 closed 10 months ago

QUEST2179 commented 10 months ago

Dear developer,

try to run the example, but it gave an error

in egnn_pytorch_geometric.py File "diffusion\model\egnn_pytorch\egnn_pytorch_geometric.py", line 250, in forward hidden_out, coors_out = self.propagate(edge_index, x=feats, edge_attr=edge_attr_feats, File "diffusion\model\egnn_pytorch\egnn_pytorch_geometric.py", line 273, in propagate size = self.check_input(edge_index, size) AttributeError: 'EGNN_Sparse' object has no attribute 'check_input'

after comment out #size = self.__check_input(edge_index, size) AttributeError: 'EGNN_Sparse' object has no attribute 'collect__'

ykiiiiii commented 10 months ago

Like #2 , pyg changed the function name from '__check_input' to '_check_input' and 'collect__' to '_collect' in 2.3.0.

If you run the code in torch-geometric==2.2.0 properly, it should be fine. Otherwise, you can change the function name to self._check_input in line 273 and self._collect in line 274.

I modify the code to work for both version, it should work now.

QUEST2179 commented 10 months ago

Thanks for pointing out. After changing to self._user_args in line 279, works great.

By the way, how to generate similar file to blosum_substitute.pt from a 'task-specific' transition matrix?

ykiiiiii commented 10 months ago

You can calculate an amino acid substitution matrix, similar to the https://en.wikipedia.org/wiki/BLOSUM, using sequences from your protein family of interest, such as Multiple Sequence Alignment (MSA). Then, you can apply the softmax function with varying temperatures to generate transition matrices for different diffusion time steps.

Furthermore, it's possible to compute a position-wise transition matrix. Currently, we use a single transition matrix for all amino acids in a protein.