Skip to content

Commit 4ce353b

Browse files
committed
fix ptable_heatmap_plotly precision keyword renamed to fmt
add figshare URL to pbenner's 16M MACE checkpoint update pre-commit hooks
1 parent 2fcf6c2 commit 4ce353b

File tree

10 files changed

+27
-20
lines changed

10 files changed

+27
-20
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ __pycache__
1313
data/**/raw
1414
data/**/tsne
1515
!data/mp/2023-02-07-mp-elemental-reference-entries.json.gz
16+
models/**/checkpoints
1617

1718
# slurm + Weights and Biases logs
1819
wandb/

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default_install_hook_types: [pre-commit, commit-msg]
77

88
repos:
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.1.2
10+
rev: v0.1.5
1111
hooks:
1212
- id: ruff
1313
args: [--fix]
@@ -30,7 +30,7 @@ repos:
3030
- id: trailing-whitespace
3131

3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v1.6.1
33+
rev: v1.7.0
3434
hooks:
3535
- id: mypy
3636
additional_dependencies: [types-pyyaml, types-requests]
@@ -56,7 +56,7 @@ repos:
5656
exclude: ^(site/src/figs/.+\.svelte|data/wbm/20.+\..+|site/src/routes/.+\.(yaml|json)|changelog.md)$
5757

5858
- repo: https://github.com/pre-commit/mirrors-eslint
59-
rev: v8.52.0
59+
rev: v8.53.0
6060
hooks:
6161
- id: eslint
6262
types: [file]

data/figshare/1.0.0.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"https://figshare.com/ndownloader/files/41233560",
55
"2023-06-02-pbenner-best-alignn-model.pth.zip"
66
],
7-
"mace_checkpoint": [
7+
"mace_checkpoint_1": [
88
"https://figshare.com/ndownloader/files/42374049",
99
"2023-08-14-mace-yuan-trained-mptrj-04.model"
1010
],
11+
"mace_checkpoint_2": [
12+
"https://figshare.com/ndownloader/files/43117273",
13+
"2023-10-29-mace-16M-pbenner-mptrj-no-conditional-loss.model"
14+
],
1115
"mp_computed_structure_entries": [
1216
"https://figshare.com/ndownloader/files/40344436",
1317
"2023-02-07-mp-computed-structure-entries.json.gz"

data/mp/get_mp_energies.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
# most points lie on line y=x for x > 0 and y = 0 for x < 0.
112112
n_above_line = sum(mask_above_line)
113113
ax.set(
114-
title=f"{n_above_line:,} / {len(df):,} = {n_above_line/len(df):.1%} "
114+
title=f"{n_above_line:,} / {len(df):,} = {n_above_line / len(df):.1%} "
115115
"MP materials with\nenergy_above_hull - decomposition_enthalpy.clip(0) > 0.1"
116116
)
117117
# ax.figure.savefig(f"{module_dir}/mp-e-above-hull-vs-decomp-enth.webp", dpi=300)

models/cgcnn/train_cgcnn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
for idx in trange(n_perturb, desc="Generating perturbed structures"):
7373
df_aug[input_col] = [perturb_structure(x) for x in structs]
7474
df_in = pd.concat(
75-
[df_in, df_aug.set_index(f"{x}-aug={idx+1}" for x in df_aug.index)]
75+
[df_in, df_aug.set_index(f"{x}-aug={idx + 1}" for x in df_aug.index)]
7676
)
7777

7878
del df_aug

models/mace/test_mace.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,22 @@
3939
relax_cell = True
4040
model_name = [
4141
# MACE trained on M3GNet training set by original MACE authors
42-
"2023-07-14-mace-ilyes-MPF-2021-2-8-big-128-6",
42+
# 9M = model size (number of trainable params), 9,255,168 to be exact
43+
"2023-07-14-mace-9M-ilyas-universal-2-big-128-6",
4344
# MACE trained by Yuan Chiang on CHGNet training set
44-
"2023-08-14-mace-yuan-mptrj-04",
45-
"2023-09-03-mace-yuan-mptrj-slower-14-lr-13_run-3",
46-
"2023-10-29-mace-pbenner-mptrj-no-conditional-loss",
47-
][-1]
45+
"2023-08-14-mace-2M-yuan-mptrj-04",
46+
"2023-09-03-mace-2M-yuan-mptrj-slower-14-lr-13_run-3",
47+
"2023-10-29-mace-16M-pbenner-mptrj-no-conditional-loss",
48+
][0]
4849

4950
slurm_vars = slurm_submit(
5051
job_name=job_name,
5152
out_dir=out_dir,
5253
account="matgen",
53-
time="4:55:0",
54+
time="9:55:0",
5455
array=f"1-{slurm_array_task_count}",
55-
# slurm_flags="--qos shared --constraint gpu --gpus 1",
56-
slurm_flags="--qos shared --constraint cpu --mem 16G",
56+
slurm_flags="--qos shared --constraint gpu --gpus 1",
57+
# slurm_flags="--qos shared --constraint cpu --mem 16G",
5758
)
5859

5960

models/voronoi/train_test_voronoi_rf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
feature_names = featurizer.feature_labels()
9191
n_nans = df_train[feature_names].isna().any(axis=1).sum()
9292

93-
print(f"train set NaNs: {n_nans:,} / {len(df_train):,} = {n_nans/len(df_train):.3%}")
93+
print(f"train set NaNs: {n_nans:,} / {len(df_train):,} = {n_nans / len(df_train):.3%}")
9494

9595
df_train = df_train.dropna(subset=feature_names)
9696

@@ -110,7 +110,7 @@
110110

111111
# %%
112112
n_nans = df_test[feature_names].isna().any(axis=1).sum()
113-
print(f"test set NaNs: {n_nans:,} / {len(df_train):,} = {n_nans/len(df_train):.1%}")
113+
print(f"test set NaNs: {n_nans:,} / {len(df_train):,} = {n_nans / len(df_train):.1%}")
114114

115115
df_test = df_test.dropna(subset=feature_names)
116116

scripts/analyze_model_failure_cases.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
if normalized
198198
else elem_counts[col],
199199
color_bar=dict(title=col),
200-
precision=".3f",
200+
fmt=".3f",
201201
cscale_range=[0, 0.1],
202202
)
203203
fig.show()

