-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to understand output to generate crystal graphs without training model #21
Comments
@txie-93 I think this is a related question on our part, but we are looking to extract an intermediate layer from CGCNN. Any suggestions on how to go about this? |
@vmeschke and @sgbaird Sorry for my slow reply. In case you haven't solved the problem, I feel the easiest way is to return the feature vector of the intermediate layer similar to the Lines 152 to 166 in d612a69
|
Hi @txie-93, Thank you for your response! By including crys_fea as a second output of model.py: CrystalGraphConvNet.forward(), I also need to update main.py train() and validate() Line 251 in d612a69
Line 350 in d612a69
to be output, crys_fea = model(*input_var) to avoid errors.
However, I'm a bit stuck at this point. Lines 173 to 178 in d612a69
train(): Line 226 in d612a69
validate(): Line 325 in d612a69
Using Spyder and debugging, Sterling P.S. I've been looking into how to extract the intermediate layers using PyTorch hooks, but haven't been able to figure it out, hence the above approach. I'm relatively new to python (bulk of my experience is in MATLAB and Mathematica). |
One iteration in the outer loop trains the model with the entire dataset. One iteration in the inner loop trains the model with one batch.
I think this is because you are having a batch size of 1? I am not exactly sure what you want. Sometime people want to visualize the learned feature vectors for each crystal. These feature vectors are usually only meaningful after the training. You may want to get all the feature vectors in the testing data? |
We're interested in extracting feature vectors for all the input crystals and trying to feed these into a different model. We were thinking that the first iteration might have the most "correspondence" to the original crystal structures, but we were also considering using the last iteration (i.e. I think before applying softmax?). Since we're not exactly sure whether we want the first, last, or an intermediate iteration's feature vectors (we will probably come to know through testing), I think what I want is to be able to extract
Could you elaborate? (also, when you say after the training, do you mean after all iterations of the outer loop?) |
Hi @txie-93 , |
Good morning!
I was wondering if there is an easy way to generate the crystal graphs for visualization with this code. While I would like to train a model later, I currently just want to visualize my dataset, and I'm finding it particularly hard with this code.
Thank you, and wonderful project! Everything runs smoothly with essentially no error.
Vanessa
The text was updated successfully, but these errors were encountered: