h2o64 commited on
Commit
f55dafa
·
verified ·
1 Parent(s): c3127b2

Write the dataset card of v1

Browse files
Files changed (1) hide show
  1. README.md +152 -0
README.md CHANGED
@@ -1,3 +1,155 @@
1
  ---
2
  license: cc-by-4.0
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-4.0
3
+ pretty_name: samplingdb reference sets
4
+ tags:
5
+ - sampling
6
+ - mcmc
7
+ - benchmark
8
+ - bayesian-inference
9
+ - molecular-dynamics
10
+ - statistical-physics
11
+ size_categories:
12
+ - 100K<n<1M
13
  ---
14
+
15
+ # samplingdb reference sets
16
+
17
+ Reference samples for the targets of [samplingdb](https://github.com/h2o64/samplingdb), a PyTorch
18
+ library of unnormalised densities for benchmarking samplers. A sampler's output is scored against
19
+ these sets. Each one comes from a long MCMC run on the target's own density, and was checked for
20
+ convergence and independence before it was published here.
21
+
22
+ You do not need to download anything by hand. samplingdb fetches a set the first time it is used,
23
+ checks its sha256, and keeps it in its cache.
24
+
25
+ ## Quick start
26
+
27
+ ```sh
28
+ pip install git+https://github.com/h2o64/samplingdb
29
+ ```
30
+
31
+ ```python
32
+ from samplingdb import build
33
+
34
+ target = build('lj55')
35
+ reference = target.test_samples(n=10000) # downloads the set once (66 MB), then reads the cache
36
+ metrics = target.compute_metrics(samples) # samples: your sampler's output, same shape
37
+ ```
38
+
39
+ To fetch sets ahead of time, for example before a job on machines with no internet access:
40
+
41
+ ```python
42
+ import samplingdb
43
+
44
+ samplingdb.download_references(['lj55', 'aldp']) # by catalog name
45
+ samplingdb.download_references() # every published set, 3.1 GB
46
+ ```
47
+
48
+ The cache is `~/.cache/samplingdb`, or the directory `SAMPLINGDB_CACHE` names. It is laid out like
49
+ this repo, so a copy of the repo is a ready cache:
50
+
51
+ ```sh
52
+ hf download h2o64/samplingdb --repo-type dataset --revision v1 --local-dir "$SAMPLINGDB_CACHE"
53
+ ```
54
+
55
+ Without samplingdb, every file is a plain NumPy array:
56
+
57
+ ```python
58
+ import numpy as np
59
+ from huggingface_hub import hf_hub_download
60
+
61
+ path = hf_hub_download('h2o64/samplingdb', 'pt/dw4_6b739c6d.npy', repo_type='dataset', revision='v1')
62
+ x = np.load(path) # (n_samples, dim)
63
+ ```
64
+
65
+ ## Files
66
+
67
+ Each row of an array is one sample, flattened, in the coordinates the samplingdb target's
68
+ `log_prob` takes:
69
+
70
+ | Folder | Targets | Coordinates |
71
+ | --- | --- | --- |
72
+ | `pt/` | DW-4, LJ-13, LJ-55 | particle positions; samplingdb removes the centre of mass when it reads them |
73
+ | `swapmc/` | ternary Kob-Andersen glass | particle positions in the periodic box, species in canonical order |
74
+ | `md/` | peptides | atom positions in nanometres, in the atom order of the released PDB |
75
+ | `stan/` | Bayesian posteriors | the unconstrained parameters, in samplingdb's order |
76
+
77
+ A file is named `<folder>/<target name>_<spec_id>.npy`. The `spec_id` is a hash of the constants
78
+ that define the density, so a set can never be read against a different density than the one it
79
+ was drawn from. Next to every array, `<same name>_manifest.json` records the target, its `spec_id`,
80
+ the full generation protocol with its diagnostics, and the array's sha256.
81
+
82
+ | File | `build` name | Samples | dim | dtype | Size | Independence |
83
+ | --- | --- | --- | --- | --- | --- | --- |
84
+ | `pt/dw4_6b739c6d.npy` | `dw4` | 102400 | 8 | float32 | 3.3 MB | 91% effective |
85
+ | `pt/lj13_6a0a72c4.npy` | `lj13` | 102400 | 39 | float32 | 16.0 MB | 98% effective |
86
+ | `pt/lj55_dc3f6b7e.npy` | `lj55` | 100352 | 165 | float32 | 66.2 MB | 100% effective |
87
+ | `stan/seeds_f9a50f20.npy` | `seeds` | 100000 | 26 | float64 | 20.8 MB | bulk ESS 96% of the draws |
88
+ | `stan/brownian_45794097.npy` | `brownian` | 100000 | 32 | float64 | 25.6 MB | bulk ESS 92% of the draws |
89
+ | `stan/lgcp_cea6d9a6.npy` | `lgcp` | 100000 | 1600 | float64 | 1280.0 MB | bulk ESS 90% of the draws |
90
+ | `stan/lgcp-whitened_30e98363.npy` | `lgcp-whitened` | 100000 | 1600 | float64 | 1280.0 MB | bulk ESS 98% of the draws |
91
+ | `stan/breast-cancer_543f5f94.npy` | `breast-cancer` | 100000 | 31 | float64 | 24.8 MB | bulk ESS 102% of the draws |
92
+ | `stan/german-credit_3cfdf175.npy` | `german-credit` | 100000 | 25 | float64 | 20.0 MB | bulk ESS 110% of the draws |
93
+ | `stan/ionosphere_d00109c3.npy` | `ionosphere` | 100000 | 35 | float64 | 28.0 MB | bulk ESS 96% of the draws |
94
+ | `stan/sonar_52aa10ef.npy` | `sonar` | 100000 | 61 | float64 | 48.8 MB | bulk ESS 108% of the draws |
95
+ | `md/aaa-T310_e0bfbee3.npy` | `trialanine` | 100000 | 99 | float32 | 39.6 MB | 92% effective |
96
+ | `md/aaaaaa-T310_08d2d916.npy` | `hexaalanine` | 100005 | 189 | float32 | 75.6 MB | 98% effective |
97
+ | `md/ace-a-nme-T300_54968005.npy` | `aldp` | 100000 | 66 | float32 | 26.4 MB | 96% effective |
98
+ | `md/ace-aaa-nme-T300_cda31701.npy` | `ala4` | 100000 | 126 | float32 | 50.4 MB | 94% effective |
99
+ | `swapmc/ka-ternary-N44-T0.32_d50e8a3f.npy` | `ka-ternary-T0.32` | 105600 | 88 | float32 | 37.2 MB | 20 relaxation times apart |
100
+ | `swapmc/ka-ternary-N44-T1.0_c0f9b3b8.npy` | `ka-ternary-T1.0` | 102400 | 88 | float32 | 36.0 MB | 20 relaxation times apart |
101
+
102
+ Independence is the effective sample size as a fraction of the rows: measured on the stored chains
103
+ for the tempered runs, and Stan's smallest bulk ESS for the posteriors, which exceeds 100% where
104
+ successive NUTS draws are anticorrelated. For the glass it is the spacing between stored
105
+ configurations of one chain, in structural relaxation times.
106
+
107
+ The rows are interleaved across chains, so the first `n` rows of a file span every chain of the run
108
+ that produced it, and `test_samples(n=...)` can read a prefix.
109
+
110
+ ## How the sets were made
111
+
112
+ Every set was generated by a script in the `gen/` folder of the samplingdb repository, which
113
+ documents each protocol and its acceptance checks in `docs/reference-sets.md`.
114
+
115
+ | Folder | Sampler | Checked before writing |
116
+ | --- | --- | --- |
117
+ | `pt/` | non-reversible parallel tempering with HMC moves | every chain makes 10 round trips and every pair of adjacent levels accepts at least 5% of its swaps; the merged set is at least 90% independent, with no drift from its start |
118
+ | `md/` | replica-exchange molecular dynamics with solute tempering, BAOAB at 1 fs | every replica makes a round trip and every pair of adjacent levels accepts at least 5% of its swaps; the merged set is at least 90% independent on the pair distances and backbone torsions, with no drift from its start |
119
+ | `swapmc/` | swap Monte Carlo: 100 relaxation times of equilibration, then one configuration every 20 | consecutive configurations of a chain have decorrelated, and the specific heat agrees between the two halves of the run |
120
+ | `stan/` | Stan's NUTS, on models written in samplingdb's own coordinates | Stan's log density equals samplingdb's to 1e-9; R-hat below 1.01, bulk ESS above 90% of the draws, no divergences |
121
+
122
+ ## Not published yet
123
+
124
+ Two catalogued targets have no set in this release. A later release will add them under a new tag.
125
+
126
+ - `ka-binary-T0.2`, the binary Kob-Andersen glass of Cheng et al. 2026. Its parallel-tempering
127
+ replicas that crystallise stay trapped at intermediate temperatures, and the set generated so far
128
+ is not stationary.
129
+ - `chignolin`. Its folding equilibrium is expensive to sample, and the planned 10 000-structure
130
+ set has not been run yet.
131
+
132
+ ## Versions
133
+
134
+ samplingdb pins one tag of this repo and the sha256 of every file it reads. A release adds files
135
+ under a new tag and never replaces a published one, so every samplingdb version keeps reading the
136
+ exact bytes it was tested against. A density change gets a new `spec_id`, and therefore a new file.
137
+
138
+ | Tag | Contents |
139
+ | --- | --- |
140
+ | `v1` | the 17 sets above |
141
+
142
+ ## License and attribution
143
+
144
+ The samples are released under CC BY 4.0. They are draws from densities that others defined, so
145
+ please also credit the sources of the densities you use:
146
+
147
+ - DW-4, LJ-13 and LJ-55: the potentials of Köhler et al. 2020, as implemented in bgflow.
148
+ - The logistic regressions: the Ionosphere, Sonar, Statlog (German Credit) and Breast Cancer
149
+ Wisconsin (Diagnostic) datasets of the UCI Machine Learning Repository, under CC BY 4.0. Seeds:
150
+ the data of Crowder 1978. Brownian: the model of inference_gym. LGCP: the Finnish pines data of
151
+ Møller et al. 1998.
152
+ - The peptides: the systems of the Sequential Boltzmann Generators data (Tan et al. 2025), with the
153
+ Amber ff99SB-ILDN and ff14SB force fields and OBC implicit solvent, evaluated with OpenMM.
154
+ - The ternary glass: the swap-friendly Kob-Andersen mixture of Jung et al. 2023, after Kob and
155
+ Andersen 1995.