Closed ldhkc closed 2 months ago
Hi @ldhkc ,
sorry for the delayed reply. I assume that you mean sampling of molecules with specific target properties when you ask about the prediction process. Because cG-SchNet does not predict property values, but it takes property values as additional inputs to the model, which influences the predicted probabilities of atom types and atom positions in the sampling of molecules. In this way, we can sample molecules that are likely to exhibit the properties that we provided to the model as input.
For example, if we give HOMO-LUMO gap=5 eV to the model, it should sample many structures that have HOMO-LUMO gap close to 5 eV. However, the model will not give you a predicted HOMO-LUMO gap value. If you want to predict the HOMO-LUMO gap of a structure instead, you can train a SchNet or PaiNN model with the main package schnetpack
(https://github.com/atomistic-machine-learning/schnetpack).
Regarding the specific questions:
_property_unit_dict
and a _distance_unit
. For example, if your data set has structures with coordinates in Angstrom
and a custom attribute called my_attribute
with unit eV
, the metadata would look like: {'_property_unit_dict': {'my_attribute': 'eV'}, '_distance_unit': 'Ang'}
. A more detailed example of this is given in the readme: https://github.com/atomistic-machine-learning/schnetpack-gschnet?tab=readme-ov-file#using-custom-data_property_unit_dict
in the metadata. Otherwise, our code will not be able to access your custom properties.my_conditioning.yaml
, you have to add it to the template config. Just replace the line - override /model/conditioning: null
with -override /model/conditioning: my_conditioning
. You can find more details on the conditioning configs in the readme: https://github.com/atomistic-machine-learning/schnetpack-gschnet/blob/main/README.md#specifying-target-properties If your attribute is scalar, we have implemented an embedding using Gaussian expansion of the scalar value. We also have a module for vector valued attributes (e.g. fingerprints). If your attribute has a very specific shape or meaning, you might need to invent another way to embed it. Only then you will have to adjust the python code by writing your own ConditionEmbedding.Hope this is helpful! Best, Niklas
PS.: If your attribute does not have a unit or the unit does not exist in ASE, you can also write "my_attribute": ""
in the _property_unit_dict
. But the attribute has to be listed in there.
@NiklasGebauer Thank you very much for your detailed response to my question in your busy schedule, your reply has resolved many doubts in my mind, thank you again for your patience. After reading your reply, I still have some questions that need further clarification:
1、Regarding the metadata you mentioned, does this metadata refer to the metadata discussed in the ASE database? Specifically as shown in
2、Regarding the paper "Symmetry-adapted generation of 3d point sets for the targeted discovery of molecules", I tried to run the code according to the help documentation you provided on GitHub. The code ran and automatically generated a molecular data file named qm9.db. When I opened this file with DB Browser for SQLite, I noticed that the atomic coordinates and atomic numbers are stored in the table named systems, while the molecule's property data is stored in the cells of the data column of the table, as shown in red in the
. I would like to ask, by mentioning metadata, do you mean storing these molecule properties and their units in this location? Or should they be stored in a table called information as shown in the
?
3、You mentioned {'_property_unit_dict': {'my_attribute': 'eV'}, '_distance_unit': 'Ang'}, and I'm currently only using one attribute. Would this qualify if stored in the data format {'my_attribute': 'my_attribute_unit'} as mentioned in the second question? If I have multiple attributes, should I store them in the following format: {'my_attribute_1': 'my_attribute_unit_1', 'my_attribute_2': 'my_attribute_unit_2'}?
4、Regarding your fourth reply, did you develop a script that determines the validity of a molecule based on connectivity and valence checks of the molecular structure? Or do you add more bases of judgment on top of that?
I look forward to your answering these questions at your convenience, and thank you very much for your help and support.
Dear @ldhkc ,
_property_unit_dict
and the _distance_unit
.qm9.db
is a good starting point, it has exactly the required format.You should store your data in the same way: The atomic coordinates and numbers of the molecules are stored as systems. The data field contains the actual attribute values of the molecule. So yes, you need to store the data there. The information part only contains the metadata, i.e., the _property_unit_dict
and the _distance_unit
, not the property values of each molecule. You can also use schnetpack
to write your data set in the correct format following our tutorials: https://schnetpack.readthedocs.io/en/latest/tutorials/tutorial_01_preparing_data.html#Preparing-your-own-dataBest, Niklas
@NiklasGebauer Thank you very much for your detailed response, it has helped me resolve many of my doubts. I may need to ask you again if there are any other questions that follow. Thanks again for your excellent help and support.
Dear Dr. Niklas Gebauer,
I've recently been using your project to train a custom dataset and trying to apply it on new attributes. During this process, I encountered some doubts about property training, especially how to handle custom properties that are not included in schnetpack's properties.py file.
My understanding is that the data training part of the project mainly relies on the atomic coordinates and atomic number information of the molecules. schnetpack seems to be trained mainly on its built-in properties (such as force, energy, energy gap, etc.). Therefore, I would like to ask a few questions:
good luck,
[ldhkc]