jparkhill / TensorMol

Tensorflow + Molecules = TensorMol
http://blogs.nd.edu/parkhillgroup
GNU General Public License v3.0
271 stars 75 forks source link

Training Code Example #12

Closed Dom1L closed 6 years ago

Dom1L commented 6 years ago

Hello,

can you provide a small example on which steps to follow in order to use your code for training (and featurization etc)? I tried to use the test_h2o.py file in the sample directory as an example, but I wasn't able to get it to run (Python 2.7, Tensorflow 1.1).

So if there is already code for whatever data that was provided by you in the datasets directory or your google drive I would be happy about some hints on where to look.

Thank you very much!

jparkhill commented 6 years ago

Dominik-

At the moment test_tensormol01.py which tests evaluation of the posted network is the only test we've made for external use so far. The remainder are tests we use ourselves during development, and require some effort to understand how they can be adjusted to work in your scenario. We don't have any pre-cooked training sets posted, but generating your own if you have energy, force and dipole information for molecules isn't super difficult.

The routines TrainPrepare() and Train() in test_chemspider12.py would be the place to look for an example. If you want the same number of predictions made by our test network you want to create an MSet() filled with molecules that have the following defined properties: mol.properties['dipole']
mol.properties['energy'] mol.properties['gradients'] You will then also want to run CalculateAtomization() on every mol in the set (the networks reproduce atomization energy) You can then pretty much use that set in place of "a" in the TrainPrepare and Train() routines, and it will show you how to train a network on that data.

Training will never be as "black box" as evaluation. It depends on the quality of data and distribution of data. Start by just trying to learn energies near equilibrium and work up to forces, charges etc.

jparkhill commented 6 years ago

Note: Kun just added samples/Training_sample.py I think it still could benefit from a few additional cases...

jparkhill commented 6 years ago

This issue is addressed by /samples/training_sample.py

Dom1L commented 6 years ago

Thanks for the help John and Kun!