Skip to content

Commit

Permalink
deploy: 87e111f
Browse files Browse the repository at this point in the history
  • Loading branch information
zulissimeta committed Apr 14, 2024
1 parent b0b4b9d commit 7f773ef
Show file tree
Hide file tree
Showing 29 changed files with 2,382 additions and 1,528 deletions.
16 changes: 8 additions & 8 deletions _downloads/5fdddbed2260616231dbf7b0d94bb665/train.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
2024-04-14 18:46:02 (INFO): Project root: /home/runner/work/ocp/ocp
2024-04-14 19:19:53 (INFO): Project root: /home/runner/work/ocp/ocp
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/torch/cuda/amp/grad_scaler.py:126: UserWarning: torch.cuda.amp.GradScaler is enabled, but CUDA is not available. Disabling.
warnings.warn(
2024-04-14 18:46:03 (WARNING): Detected old config, converting to new format. Consider updating to avoid potential incompatibilities.
2024-04-14 18:46:03 (INFO): amp: true
2024-04-14 19:19:54 (WARNING): Detected old config, converting to new format. Consider updating to avoid potential incompatibilities.
2024-04-14 19:19:54 (INFO): amp: true
cmd:
checkpoint_dir: fine-tuning/checkpoints/2024-04-14-18-46-24-ft-oxides
commit: 962bffa
checkpoint_dir: fine-tuning/checkpoints/2024-04-14-19-20-32-ft-oxides
commit: 87e111f
identifier: ft-oxides
logs_dir: fine-tuning/logs/wandb/2024-04-14-18-46-24-ft-oxides
logs_dir: fine-tuning/logs/wandb/2024-04-14-19-20-32-ft-oxides
print_every: 10
results_dir: fine-tuning/results/2024-04-14-18-46-24-ft-oxides
results_dir: fine-tuning/results/2024-04-14-19-20-32-ft-oxides
seed: 0
timestamp_id: 2024-04-14-18-46-24-ft-oxides
timestamp_id: 2024-04-14-19-20-32-ft-oxides
dataset:
a2g_args:
r_energy: true
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 6 additions & 10 deletions _sources/tutorials/advanced/embeddings.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ We provide 5 different kinds of embeddings:
4. 'x_E sum' - summed over atoms
5. 'x_F sum' - This is related to the forces

In principle other models could be adapted in a similar way. See [embedding-monkeypatch.py](./embedding-monkeypatch.py) for details on the patch. We simply run this notebook below to load it.
In principle other models could be adapted in a similar way. See [embedding-monkeypatch.py](./embedding-monkeypatch.py) for details on the patch. We simply load the module to monkeypatch GemNet-OC.

The OCP project is still under active development, and it is not yet clear what the best way to access these embeddings are, so this code is not yet part of the main development branch. This code was adapted from a branch at https://github.com/Open-Catalyst-Project/ocp/blob/gnoc-embeddings.

```{code-cell} ipython3
import embedding_monkeypatch
```

The OCP project is still under active development, and it is not yet clear what the best way to access these embeddings are, so this code is not yet part of the main development branch. This code was adapted from a branch at https://github.com/Open-Catalyst-Project/ocp/blob/gnoc-embeddings.


# A diagnostic example

Here we will look at an equation of state for bulk fcc Cu.
Expand Down Expand Up @@ -109,6 +111,8 @@ x1, x2, x3 = out['h sum'], out['x_E sum'], out['x_F sum']
Next, we loop over a grid of lattice constants, and we compare the cosine similarity of the embeddings for each one to the reference embeddings above. A similarity of 1 means they are the same, and as the similarity decreases it means the embbedings are more and more different (and so is the energy).

```{code-cell} ipython3
import torch
E = []
LC = np.linspace(0.95 * a0, 1.05 * a0, 200)
Expand Down Expand Up @@ -192,11 +196,6 @@ embeddings = np.array(embeddings)
embeddings.shape
```

```{code-cell} ipython3
%%capture
! pip install umap-learn
```

Now we use a tool like umap. This will take the 40 vectors with 256 dimensions each, and reduce these to two dimennsions where similar embeddings remain close together. You should see two clusters. The one labeled 1 with 40 points is the bulk set.

```{code-cell} ipython3
Expand Down Expand Up @@ -261,9 +260,6 @@ Our database is very small, it only contains embeddings for ethanol and ethane.

Note in this example, we have to tag all the atoms with 1 for GemnetOC to work.

```{code-cell} ipython3
! pip install vdict 2&>1 /devnull
```

Here we set up the simple database. Each row, or entry, is the actual embedding vector for an atom. That is the key that points to the atom index and the atoms object. I use cosine similarity here. If you use the default (l2) then you may not find anything close enough.

Expand Down
8 changes: 4 additions & 4 deletions core/fine-tuning/fine-tuning-oxides.html
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ <h1>Fine tuning a model<a class="headerlink" href="#fine-tuning-a-model" title="
warnings.warn(
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Elapsed time 71.2 seconds.
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Elapsed time 67.3 seconds.
</pre></div>
</div>
<img alt="../../_images/92bd7f94dd548c8cfc2744eb5890cd23fada1ff98e8dc907657e2eb109af0402.png" src="../../_images/92bd7f94dd548c8cfc2744eb5890cd23fada1ff98e8dc907657e2eb109af0402.png" />
Expand Down Expand Up @@ -1128,7 +1128,7 @@ <h2>Running the training job<a class="headerlink" href="#running-the-training-jo
<span class="expanded">Hide code cell output</span>
</summary>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Elapsed time = 5.1 seconds
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Elapsed time = 4.7 seconds
</pre></div>
</div>
</div>
Expand All @@ -1144,7 +1144,7 @@ <h2>Running the training job<a class="headerlink" href="#running-the-training-jo
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&#39;fine-tuning/checkpoints/2024-04-14-18-46-24-ft-oxides&#39;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&#39;fine-tuning/checkpoints/2024-04-14-19-20-32-ft-oxides&#39;
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -1194,7 +1194,7 @@ <h2>Running the training job<a class="headerlink" href="#running-the-training-jo
<span class="g g-Whitespace"> </span><span class="mi">425</span> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">mode</span><span class="p">):</span>
<span class="ne">--&gt; </span><span class="mi">426</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">mode</span><span class="p">))</span>

<span class="ne">FileNotFoundError</span>: [Errno 2] No such file or directory: &#39;fine-tuning/checkpoints/2024-04-14-18-46-24-ft-oxides/checkpoint.pt&#39;
<span class="ne">FileNotFoundError</span>: [Errno 2] No such file or directory: &#39;fine-tuning/checkpoints/2024-04-14-19-20-32-ft-oxides/checkpoint.pt&#39;
</pre></div>
</div>
</div>
Expand Down
26 changes: 13 additions & 13 deletions core/gotchas.html
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ <h1>I get wildly different energies from the different models<a class="headerlin
warnings.warn(
</pre></div>
</div>
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>1.6722240447998047
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>1.6726934909820557
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -1433,7 +1433,7 @@ <h1>To tag or not?<a class="headerlink" href="#to-tag-or-not" title="Link to thi
warnings.warn(
</pre></div>
</div>
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.42973750829696655
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.4297369718551636
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -1483,17 +1483,17 @@ <h1>Stochastic simulation results<a class="headerlink" href="#stochastic-simulat
warnings.warn(
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>1.213987445831299 1.0936112347774234e-06
1.2139878273010254
1.2139873504638672
1.2139878273010254
1.2139873504638672
1.2139885425567627
1.2139897346496582
1.213987112045288
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>1.2139864683151245 1.2206006752176479e-06
1.213986873626709
1.2139849662780762
1.2139849662780762
1.2139880657196045
1.213984489440918
1.213986873626709
1.2139856815338135
1.2139861583709717
1.2139873504638672
1.213986873626709
1.2139880657196045
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -1536,7 +1536,7 @@ <h1>The forces don’t sum to zero<a class="headerlink" href="#the-forces-don-t-
warnings.warn(
</pre></div>
</div>
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>array([ 0.00847837, 0.01409242, -0.05882645], dtype=float32)
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>array([ 0.00847878, 0.01409772, -0.05882716], dtype=float32)
</pre></div>
</div>
</div>
Expand All @@ -1549,7 +1549,7 @@ <h1>The forces don’t sum to zero<a class="headerlink" href="#the-forces-don-t-
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>array([-6.1525498e-08, 1.7229468e-08, -3.5762787e-07], dtype=float32)
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>array([ 5.1339157e-08, 4.6449713e-08, -1.1920929e-07], dtype=float32)
</pre></div>
</div>
</div>
Expand Down
Loading

0 comments on commit 7f773ef

Please sign in to comment.