Skip to content
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

Add support for Pymatgen StructureGraph with different local_env strategies #18

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1fdb2d7
remove zero-padding using torch-scatter
CompRhys May 30, 2019
bea1349
Merge https://github.com/txie-93/cgcnn
CompRhys Feb 7, 2020
74773b8
working implementation with torch-scatter
CompRhys Feb 7, 2020
ad656c2
Provide support for Pymatgen's StructureGraph
Mar 23, 2020
c662cbb
Better support for calling Pymatgen NN algos from command line
Mar 23, 2020
9c8a7f6
Better parsing of input arguments
Mar 23, 2020
f6482e6
Clarify warning when # neighbors < max_num_nbr
Mar 23, 2020
938afe1
Clarify documentation for new nn_object flag
Mar 23, 2020
3c6cd6b
Fix self.radius bug when set to None
Mar 23, 2020
ea73ea6
Fix inconsistent tabs/spacing
Mar 23, 2020
6f97423
Move definition of self.nn_object do __init__
Mar 23, 2020
dd7e981
Undo modification to CIFData defaults
Mar 23, 2020
fea23aa
Fix print statement (test --> validation)
Mar 24, 2020
3907bd4
Decrease number of changes to parent code
Mar 24, 2020
155e6be
Remove log files from #16 (PR)
Mar 24, 2020
9ab3228
Remove lingering test_results.csv
Mar 24, 2020
48c3a88
Make output folder if not present
Mar 24, 2020
a80e5eb
Fix off-by-one error in log file
Mar 24, 2020
8a707f6
Consistent numbering in log file
Mar 24, 2020
bea5d82
Fix numbering in log file of predict.py
Mar 24, 2020
4bc19a5
Fix validation/test print name in log file
Mar 24, 2020
2ec5953
Provide support for saving crystal graphs to .pkl files
Mar 25, 2020
55059ac
Fix predict.py with updated zero-padding patch
Apr 7, 2020
95bc3bc
Use os.path.join rather than forcing "/" in paths
Apr 7, 2020
4aced1d
Add option for tanh and more command line options
Apr 7, 2020
f2f4628
Update installation instructions
Apr 7, 2020
92e5aa1
Fix \n typo
Apr 7, 2020
f861a3f
Better use of predict.py
Apr 7, 2020
12d1ba9
Make new predict.py options optional
Apr 7, 2020
8f67bb0
Ensure no breaking changes
Apr 7, 2020
b4552a6
Clarify name of predict.py csv files
Apr 7, 2020
0f4def0
Add missing enable_tanh argument in predict.py
Apr 7, 2020
4371f60
Provide warning if reading .json files
Apr 7, 2020
09faafa
Update README.md
Apr 7, 2020
ba55eb5
Save .json files as default
Apr 7, 2020
74e3e83
Merge remote-tracking branch 'origin/master'
Apr 7, 2020
acbca8b
Update README.md
Apr 7, 2020
df163da
Fix arg in predict.py
Apr 7, 2020
891cfe9
Merge remote-tracking branch 'origin/master'
Apr 7, 2020
7b61ac5
Clarify --disable-save-torch in predict.py
Apr 7, 2020
c26f4a9
Remove unused flag in CIFData
Apr 7, 2020
46dde05
Clean torch data if specified in predict.py
Apr 7, 2020
3de07e6
Remove old Py2 imports
Apr 8, 2020
52a5894
Clarify warning statement
Apr 12, 2020
a084923
PEP8 update
May 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@ Local

# .DS_Store
.DS_Store

data/atom_init_rev.json

data/readme.txt
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,33 @@ Please cite the following work if you want to use CGCNN.

This package requires:

- [PyTorch](http://pytorch.org)
- [scikit-learn](http://scikit-learn.org/stable/)
- [pymatgen](http://pymatgen.org)
- [PyTorch](http://pytorch.org) (tested on v.1.4.0)
- [PyTorch Scatter](https://github.com/rusty1s/pytorch_scatter)
- [scikit-learn](http://scikit-learn.org/stable/) (tested on v.0.22.1)
- [pymatgen](http://pymatgen.org) (tested on v.2020.3.13)

If you are new to Python, the easiest way of installing the prerequisites is via [conda](https://conda.io/docs/index.html). After installing [conda](http://conda.pydata.org/), run the following command to create a new [environment](https://conda.io/docs/user-guide/tasks/manage-environments.html) named `cgcnn` and install all prerequisites:
If you are new to Python, the easiest way of installing the prerequisites is via [conda](https://conda.io/docs/index.html) and `pip`. After installing [conda](http://conda.pydata.org/), run the following command to create a new [environment](https://conda.io/docs/user-guide/tasks/manage-environments.html) named `cgcnn` and install all prerequisites:

```bash
conda upgrade conda
conda create -n cgcnn python=3 scikit-learn pytorch torchvision pymatgen -c pytorch -c conda-forge
conda create -n cgcnn python=3
source activate cgcnn
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
pip install torch-scatter==latest+cu101 -f https://pytorch-geometric.com/whl/torch-1.4.0.html
conda install scikit-learn
pip install pymatgen
```

*Note: this code is tested for PyTorch v1.0.0+ and is not compatible with versions below v0.4.0 due to some breaking changes.

This creates a conda environment for running CGCNN. Before using CGCNN, activate the environment by:

```bash
source activate cgcnn
```

finally once inside the environment install torch-scatter

```bash
pip install torch-scatter
```

Then, in directory `cgcnn`, you can test if all the prerequisites are installed properly by running:

```bash
Expand Down Expand Up @@ -189,7 +197,7 @@ To reproduce our paper, you can download the corresponding datasets following th

## Authors

This software was primarily written by [Tian Xie](http://txie.me) who was advised by [Prof. Jeffrey Grossman](https://dmse.mit.edu/faculty/profile/grossman).
This software was primarily written by [Tian Xie](http://txie.me) and [Prof. Jeffrey Grossman](https://dmse.mit.edu/faculty/profile/grossman). This version contains [changes made by Rhys Goodall](https://github.com/txie-93/cgcnn/pull/16) to remove zero-padding. This version also contains several changes made by [Andrew S. Rosen](https://asrosen.com/) to enhance the usability of the CGCNN code, including but not limited to: new command-line arguments, saving the CIF data as .json files so they don't have to be regenerated on-the-fly, and [the option](https://github.com/txie-93/cgcnn/pull/17) to use crystal graphs generated by Pymatgen. If using the `--enable-tanh` flag, you should consider referencing the work of [Noh et al.](https://pubs.acs.org/doi/10.1021/acs.jcim.0c00003), who called this approach CGCNN-H.

## License

Expand Down
Loading