Skip to content

Commit

Permalink
Merge branch 'main' into rgao_expandable_segments
Browse files Browse the repository at this point in the history
  • Loading branch information
rayg1234 committed Jul 19, 2024
2 parents 51ba122 + f9ecf73 commit b043c83
Show file tree
Hide file tree
Showing 16 changed files with 357 additions and 58 deletions.
2 changes: 1 addition & 1 deletion docs/core/fine-tuning/fine-tuning-oxides.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ We get this checkpoint here.
```{code-cell} ipython3
from fairchem.core.models.model_registry import model_name_to_local_file
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/fairchem_checkpoints/')
```

The data we need is provided in `supporting-information.json`. That file is embedded in the supporting information for the article, and is provided here in the tutorial. We load this data and explore it a little. The json file provides a dictionary with the structure:
Expand Down
18 changes: 9 additions & 9 deletions docs/core/gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The problem here is that no neighbors are found for the single atom which causes
```{code-cell} ipython3
from fairchem.core.common.relaxation.ase_utils import OCPCalculator
from fairchem.core.models.model_registry import model_name_to_local_file
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/fairchem_checkpoints/')
calc = OCPCalculator(checkpoint_path=checkpoint_path)
```

Expand Down Expand Up @@ -79,7 +79,7 @@ add_adsorbate(slab, 'O', height=1.2, position='fcc')
from fairchem.core.models.model_registry import model_name_to_local_file
# OC20 model - trained on adsorption energies
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EF-OC20-All', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EF-OC20-All', local_cache='/tmp/fairchem_checkpoints/')
with contextlib.redirect_stdout(StringIO()) as _:
calc = OCPCalculator(checkpoint_path=checkpoint_path, cpu=False)
Expand All @@ -92,7 +92,7 @@ slab.get_potential_energy()

