Skip to content

Commit 162231e

Browse files
committed
Added links to ED-AFM paper pretrained weights and molecule dataset.
1 parent 253ab79 commit 162231e

File tree

4 files changed

+37
-10
lines changed

4 files changed

+37
-10
lines changed

mlspm/_weights.py

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
"graph-ice-au111-bilayer": "https://zenodo.org/records/10054348/files/weights_ice-au111-bilayer.pth?download=1",
1212
"asdafm-light": "https://zenodo.org/records/10514470/files/weights_asdafm_light.pth?download=1",
1313
"asdafm-heavy": "https://zenodo.org/records/10514470/files/weights_asdafm_heavy.pth?download=1",
14+
"edafm-base": "https://zenodo.org/records/10606273/files/base.pth?download=1",
15+
"edafm-single-channel": "https://zenodo.org/records/10606273/files/single-channel.pth?download=1",
16+
"edafm-CO-Cl": "https://zenodo.org/records/10606273/files/CO-Cl.pth?download=1",
17+
"edafm-Xe-Cl": "https://zenodo.org/records/10606273/files/Xe-Cl.pth?download=1",
18+
"edafm-constant-noise": "https://zenodo.org/records/10606273/files/constant-noise.pth?download=1",
19+
"edafm-uniform-noise": "https://zenodo.org/records/10606273/files/uniform_noise.pth?download=1",
20+
"edafm-no-gradient": "https://zenodo.org/records/10606273/files/no-gradient.pth?download=1",
21+
"edafm-matched-tips": "https://zenodo.org/records/10606273/files/matched-tips.pth?download=1",
1422
}
1523

1624

