cgcnn icon indicating copy to clipboard operation
cgcnn copied to clipboard

Predict at atom level

Open ma763 opened this issue 4 years ago • 3 comments

Hello,

Thank you so much for this project, very interesting!

I am trying to use this package to do a regression prediction to the atom level instead of predicting a property for the whole crystal. I am trying to input the atom labels but struggling to change the data.py script accordingly... what would be the easiest way to input the atom labels?

And I guess I need to output the atom prediction before the pooling? Does this correspond to return out of def forward(): in model.py?

Thanks! Marta

ma763 avatar Feb 11 '21 17:02 ma763

I think you will need to get the atom features before pooling, as you suggested. The atom features are atom_fea at the following line.

https://github.com/txie-93/cgcnn/blob/d612a69530a72ba686fca56813657b89f2440cc5/cgcnn/model.py#L154

txie-93 avatar Feb 11 '21 18:02 txie-93

Okay, that's helpful, will try this!

However, I am still struggling to input the atom label data for training (instead of giving a label for the whole crystal structure). Is it even possible? Or if not, do you recommend that I try another package for what I am trying to do?

I really appreciate your help, thank you very much.

ma763 avatar Feb 12 '21 18:02 ma763

You will need to change the data loader in that case.

Check out the dataset class here. https://github.com/txie-93/cgcnn/blob/d612a69530a72ba686fca56813657b89f2440cc5/cgcnn/data.py#L350

You may also need to change the collate function. https://github.com/txie-93/cgcnn/blob/d612a69530a72ba686fca56813657b89f2440cc5/cgcnn/data.py#L96

txie-93 avatar Feb 16 '21 04:02 txie-93