```{code-cell} ipython3
# An OC22 checkpoint - trained on total energy
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/fairchem_checkpoints/')
with contextlib.redirect_stdout(StringIO()) as _:
calc = OCPCalculator(checkpoint_path=checkpoint_path, cpu=False)
Expand All @@ -105,7 +105,7 @@ slab.get_potential_energy()

```{code-cell} ipython3
# This eSCN model is trained on adsorption energies
checkpoint_path = model_name_to_local_file('eSCN-L4-M2-Lay12-S2EF-OC20-2M', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('eSCN-L4-M2-Lay12-S2EF-OC20-2M', local_cache='/tmp/fairchem_checkpoints/')
with contextlib.redirect_stdout(StringIO()) as _:
calc = OCPCalculator(checkpoint_path=checkpoint_path, cpu=False)
Expand Down Expand Up @@ -158,7 +158,7 @@ from fairchem.core.common.relaxation.ase_utils import OCPCalculator
from fairchem.core.models.model_registry import model_name_to_local_file
import os
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/fairchem_checkpoints/')
calc = OCPCalculator(checkpoint_path=checkpoint_path)
```
Expand All @@ -184,7 +184,7 @@ from fairchem.core.common.relaxation.ase_utils import OCPCalculator
from fairchem.core.models.model_registry import model_name_to_local_file
import os
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/fairchem_checkpoints/')
calc = OCPCalculator(checkpoint_path=checkpoint_path)
```

Expand All @@ -209,7 +209,7 @@ from fairchem.core.common.relaxation.ase_utils import OCPCalculator
from fairchem.core.models.model_registry import model_name_to_local_file
import os
checkpoint_path = model_name_to_local_file('EquiformerV2-31M-S2EF-OC20-All+MD', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('EquiformerV2-31M-S2EF-OC20-All+MD', local_cache='/tmp/fairchem_checkpoints/')
calc = OCPCalculator(checkpoint_path=checkpoint_path)
```
Expand All @@ -231,7 +231,7 @@ This happens because a random selection of is made to sample edges, and a differ
from fairchem.core.models.model_registry import model_name_to_local_file
from fairchem.core.common.relaxation.ase_utils import OCPCalculator
checkpoint_path = model_name_to_local_file('EquiformerV2-31M-S2EF-OC20-All+MD', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('EquiformerV2-31M-S2EF-OC20-All+MD', local_cache='/tmp/fairchem_checkpoints/')
calc = OCPCalculator(checkpoint_path=checkpoint_path, cpu=True)
from ase.build import fcc111, add_adsorbate
Expand All @@ -258,7 +258,7 @@ In DFT, the forces on all the atoms should sum to zero; otherwise, there is a ne

```{code-cell} ipython3
from fairchem.core.models.model_registry import model_name_to_local_file
checkpoint_path = model_name_to_local_file('EquiformerV2-31M-S2EF-OC20-All+MD', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('EquiformerV2-31M-S2EF-OC20-All+MD', local_cache='/tmp/fairchem_checkpoints/')
from fairchem.core.common.relaxation.ase_utils import OCPCalculator
calc = OCPCalculator(checkpoint_path=checkpoint_path, cpu=True)
Expand Down
2 changes: 1 addition & 1 deletion docs/core/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ print(available_pretrained_models)
```{code-cell} ipython3
from fairchem.core.models.model_registry import model_name_to_local_file
checkpoint_path = model_name_to_local_file('GemNet-dT-S2EFS-OC22', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-dT-S2EFS-OC22', local_cache='/tmp/fairchem_checkpoints/')
checkpoint_path
```
Expand Down
48 changes: 45 additions & 3 deletions docs/core/papers_using_models.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Studies that have leveraged OCP models
# Studies leveraging pre-trained or fine-tuned FAIR-Chem models

Many papers have now used FAIR-Chem models to accelerate screening and discovery efforts and enable new computational chemistry simulations. We highlight some here just to give an idea of the breadth of possibilities and how they have been used. Feel free to reach out (or submit PRs) if you want them included!

## Accelerating computational catalysis

```{bibliography}
:style: plain
:filter: category == "accelerating catalysis"
```

## Transfer/fine-tuning strategies for FAIR-Chem pre-trained checkpoints

```{bibliography}
:style: plain
:filter: category == "transfer strategies"
```

## Transfer/fine-tuning applications for FAIR-Chem pre-trained checkpoints

```{bibliography}
:style: plain
:filter: category == "transfer applications"
```

## Catalyst discovery or optimization

```{bibliography}
:style: plain
:filter: category == "catalyst discovery"
```

## Uncertainty quantification

```{bibliography}
:style: plain
:filter: category == "uncertainty"
```

## Properties beyond energies and forces

```{bibliography}
:style: plain
:filter: category == "other properties"
```

Many papers have now used the latest OCP models to accelerate screening and discovery efforts and enable new computational chemistry simulations!
We highlight some here just to give an idea of the breadth of possibilities and how they have been used. Feel free to reach out (or submit PRs with links to your papers if you want them included)!

2 changes: 1 addition & 1 deletion docs/core/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ print(available_pretrained_models)

```{code-cell} ipython3
from fairchem.core.models.model_registry import model_name_to_local_file
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-OC-S2EFS-OC20+OC22', local_cache='/tmp/fairchem_checkpoints/')
checkpoint_path
```

Expand Down
4 changes: 2 additions & 2 deletions docs/legacy_tutorials/OCP_Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ relax_dataset = "data/is2re/val_20/data.lmdb"

from fairchem.core.models.model_registry import model_name_to_local_file

checkpoint_path = model_name_to_local_file('GemNet-dT-S2EF-OC20-All', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-dT-S2EF-OC20-All', local_cache='/tmp/fairchem_checkpoints/')

```

Expand Down Expand Up @@ -2021,7 +2021,7 @@ For this tutorial we download one of our earlier model checkpoints: GemNet-T

from fairchem.core.models.model_registry import model_name_to_local_file

checkpoint_path = model_name_to_local_file('GemNet-dT-S2EF-OC20-All', local_cache='/tmp/ocp_checkpoints/')
checkpoint_path = model_name_to_local_file('GemNet-dT-S2EF-OC20-All', local_cache='/tmp/fairchem_checkpoints/')

```

Expand Down
Loading

0 comments on commit b043c83

Please sign in to comment.