@@ -21,11 +29,30 @@ def download_weights(weights_name: str, target_path: Optional[PathLike] = None)
2129
The following weights are available:
2230
2331
- ``'graph-ice-cu111'``: PosNet trained on ice clusters on Cu(111). (https://doi.org/10.5281/zenodo.10054348)
24-
- ``'graph-ice-au111-monolayer'``: PosNet trained on monolayer ice clusters on Au(111). (https://doi.org/10.5281/zenodo.10054348)
25-
- ``'graph-ice-au111-bilayer'``: PosNet trained on bilayer ice clusters on Au(111). (https://doi.org/10.5281/zenodo.10054348)
26-
- ``'asdafm-light'``: ASDAFMNet trained on molecules containing the elements H, C, N, O, and F. (https://doi.org/10.5281/zenodo.10514470)
27-
- ``'asdafm-heavy'``: ASDAFMNet trained on molecules additionally containing Si, P, S, Cl, and Br. (https://doi.org/10.5281/zenodo.10514470)
28-
32+
- ``'graph-ice-au111-monolayer'``: PosNet trained on monolayer ice clusters on Au(111).
33+
(https://doi.org/10.5281/zenodo.10054348)
34+
- ``'graph-ice-au111-bilayer'``: PosNet trained on bilayer ice clusters on Au(111).
35+
(https://doi.org/10.5281/zenodo.10054348)
36+
- ``'asdafm-light'``: :class:`.ASDAFMNet` trained on molecules containing the elements H, C, N, O, and F.
37+
(https://doi.org/10.5281/zenodo.10514470)
38+
- ``'asdafm-heavy'``: :class:`.ASDAFMNet` trained on molecules additionally containing Si, P, S, Cl, and Br.
39+
(https://doi.org/10.5281/zenodo.10514470)
40+
- ``'edafm-base'``: :class:`.EDAFMNet` used for all predictions in the main ED-AFM paper and used for comparison in
41+
the various tests in the supplementary information of the paper. (https://doi.org/10.5281/zenodo.10606273)
42+
- ``'edafm-single-channel'``: :class:`.EDAFMNet` trained on only a single CO-tip AFM input.
43+
(https://doi.org/10.5281/zenodo.10606273)
44+
- ``'edafm-CO-Cl'``: :class:`.EDAFMNet` trained on alternative tip combination of CO and Cl.
45+
(https://doi.org/10.5281/zenodo.10606273)
46+
- ``'edafm-Xe-Cl'``: :class:`.EDAFMNet` trained on alternative tip combination of Xe and Cl.
47+
(https://doi.org/10.5281/zenodo.10606273)
48+
- ``'edafm-constant-noise'``: :class:`.EDAFMNet` trained using constant noise amplitude instead of normally distributed
49+
amplitude. (https://doi.org/10.5281/zenodo.10606273)
50+
- ``'edafm-uniform-noise'``: :class:`.EDAFMNet` trained using uniform random noise amplitude instead of normally
51+
distributed amplitude. (https://doi.org/10.5281/zenodo.10606273)
52+
- ``'edafm-no-gradient'``: :class:`.EDAFMNet` trained without background-gradient augmentation.
53+
(https://doi.org/10.5281/zenodo.10606273)
54+
- ``'edafm-matched-tips'``: :class:`.EDAFMNet` trained on data with matched tip distance between CO and Xe,
55+
instead of independently randomized distances. (https://doi.org/10.5281/zenodo.10606273)
2956
3057
Arguments:
3158
weights_name: Name of weights to download.

mlspm/datasets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"AFM-ice-relaxed": "https://zenodo.org/records/10362511/files/relaxed_structures.tar.gz?download=1",
1616
"ASD-AFM-molecules": "https://zenodo.org/records/10562769/files/molecules.tar.gz?download=1",
1717
"AFM-camphor-exp": "https://zenodo.org/records/10562769/files/afm_camphor.tar.gz?download=1",
18+
"ED-AFM-molecules": "https://zenodo.org/records/10606443/files/molecules_rebias.tar.gz?download=1",
1819
}
1920

2021

@@ -43,6 +44,7 @@ def download_dataset(name: str, target_dir: PathLike):
4344
- ``'AFM-ice-relaxed'``: https://doi.org/10.5281/zenodo.10362511
4445
- ``'ASD-AFM-molecules'``: https://doi.org/10.5281/zenodo.10562769 - 'molecules.tar.gz'
4546
- ``'AFM-camphor-exp'``: https://doi.org/10.5281/zenodo.10562769 - 'afm_camphor.tar.gz'
47+
- ``'ED-AFM-molecules'``: https://doi.org/10.5281/zenodo.10606443
4648
4749
Arguments:
4850
name: Name of the dataset to download.

mlspm/image/models.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ class EDAFMNet(AttentionUNet):
396396
Arguments:
397397
device: Device to load model onto.
398398
trained_weights: If not None, load the specified pretrained weights to the model.
399-
weights_dir: If **weights_type** is not None, the directory where the weights will be downloaded into.
400399
"""
401400

402401
def __init__(
@@ -405,7 +404,6 @@ def __init__(
405404
pretrained_weights: Optional[
406405
Literal["base", "single-channel", "CO-Cl", "Xe-Cl", "constant-noise", "uniform-noise", "no-gradient", "matched-tips"]
407406
] = None,
408-
weights_dir: PathLike = "./weights",
409407
):
410408
if pretrained_weights == "single-channel":
411409
n_in = 1
@@ -440,7 +438,7 @@ def __init__(
440438
)
441439

442440
if pretrained_weights:
443-
weights_path = download_weights(f"ed-afm-{pretrained_weights}", weights_dir)
441+
weights_path = download_weights(f"edafm-{pretrained_weights}")
444442
self.load_state_dict(torch.load(weights_path))
445443

446444

papers/ed-afm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ In `EDAFMNet` one can also specify pretrained weights of several types to downlo
2828
- 'no-gradient': Model trained without background-gradient augmentation.
2929
- 'matched-tips': Model trained on data with matched tip distance between CO and Xe, instead of independently randomized distances.
3030

31-
The model weights can also be downloaded directly from https://www.dropbox.com/sh/1jd4h7ovpafg3uk/AACQX6C6Nks6RxGbvqb6vIo-a?dl=0. The weights are saved in the state_dict format of PyTorch.
31+
The model weights can also be downloaded directly from https://doi.org/10.5281/zenodo.10606273. The weights are saved in the state_dict format of PyTorch.
3232

3333
## Data and model training
3434

35-
We don't provide the full training/validation/test sets for download because they are very large (~1TiB in total). Instead, we provide the database of molecular geometries that can be used to generate the full dataset using ProbeParticleModel. The provided script `generate_data.py` does the data generation and will download the molecule database automatically. Alternatively, the molecule database can be downloaded directly from https://www.dropbox.com/s/z4113upq82puzht/Molecules_rebias_210611.tar.gz?dl=0.
35+
We don't provide the full training/validation/test sets for download because they are very large (~1TiB in total). Instead, we provide the database of molecular geometries that can be used to generate the full dataset using ProbeParticleModel. The provided script `generate_data.py` does the data generation and will download the molecule database automatically. Alternatively, the molecule database can be downloaded directly from https://doi.org/10.5281/zenodo.10606443.
3636

3737
The model training can be done using the provided script `train.py`. Note that performing the training using all the same settings as we used requires a significant amount of time and also a significant amount VRAM on the GPU, likely more than can be found on a single GPU. In our case the model training took ~5 days using 4 x Nvidia Tesla V100 (32GB) GPUs. However, inference on the trained model can be done even on a single lower-end GPU or on CPU.
3838

0 commit comments

Comments
 (0)