scripts/model_figs/per_element_errors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117
# %% plot per-element std dev of DFT hull dist
118118
fig = ptable_heatmap_plotly(
119-
df_elem_err[test_set_std_col], precision=".2f", colorscale="Inferno"
119+
df_elem_err[test_set_std_col], fmt=".2f", colorscale="Inferno"
120120
)
121121
fig.show()
122122

@@ -136,7 +136,7 @@
136136
per_elem_err /= df_elem_err[test_set_std_col]
137137
per_elem_err.name = f"{model} (normalized by test set std)"
138138
fig = ptable_heatmap_plotly(
139-
per_elem_err, precision=".2f", colorscale="Inferno", cscale_range=cs_range
139+
per_elem_err, fmt=".2f", colorscale="Inferno", cscale_range=cs_range
140140
)
141141
fig.show()
142142

site/src/routes/contribute/+page.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
const descriptions = {
1212
alignn_checkpoint: "ALIGNN model trained on <code>mp_computed_structure_entries</code>",
13-
mace_checkpoint: "MACE model trained on the MPtrj dataset (https://figshare.com/articles/dataset/23713842)",
13+
mace_checkpoint_1: "2M params MACE model trained by Yuan Chiang on MPtrj (https://figshare.com/articles/dataset/23713842)",
14+
mace_checkpoint_2: "16M params MACE model trained by Philipp Benner on MPtrj (https://figshare.com/articles/dataset/23713842)",
1415
mp_computed_structure_entries:
1516
`JSON-Serialized MP ${cse_link} objects containing relaxed structures and DFT final energies`,
1617
mp_elemental_ref_entries: `Minimum energy ComputedEntry for each element in MP`,

0 commit comments

Comments
 (0)